package com.wzj.soopin.transaction.domain.po;

import com.baomidou.mybatisplus.annotation.*;
import io.swagger.v3.oas.annotations.media.Schema;
import java.util.Date;

import lombok.*;
import org.apache.ibatis.type.JdbcType;
import org.dromara.common.core.domain.model.BaseAudit;

/**
 * 支付订单表
 */
@Schema(description = "支付订单表")
@Data
@EqualsAndHashCode(callSuper = true)
@TableName(value = "trans_pay_order")
@Builder
@AllArgsConstructor
@NoArgsConstructor
public class PayOrder extends BaseAudit {


    @TableId(value = "id")
    @Schema(description = "主键")
    private Long id;

    /**
     * 订单id
     */
    @TableField(value = "order_id")
    @Schema(description = "订单id")
    private Long orderId;

    /**
     * 支付方式
     */
    @TableField(value = "pay_type")
    @Schema(description = "支付方式")
    private String payType;

    /**
     * 支付金额，单位：分
     */
    @TableField(value = "trans_amount")
    @Schema(description = "支付金额，单位：分")
    private Long transAmount;

    /**
     * 发起支付日期
     */
    @TableField(value = "start_trans_date")
    @Schema(description = "发起支付日期")
    private Date startTransDate;

    /**
     * 完成支付日期
     */
    @TableField(value = "end_trans_date")
    @Schema(description = "完成支付日期")
    private Date endTransDate;

    /**
     * 退款日期
     */
    @TableField(value = "refund_date")
    @Schema(description = "退款日期")
    private Date refundDate;

    /**
     * 易生生成后上送渠道的订单号
     */
    @TableField(value = "easypay_trace")
    @Schema(description = "易生生成后上送渠道的订单号")
    private String easypayTrace;

    /**
     * 渠道生成返回给易生的订单号，例如微信、支付宝订单号
     */
    @TableField(value = "pc_trace")
    @Schema(description = "渠道生成返回给易生的订单号，例如微信、支付宝订单号")
    private String pcTrace;

    /**
     * 银联生成并返回给易生的订单号
     */
    @TableField(value = "un_trace")
    @Schema(description = "银联生成并返回给易生的订单号")
    private String unTrace;

    /**
     * 交易状态 0->待支付,1->支付中,2->已支付,3->退款中,4->已退款
     */
    @TableField(value = "trans_state")
    @Schema(description = "交易状态 0->待支付,1->支付中,2->已支付,3->退款中,4->已退款")
    private Integer transState;


    @TableLogic(value = "0", delval = "1")
    @TableField(value = "del_flag", fill = FieldFill.INSERT, jdbcType = JdbcType.CHAR)
    private String delFlag;
}
