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

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

import java.util.List;

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

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

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

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

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

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

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

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

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