package com.izouma.nineth.dto;

import com.alibaba.excel.annotation.ExcelProperty;
import com.izouma.nineth.annotations.Searchable;
import lombok.Data;

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

@Data
public class OrderDTO {
    @ExcelProperty("用户ID")
    private Long userId;

    @ExcelProperty("藏品ID")
    private Long collectionId;

    @ExcelProperty("数量")
    private int qty;

    @ExcelProperty("名称")
    private String name;

    @ExcelProperty("分类")
    private String category;

    @ExcelProperty("是否可转售")
    private boolean canResale;

    @ExcelProperty("版税比例")
    private int royalties;

    @ExcelProperty("手续费比例")
    private int serviceCharge;

    @ExcelProperty("类型")
    @Enumerated(EnumType.STRING)
    private String type;

    @ExcelProperty("铸造者")
    private String minter;

    @ExcelProperty("铸造者ID")
    private Long minterId;

    @ExcelProperty("价格")
    @Column(precision = 10, scale = 2)
    private BigDecimal price;

    @ExcelProperty("gas费")
    @Column(precision = 10, scale = 2)
    private BigDecimal gasPrice;

    @ExcelProperty("总价")
    @Column(precision = 10, scale = 2)
    private BigDecimal totalPrice;

    @ExcelProperty("状态")
    @Enumerated(EnumType.STRING)
    private String status;

    @ExcelProperty("支付方式")
    private String payMethod;

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

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

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

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

    @ExcelProperty("消耗gas")
    private BigInteger gasUsed;

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

    @ExcelProperty("收货人")
    private String contactName;

    @ExcelProperty("收货电话")
    private String contactPhone;

    @ExcelProperty("收货地址")
    private String address;
}
