// 거시경제지표(KOSIS) 도메인 타입 — Backend Application/Features/Api/Stocks/GetMacroIndicators/Response.cs 대응 // 직렬화 주의: 필드명은 camelCase. period 는 KOSIS 수록시점 원문 문자열 (월간 YYYYMM · 연간 YYYY). // decimal 은 number, unit 은 KOSIS UNIT_NM 원문 문자열 (% · 천명 · 2020=100 · 천달러 등). // ── 지표 코드 (backend Kosis config Code) — 화면 표시 순서 고정 ── export const MACRO_CODES = [ 'EMPLOYMENT_RATE', 'UNEMPLOYMENT_RATE', 'EMPLOYED_PERSONS', 'CPI', 'EXPORT_AMT', 'IMPORT_AMT' ] as const; export type MacroCode = (typeof MACRO_CODES)[number]; // 코드 → 한글 라벨 (backend Name 은 수집 설정 원문이라 화면용 라벨은 프론트 상수로 관리) export const MACRO_CODE_LABEL: Record = { EMPLOYMENT_RATE: '고용률', UNEMPLOYMENT_RATE: '실업률', EMPLOYED_PERSONS: '취업자수', CPI: '소비자물가지수', EXPORT_AMT: '수출액', IMPORT_AMT: '수입액' }; // ── GET /api/market/macro ── export interface MacroPoint { period: string; value: number; } export interface MacroIndicator { code: string; name: string; unit: string|null; // 최신 시점 (points 의 마지막) latestPeriod: string|null; latestValue: number|null; // 시점 오름차순 (마지막 = 최신) points: MacroPoint[]; } export interface MacroIndicatorsResponse { total: number; list: MacroIndicator[]; }