package com.market.model;

import java.math.BigDecimal;

/**
 * 行情机器人配置 DTO
 * <p>
 * 用于 /robot/save 请求体，以及 /robot/list、/robot/status 响应体（含运行时字段）。
 *
 * @author jean
 * @date 2026-05-11
 */
public class RobotConfigDTO {

    // ------------------------------------------------------------------ 请求字段

    /** 主键（更新时传入，新增时不传） */
    private Integer id;

    /** 交易对（小写，如 btcusdt） */
    private String symbol;

    /** 趋势方向：1=涨 2=跌 3=横盘 */
    private Integer trend;

    /** 起始参考价格 */
    private BigDecimal openPrice;

    /** 目标价格（NULL 表示无目标） */
    private BigDecimal targetPrice;

    /** 盘整区间比例（如 0.02 = 2%） */
    private BigDecimal hoverRange;

    /** 趋势阶段单次最小变动幅度 */
    private BigDecimal minChangeRate;

    /** 趋势阶段单次最大变动幅度 */
    private BigDecimal maxChangeRate;

    /** 盘整阶段单次最小变动幅度 */
    private BigDecimal hoverMinChangeRate;

    /** 盘整阶段单次最大变动幅度 */
    private BigDecimal hoverMaxChangeRate;

    /** K线最高价最大上涨比例（如 0.02 = 2%），NULL 时默认 0.005 */
    private BigDecimal klineMaxHighRatio;

    /** K线最低价最大下跌比例（如 0.02 = 2%），NULL 时默认 0.005 */
    private BigDecimal klineMaxLowRatio;

    /** 分钟K线最大涨跌幅限制（如 0.10 = 10%），NULL 时不限制 */
    private BigDecimal minuteChangeLimit;

    /** 成桥最小比例（如 0.05 = 5%），NULL 时默认 0.05 */
    private BigDecimal bridgeMinRatio;

    /** 成桥最大比例（如 0.10 = 10%），NULL 时默认 0.10；两者均为 0 时不做桥 */
    private BigDecimal bridgeMaxRatio;

    /** 上涨概率（0~1），NULL 时由 trend 自动推导 */
    private BigDecimal upProbability;

    /** 每次生成价格的间隔（毫秒），最小 1 */
    private Integer intervalMs;

    /** 状态：1=趋势运行 2=已停止 3=盘整震荡 */
    private Integer status;

    /** 备注 */
    private String remark;

    // ------------------------------------------------------------------ 响应字段（list/status 接口返回时填充）

    /** 当前实时价格（内存中的最新生成价格） */
    private String currentPrice;

    /** 线程运行状态：RUNNING / DEAD / NOT_STARTED */
    private String threadStatus;

    // ------------------------------------------------------------------ getter / setter

    public Integer getId() { return id; }
    public void setId(Integer id) { this.id = id; }

    public String getSymbol() { return symbol; }
    public void setSymbol(String symbol) { this.symbol = symbol; }

    public Integer getTrend() { return trend; }
    public void setTrend(Integer trend) { this.trend = trend; }

    public BigDecimal getOpenPrice() { return openPrice; }
    public void setOpenPrice(BigDecimal openPrice) { this.openPrice = openPrice; }

    public BigDecimal getTargetPrice() { return targetPrice; }
    public void setTargetPrice(BigDecimal targetPrice) { this.targetPrice = targetPrice; }

    public BigDecimal getHoverRange() { return hoverRange; }
    public void setHoverRange(BigDecimal hoverRange) { this.hoverRange = hoverRange; }

    public BigDecimal getMinChangeRate() { return minChangeRate; }
    public void setMinChangeRate(BigDecimal minChangeRate) { this.minChangeRate = minChangeRate; }

    public BigDecimal getMaxChangeRate() { return maxChangeRate; }
    public void setMaxChangeRate(BigDecimal maxChangeRate) { this.maxChangeRate = maxChangeRate; }

    public BigDecimal getHoverMinChangeRate() { return hoverMinChangeRate; }
    public void setHoverMinChangeRate(BigDecimal hoverMinChangeRate) { this.hoverMinChangeRate = hoverMinChangeRate; }

    public BigDecimal getHoverMaxChangeRate() { return hoverMaxChangeRate; }
    public void setHoverMaxChangeRate(BigDecimal hoverMaxChangeRate) { this.hoverMaxChangeRate = hoverMaxChangeRate; }

    public BigDecimal getKlineMaxHighRatio() { return klineMaxHighRatio; }
    public void setKlineMaxHighRatio(BigDecimal klineMaxHighRatio) { this.klineMaxHighRatio = klineMaxHighRatio; }

    public BigDecimal getKlineMaxLowRatio() { return klineMaxLowRatio; }
    public void setKlineMaxLowRatio(BigDecimal klineMaxLowRatio) { this.klineMaxLowRatio = klineMaxLowRatio; }

    public BigDecimal getMinuteChangeLimit() { return minuteChangeLimit; }
    public void setMinuteChangeLimit(BigDecimal minuteChangeLimit) { this.minuteChangeLimit = minuteChangeLimit; }

    public BigDecimal getBridgeMinRatio() { return bridgeMinRatio; }
    public void setBridgeMinRatio(BigDecimal bridgeMinRatio) { this.bridgeMinRatio = bridgeMinRatio; }

    public BigDecimal getBridgeMaxRatio() { return bridgeMaxRatio; }
    public void setBridgeMaxRatio(BigDecimal bridgeMaxRatio) { this.bridgeMaxRatio = bridgeMaxRatio; }

    public BigDecimal getUpProbability() { return upProbability; }
    public void setUpProbability(BigDecimal upProbability) { this.upProbability = upProbability; }

    public Integer getIntervalMs() { return intervalMs; }
    public void setIntervalMs(Integer intervalMs) { this.intervalMs = intervalMs; }

    public Integer getStatus() { return status; }
    public void setStatus(Integer status) { this.status = status; }

    public String getRemark() { return remark; }
    public void setRemark(String remark) { this.remark = remark; }

    public String getCurrentPrice() { return currentPrice; }
    public void setCurrentPrice(String currentPrice) { this.currentPrice = currentPrice; }

    public String getThreadStatus() { return threadStatus; }
    public void setThreadStatus(String threadStatus) { this.threadStatus = threadStatus; }
}
