package cn.iocoder.yudao.module.bpm.service.workovertime;

import cn.iocoder.yudao.module.bpm.dal.dataobject.oa.BpmOAOvertimeItemDO;
import cn.iocoder.yudao.module.system.api.workovertime.vo.WorkOvertimeDeductRuleApiVO;
import cn.iocoder.yudao.module.system.api.workovertime.vo.WorkOvertimeRuleApiVO;
import cn.iocoder.yudao.module.system.api.workovertime.vo.WorkOvertimeRuleItemApiVO;

import java.math.BigDecimal;
import java.util.List;

/**
 * 加班公共服务 - Service 接口
 *
 * @author 艾楷
 */
public interface WorkOvertimePublicService {

    /**
     * 计算加班时长 (这里按照分钟算)
     *
     * @param millis
     * @param deductRules
     * @return
     */
    long calculateDeductedTime(long millis, List<WorkOvertimeDeductRuleApiVO> deductRules);

    /**
     * 计算并插入实际加班
     *
     * @param millis
     * @param rule
     * @param item
     * @param ruleItem
     */
    void calculateActualTimeLength(long millis, WorkOvertimeRuleApiVO rule, BpmOAOvertimeItemDO item, WorkOvertimeRuleItemApiVO ruleItem);
}
