package com.izouma.nineth.domain;

import com.izouma.nineth.annotations.Searchable;
import com.izouma.nineth.enums.OrderStatus;
import com.izouma.nineth.enums.PayMethod;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.EnumType;
import javax.persistence.Enumerated;
import java.math.BigDecimal;
import java.math.BigInteger;
import java.time.LocalDateTime;

@Data
@Entity
@AllArgsConstructor
@NoArgsConstructor
@Builder
public class GiftOrder extends BaseEntity {
    private Long userId;

    private Long assetId;

    private Long collectionId;

    private String name;

    private Long toUserId;

    @Enumerated(EnumType.STRING)
    private PayMethod payMethod;

    private OrderStatus status;

    @Column(precision = 10, scale = 2)
    private BigDecimal gasPrice;

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

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

    @ApiModelProperty("取消时间")
    private LocalDateTime cancelTime;

    @ApiModelProperty("交易hash")
    private String txHash;

    private BigInteger gasUsed;

    @ApiModelProperty("区块高度")
    private BigInteger blockNumber;

    private int projectId;

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

    @ApiModelProperty("下单用户IP")
    private String ip;

}
