package com.engine.salary.service;

import com.engine.salary.entity.salaryacct.bo.SalaryAcctConfig;
import com.engine.salary.entity.salaryacct.po.SalaryAcctRecordPO;
import com.engine.salary.entity.salaryacct.po.SalaryAcctSobConfigPO;
import com.engine.salary.entity.salarysob.dto.SalarySobItemAggregateDTO;

import java.util.Collection;

/**
 * 薪资核算的账套副本配置
 * <p>Copyright: Copyright (c) 2024</p>
 * <p>Company: 泛微软件</p>
 *
 * @author qiantao
 * @version 1.0
 **/
public interface SalaryAcctSobConfigService{

    /**
     * 根据薪资核算记录id查询薪资核算的账套配置
     *
     * @param salaryAcctRecordId
     * @return
     */
    SalaryAcctSobConfigPO getBySalaryAcctRecordId(Long salaryAcctRecordId);

    /**
     * 获取账套快照
     * @param salaryAcctRecordId
     * @return
     */
    SalaryAcctConfig getSalaryAcctConfig(Long salaryAcctRecordId);

    /**
     * 根据薪资核算记录id查询薪资核算的账套配置
     *
     * @param needInit           倘若当前薪资核算还没有保存账套配置，是否需要初始化一个，此处初始化不会入库
     * @param salaryAcctRecordId
     * @return
     */
    SalaryAcctSobConfigPO getBySalaryAcctRecordId(boolean needInit, Long salaryAcctRecordId);

    /**
     * 薪资核算的账套配置转换成薪资账套的聚合对象
     *
     * @param salaryAcctRecordId
     * @return
     */
    SalarySobItemAggregateDTO getSalarySobItemAggregate(Long salaryAcctRecordId);

    /**
     * 薪资核算的账套配置转换成薪资账套的聚合对象
     *
     * @param salaryAcctRecordId
     * @return
     */
    SalarySobItemAggregateDTO getSalarySobItemAggregateNoFormula(Long salaryAcctRecordId);

    /**
     * 初始化薪资核算的账套配置
     *
     * @param salaryAcctRecord
     */
    SalaryAcctSobConfigPO initBySalaryAcctRecord(SalaryAcctRecordPO salaryAcctRecord);

    /**
     *
     * @param salaryAcctSobConfig
     */
    void save(SalaryAcctSobConfigPO salaryAcctSobConfig);

    /**
     * 更新薪资核算的账套配置
     *
     * @param salaryAcctRecordId
     */
    void updateBySalaryAcctRecordId(Long salaryAcctRecordId);

    /**
     * 删除薪资核算的账套配置
     *
     * @param salaryAcctRecordIds
     */
    void deleteBySalaryAcctRecordIds(Collection<Long> salaryAcctRecordIds);
}
