package com.jeesharp.business.modules.mall.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.util.Date;

/**
 * 商城合并支付批次，映射表 {@code mall_pay_batch}；一次结算多租户子单合并为单笔微信支付。
 *
 * @author jeesharp
 * @since 2026-06-10
 */
@Data
@EqualsAndHashCode(callSuper = true)
@TableName("mall_pay_batch")
@Schema(description = "商城合并支付批次")
public class MallPayBatch extends BaseEntity<MallPayBatch> {

    @Schema(description = "批次编号")
    private String batchNo;

    @Schema(description = "会员ID")
    private String memberId;

    @Schema(description = "商品金额合计")
    private BigDecimal goodsAmount;

    @Schema(description = "运费合计")
    private BigDecimal freightAmount;

    @Schema(description = "订单总额（优惠前）")
    private BigDecimal totalAmount;

    @Schema(description = "首单/平台优惠合计")
    private BigDecimal discountAmount;

    @Schema(description = "商户券抵扣合计")
    private BigDecimal merchantCouponAmount;

    @Schema(description = "平台券分摊合计")
    private BigDecimal platformCouponAmount;

    @Schema(description = "优惠券抵扣合计")
    private BigDecimal couponAmount;

    @Schema(description = "应付金额")
    private BigDecimal payAmount;

    /**
     * @see com.jeesharp.business.modules.mall.enums.MallPayBatchStatusEnum
     */
    @Schema(description = "批次状态：0-待支付 1-已支付 5-已关闭")
    private Integer status;

    @Schema(description = "配送方式")
    private String deliveryType;

    @Schema(description = "买家留言")
    private String buyerRemark;

    @Schema(description = "支付方式")
    private String payType;

    @Schema(description = "支付时间")
    private Date payTime;

    @Schema(description = "统一交易单ID")
    private String unifiedOrderId;

    @Schema(description = "平台券会员券ID")
    private String platformMemberCouponId;
}
