package cn.iocoder.yudao.module.system.service.holiday.holidaysetting;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.module.system.controller.admin.holiday.holidaysetting.vo.HolidaySettingPageReqVO;
import cn.iocoder.yudao.module.system.controller.admin.holiday.holidaysetting.vo.HolidaySettingRespVO;
import cn.iocoder.yudao.module.system.controller.admin.holiday.holidaysetting.vo.HolidaySettingSaveReqVO;
import cn.iocoder.yudao.module.system.dal.dataobject.holiday.holidaybalancesetting.HolidayBalanceSettingDO;
import cn.iocoder.yudao.module.system.dal.dataobject.holiday.holidaysetting.HolidaySettingDO;

import javax.validation.Valid;
import java.time.LocalDateTime;
import java.util.List;

/**
 * 假期设置 Service 接口
 *
 * @author 艾楷
 */
public interface HolidaySettingService {

    /**
     * 创建假期设置
     *
     * @param createReqVO 创建信息
     * @return 编号
     */
    Long createHolidaySetting(@Valid HolidaySettingSaveReqVO createReqVO);

    /**
     * 更新假期设置
     *
     * @param updateReqVO 更新信息
     */
    void updateHolidaySetting(@Valid HolidaySettingSaveReqVO updateReqVO);

    /**
     * 删除假期设置
     *
     * @param id 编号
     */
    void deleteHolidaySetting(Long id);

    /**
     * 获得假期设置
     *
     * @param id 编号
     * @return 假期设置
     */
    HolidaySettingDO getHolidaySetting(Long id);

    /**
     * 获得假期设置分页
     *
     * @param pageReqVO 分页查询
     * @return 假期设置分页
     */
    PageResult<HolidaySettingDO> getHolidaySettingPage(HolidaySettingPageReqVO pageReqVO);

    /**
     * 创建编辑考勤设置
     *
     * @param createReqVO
     * @return
     */
    Long createOrEdit(HolidaySettingSaveReqVO createReqVO);

    /**
     * 获取详情
     *
     * @param id
     * @return
     */
    HolidaySettingRespVO getHolidaySettingRespVO(Long id);

    LocalDateTime calculateNextReleaseDate(LocalDateTime now, HolidayBalanceSettingDO holidayBalanceSetting);

    /**
     * 获取所有假期设置
     *
     * @return
     */
    List<HolidaySettingDO> getAll();

    /**
     * 获取所有假期设置
     *
     * @param userId
     * @return
     */
    List<HolidaySettingRespVO> getAllHolidaySetting(Long userId);

    /**
     * 根据ids获取
     *
     * @return
     */
    List<HolidaySettingDO> listByIds(List<Long> holidaySettingIds);

    /**
     * 获取限制余额的假期列表
     *
     * @return
     */
    List<HolidaySettingDO> getLimitBalanceHolidayList();

    /**
     * 根据ids获取
     *
     * @param holidaySettingIds
     * @return
     */
    List<HolidaySettingDO> getHolidaySettingByIds(List<Long> holidaySettingIds);
}
