package com.red.circle.other.infra.database.mongo.service.bd;

import com.red.circle.other.infra.database.mongo.entity.bd.BdLeaderSalarySettlementRecord;
import com.red.circle.other.infra.enums.BdSettlementStatus;

import java.util.List;

/**
 * BD Leader 结算记录服务.
 *
 * @author AI Assistant
 * @since 2025-10-29
 */
public interface BdLeaderSalarySettlementRecordService {

    /**
     * 创建结算记录.
     */
    void create(BdLeaderSalarySettlementRecord record);

    /**
     * 更新结算记录.
     */
    void update(BdLeaderSalarySettlementRecord record);

    /**
     * 根据 ID 查询.
     */
    BdLeaderSalarySettlementRecord getById(String id);

    /**
     * 根据业务号查询（幂等性检查）.
     */
    BdLeaderSalarySettlementRecord getByBizNo(String bizNo);

    /**
     * 检查业务号是否已存在.
     */
    boolean existsByBizNo(String bizNo);

    /**
     * 根据 BD Leader 用户 ID 和结算周期查询.
     */
    BdLeaderSalarySettlementRecord getByUserIdAndBillBelong(Long bdLeaderUserId, Integer billBelong);

    /**
     * 根据结算周期查询所有记录.
     */
    List<BdLeaderSalarySettlementRecord> listByBillBelong(Integer billBelong);

    /**
     * 更新结算状态.
     */
    void updateStatus(String id, BdSettlementStatus status, String failureReason);
}
