대시보드 구현
This commit is contained in:
66
features/dashboard/types/dashboard.types.ts
Normal file
66
features/dashboard/types/dashboard.types.ts
Normal file
@@ -0,0 +1,66 @@
|
||||
/**
|
||||
* @file features/dashboard/types/dashboard.types.ts
|
||||
* @description 대시보드(잔고/지수/보유종목) 전용 타입 정의
|
||||
*/
|
||||
|
||||
import type { KisTradingEnv } from "@/features/trade/types/trade.types";
|
||||
|
||||
export type DashboardMarket = "KOSPI" | "KOSDAQ";
|
||||
|
||||
/**
|
||||
* 대시보드 잔고 요약
|
||||
*/
|
||||
export interface DashboardBalanceSummary {
|
||||
totalAmount: number;
|
||||
cashBalance: number;
|
||||
totalProfitLoss: number;
|
||||
totalProfitRate: number;
|
||||
}
|
||||
|
||||
/**
|
||||
* 대시보드 보유 종목 항목
|
||||
*/
|
||||
export interface DashboardHoldingItem {
|
||||
symbol: string;
|
||||
name: string;
|
||||
market: DashboardMarket;
|
||||
quantity: number;
|
||||
averagePrice: number;
|
||||
currentPrice: number;
|
||||
evaluationAmount: number;
|
||||
profitLoss: number;
|
||||
profitRate: number;
|
||||
}
|
||||
|
||||
/**
|
||||
* 계좌 잔고 API 응답 모델
|
||||
*/
|
||||
export interface DashboardBalanceResponse {
|
||||
source: "kis";
|
||||
tradingEnv: KisTradingEnv;
|
||||
summary: DashboardBalanceSummary;
|
||||
holdings: DashboardHoldingItem[];
|
||||
fetchedAt: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 시장 지수 항목
|
||||
*/
|
||||
export interface DashboardMarketIndexItem {
|
||||
market: DashboardMarket;
|
||||
code: string;
|
||||
name: string;
|
||||
price: number;
|
||||
change: number;
|
||||
changeRate: number;
|
||||
}
|
||||
|
||||
/**
|
||||
* 시장 지수 API 응답 모델
|
||||
*/
|
||||
export interface DashboardIndicesResponse {
|
||||
source: "kis";
|
||||
tradingEnv: KisTradingEnv;
|
||||
items: DashboardMarketIndexItem[];
|
||||
fetchedAt: string;
|
||||
}
|
||||
Reference in New Issue
Block a user