package com.jeesharp.business.modules.trade.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_trade_order}。
 *
 * @author jeesharp
 * @since 2026-05-08
 */
@Data
@EqualsAndHashCode(callSuper = true)
@TableName("biz_trade_order")
@Schema(description = "统一交易订单主单")
public class TradeOrder extends BaseEntity<TradeOrder> {

    @Schema(description = "展示订单号")
    private String orderNo;

    /** @see com.jeesharp.business.modules.trade.enums.TradeBizTypeEnum */
    @Schema(description = "业务类型")
    private String bizType;

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

    @Schema(description = "列表摘要")
    private String title;

    @Schema(description = "订单总额")
    private BigDecimal totalAmount;

    @Schema(description = "优惠总额")
    private BigDecimal discountAmount;

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

    @Schema(description = "币种")
    private String currency;

    /** @see com.jeesharp.business.modules.trade.enums.TradeOrderStatusEnum */
    @Schema(description = "统一状态")
    private Integer status;

    @Schema(description = "支付单号")
    private String payOrderId;

    @Schema(description = "支付渠道")
    private String payChannel;

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

    @Schema(description = "未支付过期时间")
    private LocalDateTime expireTime;

    @Schema(description = "垂直业务单ID")
    private String verticalOrderId;

    @Schema(description = "扩展JSON")
    private String extJson;
}
