package com.izouma.nineth.domain;

import com.fasterxml.jackson.annotation.JsonIgnore;
import com.izouma.nineth.enums.PayMethod;
import com.izouma.nineth.enums.PayStatus;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.persistence.*;
import java.math.BigDecimal;
import java.time.LocalDateTime;

@Data
@Entity
@AllArgsConstructor
@NoArgsConstructor
@Table(indexes = {
        @Index(columnList = "userId"),
        @Index(columnList = "orderNo"),
})
@Builder
public class WalletRenewOrder extends BaseEntity{

    @ApiModelProperty("商品标题")
    private String goodsTitle;

    @ApiModelProperty("订单编号")
    private String orderNo;

    @ApiModelProperty("续费用户")
    private Long userId;

    @ApiModelProperty("用户资金账户")
    private Long userFundAccountId;

    @ApiModelProperty("支付方式")
    @Enumerated(EnumType.STRING)
    private PayMethod payMethod;

    /**
     * user_bank_card的绑卡id
     */
    @ApiModelProperty("用户绑卡ID")
    private Long userBankCardId;

    @ApiModelProperty("支付工具")
    private String payTool;

    @ApiModelProperty("购买时长")
    private Integer buyDuration;

    @ApiModelProperty("开始时间")
    private LocalDateTime startTime;

    @ApiModelProperty("结束时间")
    private LocalDateTime endTime;

    @ApiModelProperty("支付金额")
    private BigDecimal payAmt;

    @ApiModelProperty("支付状态")
    @Enumerated(EnumType.STRING)
    private PayStatus status;

    @ApiModelProperty("支付失效时间")
    private String timeExpire;

    @JsonIgnore
    @ApiModelProperty("通知地址")
    private String notifyUrl;

    @ApiModelProperty("通知时间")
    private LocalDateTime notifyTime;

    @ApiModelProperty("支付结果")
    private String result;

    @ApiModelProperty("支付授权令牌")
    private String token;

    @ApiModelProperty("支付平台")
    private String payPlatform;

    @ApiModelProperty("支付时间")
    private LocalDateTime payTime;

    @ApiModelProperty("交易流水ID")
    private String transactionId;



}
