package com.lanyuanxiaoyao.leopard.server.entity;

import com.lanyuanxiaoyao.leopard.core.entity.Stock;
import java.time.LocalDate;

/**
 * @author lanyuanxiaoyao
 * @version 20250917
 */
public record StockDetailVo(
  Long id,
  String code,
  String name,
  String fullname,
  Stock.Market market,
  String industry,
  LocalDate listedDate
) {
  public static StockDetailVo of(Stock stock) {
    return new StockDetailVo(
      stock.getId(),
      stock.getCode(),
      stock.getName(),
      stock.getFullname(),
      stock.getMarket(),
      stock.getIndustry(),
      stock.getListedDate()
    );
  }
}
