stock.ts 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. // 종목 도메인 타입 — Backend Application/Features/Api/Stocks/*/Response.cs 대응 (camelCase 직렬화)
  2. export type StockMarketName = 'KOSPI'|'KOSDAQ'|'KONEX';
  3. export type TradingStatusName = 'Normal'|'Halted'|'Watch';
  4. // GET /api/stocks — 목록 행
  5. export interface StockListRow {
  6. code: string;
  7. name: string;
  8. market: StockMarketName;
  9. tradingStatus: TradingStatusName;
  10. lastTradingDate: string|null;
  11. closePrice: number|null;
  12. changeRate: number|null;
  13. marketCap: number|null;
  14. }
  15. export interface StockListResponse {
  16. total: number;
  17. list: StockListRow[];
  18. }
  19. // 일별 시세 행 (GetDetail.RecentPrices / GetHistory 공용 필드)
  20. export interface StockPriceRow {
  21. tradingDate: string;
  22. open: number;
  23. high: number;
  24. low: number;
  25. close: number;
  26. volume: number;
  27. tradingValue: number;
  28. changeAmount: number;
  29. changeRate: number;
  30. }
  31. // GET /api/stocks/{code}
  32. export interface StockDetailResponse {
  33. code: string;
  34. isin: string|null;
  35. name: string;
  36. englishName: string|null;
  37. market: StockMarketName;
  38. tradingStatus: TradingStatusName;
  39. sectorName: string|null;
  40. isActive: boolean;
  41. listedDate: string;
  42. delistedDate: string|null;
  43. lastTradingDate: string|null;
  44. closePrice: number|null;
  45. changeRate: number|null;
  46. marketCap: number|null;
  47. recentPrices: StockPriceRow[];
  48. }
  49. // GET /api/stocks/{code}/history
  50. export interface StockHistoryRow extends StockPriceRow {
  51. marketCap: number|null;
  52. }
  53. export interface StockHistoryResponse {
  54. total: number;
  55. list: StockHistoryRow[];
  56. }
  57. // GET /api/stocks/suggest
  58. export interface StockSuggestItem {
  59. code: string;
  60. name: string;
  61. market: StockMarketName;
  62. }
  63. export interface StockSuggestResponse {
  64. list: StockSuggestItem[];
  65. }