package com.crm.activity.service;

import com.crm.rely.backend.core.dto.base.BaseLongSelectDto;
import com.crm.rely.backend.model.pojo.table.ActivityRaceRuleTable;

import java.util.Date;
import java.util.List;

/**
 * 活动规则记录服务
 *
 * @author y
 * @create 2022/7/21
 */
public interface ActivityRaceRuleService {

    List<BaseLongSelectDto> getAllDropDownByType(Integer raceType) throws Exception;

    List<BaseLongSelectDto> getDropDownForCustomByType(Long customId, Integer raceType) throws Exception;

    Integer getNextSerialByRaceType(Integer raceType) throws Exception;

    void saveTable(ActivityRaceRuleTable table) throws Exception;

    /**
     * 根据时间查询当前需要计算的规则
     *
     * @param date
     * @return
     * @throws Exception
     */
    List<ActivityRaceRuleTable> findAllCaleRule(Date date) throws Exception;

    /**
     * 根据开始结束时间、规则类型判断是否存在规则
     * @param startDate
     * @param endDate
     * @param raceType
     * @return
     */
    Boolean existsByDate(Date startDate, Date endDate, Integer raceType);

}
