package com.jeesharp.business.modules.finance.merchantsettlement.entity;

import com.baomidou.mybatisplus.annotation.TableName;
import com.jeesharp.framework.mybatis.core.dataobject.BaseEntity;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.math.BigDecimal;
import java.time.LocalDateTime;

/**
 * 商户结算单实体，映射表 {@code biz_merchant_settlement_bill}；平台代收场景按账期汇总应付商户金额。
 *
 * @author jeesharp
 * @since 2026-06-29
 */
@Data
@EqualsAndHashCode(callSuper = true)
@TableName("biz_merchant_settlement_bill")
@Schema(description = "商户结算单")
public class MerchantSettlementBill extends BaseEntity<MerchantSettlementBill> {

    @Schema(description = "结算单号")
    private String settlementNo;

    @Schema(description = "子单商户租户ID")
    private String merchantTenantId;

    @Schema(description = "结算模式")
    private String settleMode;

    @Schema(description = "账期开始")
    private LocalDateTime periodStart;

    @Schema(description = "账期结束")
    private LocalDateTime periodEnd;

    @Schema(description = "收款笔数")
    private Long payCount;

    @Schema(description = "退款笔数")
    private Long refundCount;

    @Schema(description = "收款基数合计")
    private BigDecimal payBaseAmount;

    @Schema(description = "退款冲减合计")
    private BigDecimal refundBaseAmount;

    @Schema(description = "平台佣金净额")
    private BigDecimal netCommissionAmount;

    @Schema(description = "应付商户净额")
    private BigDecimal netMerchantAmount;

    @Schema(description = "已打款累计")
    private BigDecimal paidAmount;

    /**
     * @see com.jeesharp.business.modules.finance.merchantsettlement.enums.MerchantSettlementBillStatusEnum
     */
    @Schema(description = "状态")
    private String status;

    @Schema(description = "商户确认人")
    private String merchantConfirmBy;

    @Schema(description = "商户确认时间")
    private LocalDateTime merchantConfirmDate;
}
