package com.spot.dto.mq;

import com.spot.utils.TimeUtils;
import lombok.Data;

import java.io.Serializable;
import java.math.BigDecimal;

/**
 * 价格消息 DTO - 用于接收价格更新 Kafka 消息
 *
 * @author jean
 * @date 2026-05-07
 */
@Data
public class PriceMessage implements Serializable {

    private static final long serialVersionUID = 1L;

    /** 交易对 */
    private String symbol;

    /** 最新价格 */
    private BigDecimal price;

    /** 价格更新时间戳（UTC 毫秒） */
    private Long timestamp;

    public PriceMessage() {
    }

    public PriceMessage(String symbol, BigDecimal price) {
        this.symbol = symbol;
        this.price = price;
        this.timestamp = TimeUtils.currentUtcTimestamp();
    }

    public PriceMessage(String symbol, BigDecimal price, Long timestamp) {
        this.symbol = symbol;
        this.price = price;
        this.timestamp = timestamp;
    }
}
