package com.jeesharp.business.modules.finance.merchantreceivable.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_receivable}。
 *
 * @author jeesharp
 * @since 2026-06-11
 */
@Data
@EqualsAndHashCode(callSuper = true)
@TableName("biz_merchant_receivable")
@Schema(description = "商户应收账流水")
public class MerchantReceivable extends BaseEntity<MerchantReceivable> {

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

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

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

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

    @Schema(description = "商城子订单ID")
    private String mallOrderId;

    @Schema(description = "关联退款单ID")
    private String payRefundOrderId;

    /**
     * @see com.jeesharp.business.modules.finance.paymentrecord.enums.PayRecordBizSceneEnum
     */
    @Schema(description = "业务场景")
    private String bizScene;

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

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

    @Schema(description = "微信 transaction_id")
    private String transactionId;

    @Schema(description = "原支付商户单号")
    private String outTradeNo;

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

    @Schema(description = "锁定佣金比例")
    private BigDecimal commissionRate;

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

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

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

    @Schema(description = "已纳入的结算单ID")
    private String settlementBillId;

    @Schema(description = "结算单号（冗余）")
    private String settlementBillNo;
}
