package com.bizzan.bitrade.entity;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;

import javax.persistence.*;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;

@Entity
@Data
@Table(name = "config_symbol")
public class ConfigSymbol {

    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private Long id;

    @Column(name = "symbol")
    private String symbol;

    @Column(name = "base")
    private String base;

    @Column(name = "quote")
    private String quote;

    @Column(name = "is_open")
    private Integer isOpen;

    @Column(name = "taker_fee")
    private BigDecimal takerFee;

    @Column(name = "maker_fee")
    private BigDecimal makerFee;

    @Column(name = "max_orders_per_user")
    private Integer maxOrdersPerUser;

    @Column(name = "daily_volume_limit")
    private BigDecimal dailyVolumeLimit;

    @Column(name = "open_price")
    private BigDecimal openPrice;

    @Column(name = "depth0_pre")
    private Long depth0Pre;

    @Column(name = "depth1_pre")
    private Long depth1Pre;

    @Column(name = "depth2_pre")
    private Long depth2Pre;

    @Column(name = "price_pre")
    private Integer pricePre;

    @Column(name = "volume_pre")
    private Integer volumePre;

    @Column(name = "publish")
    private Integer publish;

    @Column(name = "limit_price_min")
    private BigDecimal limitPriceMin;

    @Column(name = "limit_volume_min")
    private BigDecimal limitVolumeMin;

    @Column(name = "market_buy_min")
    private BigDecimal marketBuyMin;

    @Column(name = "market_sell_min")
    private BigDecimal marketSellMin;

    @Column(name = "category")
    private String category;

    @Column(name = "label")
    private Integer label;

    @Column(name = "sort")
    private Integer sort;

    @Column(name = "description")
    private String description;

    @Column(name = "create_time")
    private Long createTime;

    @Column(name = "customize")
    private Integer customize;

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @Column(name = "ctime", updatable = false)
    private Date ctime;

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @Column(name = "mtime")
    private Date mtime;

    @Transient
    private List<ConfigSymbolSlippage> slippageList;
}
