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;

@Entity
@Data
@Table(name = "config_robot")
public class ConfigRobot {

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

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

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

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

    @Column(name = "target_price")
    private BigDecimal targetPrice;

    @Column(name = "hover_range")
    private BigDecimal hoverRange;

    @Column(name = "min_change_rate")
    private BigDecimal minChangeRate;

    @Column(name = "max_change_rate")
    private BigDecimal maxChangeRate;

    @Column(name = "hover_min_change_rate")
    private BigDecimal hoverMinChangeRate;

    @Column(name = "hover_max_change_rate")
    private BigDecimal hoverMaxChangeRate;

    @Column(name = "bridge_min_ratio")
    private BigDecimal bridgeMinRatio;

    @Column(name = "bridge_max_ratio")
    private BigDecimal bridgeMaxRatio;

    @Column(name = "up_probability")
    private BigDecimal upProbability;

    @Column(name = "interval_ms")
    private Integer intervalMs;

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

    @Column(name = "kline_max_high_ratio")
    private BigDecimal klineMaxHighRatio;

    @Column(name = "kline_max_low_ratio")
    private BigDecimal klineMaxLowRatio;

    @Column(name = "minute_change_limit")
    private BigDecimal minuteChangeLimit;

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

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

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