package com.yonge.cooleshow.biz.dal.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.yonge.toolset.payment.base.enums.OpenEnum;
import com.yonge.toolset.payment.base.enums.PayChannelEnum;
import com.yonge.toolset.payment.base.enums.TradeStatusEnum;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;

import java.io.Serializable;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;
import java.math.BigDecimal;

/**
 * 平台订单支付表
 */
@Data
@TableName("user_order_payment")
@ApiModel(value = "UserOrderPayment对象", description = "平台订单支付表")
public class UserOrderPayment implements Serializable {
	private static final long serialVersionUID = 1L;
    @TableId(value = "id_", type = IdType.AUTO)
    private Long id;
    @ApiModelProperty("服务提供方: ORIGINAL 微信支付宝 ADAPAY 汇付")
    @TableField(value = "open_type_")
    private OpenEnum openType;
    @ApiModelProperty("支付客户端: STUDENT 学生端 TEACHER 老师端")
    @TableField(value = "payment_client_")
    private String paymentClient;
    @ApiModelProperty("支付渠道: alipay 支付宝  wx_lite 微信 ")
    @TableField(value = "pay_channel_")
    private PayChannelEnum payChannel;


    @ApiModelProperty("支付厂商")
    @TableField(value = "payment_vendor_")
    private String paymentVendor;

    @ApiModelProperty("支付appId")
    @TableField(value = "payment_app_id_")
    private String paymentAppId;

    @ApiModelProperty("支付渠道")
    @TableField(value = "payment_channel_")
    private String paymentChannel;
    @ApiModelProperty("订单号 ")
	@TableField(value = "order_no_")
    private String orderNo;
    @ApiModelProperty("支付订单号（一个订单对应多个支付订单，新发起一个支付订单会关闭其他交易） ")
    @TableField(value = "payment_no_")
    private String paymentNo;
    @ApiModelProperty("交易流水号 ")
	@TableField(value = "trans_no_")
    private String transNo;
    @ApiModelProperty("交易金额，必须大于0，保留两位小数点，如0.10、100.05等 ")
	@TableField(value = "pay_amt_")
    private BigDecimal payAmt;
    @ApiModelProperty("回调交易金额 ")
    @TableField(value = "back_pay_amt_")
    private BigDecimal backPayAmt;
    @ApiModelProperty("汇付收取的服务费 ")
    @TableField(value = "fee_amt_")
    private BigDecimal feeAmt;
    @ApiModelProperty("支付详情信息（用于拉起支付） ")
	@TableField(value = "pay_info_")
    private String payInfo;
    @ApiModelProperty("交易状态 pending 交易处理中 succeeded 交易成功 failed 交易失败 close 交易关闭")
    @TableField(value = "status_")
    private TradeStatusEnum status;
    @ApiModelProperty("失败信息 ")
    @TableField(value = "pay_fail_msg_")
    private String payFailMsg;
    @ApiModelProperty("到账时间 ")
	@TableField(value = "arrival_time_")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
    private Date arrivalTime;
    @ApiModelProperty("关单状态 pending 交易处理中 succeeded 交易成功 failed 交易失败")
    @TableField(value = "close_status_")
    private TradeStatusEnum closeStatus;
    @ApiModelProperty("关单失败信息 ")
    @TableField(value = "close_fail_msg_")
    private String closeFailMsg;
    @ApiModelProperty("创建时间 ")
    @TableField(value = "create_time_")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
    private Date createTime;
    @ApiModelProperty("更新时间 ")
    @TableField(value = "update_time_")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
    private Date updateTime;

}