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_line}；生成结算单时固化应收流水快照。
 *
 * @author jeesharp
 * @since 2026-06-29
 */
@Data
@EqualsAndHashCode(callSuper = true)
@TableName("biz_merchant_settlement_bill_line")
@Schema(description = "商户结算单构成明细")
public class MerchantSettlementBillLine extends BaseEntity<MerchantSettlementBillLine> {

    @Schema(description = "结算单ID")
    private String settlementBillId;

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

    @Schema(description = "应收流水ID")
    private String receivableId;

    @Schema(description = "应收流水号")
    private String receivableNo;

    /**
     * @see com.jeesharp.business.modules.finance.merchantreceivable.enums.MerchantReceivableEntryTypeEnum
     */
    @Schema(description = "流水类型：PAY、REFUND")
    private String entryType;

    @Schema(description = "业务场景")
    private String bizScene;

    @Schema(description = "业务子单ID")
    private String bizOrderId;

    @Schema(description = "业务单号快照")
    private String bizOrderNo;

    @Schema(description = "合并支付批次ID")
    private String payBatchId;

    @Schema(description = "财务支付单ID")
    private String financePayOrderId;

    @Schema(description = "基数金额（元）")
    private BigDecimal baseAmount;

    @Schema(description = "平台佣金（元）")
    private BigDecimal commissionAmount;

    @Schema(description = "商户应得（元）")
    private BigDecimal merchantAmount;

    @Schema(description = "业务发生时间")
    private LocalDateTime bizTime;
}
