Selaa lähdekoodia

refactor(paper): types 문자열 enum 정합 + 용어 규칙 토큰 최종화

- types/paper.ts: Side/FillRule/Status/LedgerType 를 숫자→문자열 리터럴
  (Buy/Sell·Open/Close·Pending/Filled/Cancelled/Rejected·Deposit/Withdraw)로.
  Backend enum.ToString() 과 정확히 일치. 라벨맵·컴포넌트는 computed key라 무편집 적응.
- CLAUDE.md 용어 규칙: 코인→토큰 최종화 + 상점 캐시전용/토큰 모의투자전용 명시.

npm run build 성공.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
KIM-JINO5 2 viikkoa sitten
vanhempi
sitoutus
57bf589a23
2 muutettua tiedostoa jossa 15 lisäystä ja 15 poistoa
  1. 2 2
      CLAUDE.md
  2. 13 13
      types/paper.ts

+ 2 - 2
CLAUDE.md

@@ -134,8 +134,8 @@ ThemeProvider → SignalRProvider → AuthProvider → MemberProvider → Config
 
 
 ## 용어 규칙 (개미투자)
 ## 용어 규칙 (개미투자)
 
 
-- **캐시 (Cash)**: 유상 충전 재화 — 토스페이먼츠 PG 충전 (PgCharged + Deposit 잔액). 상점 결제에 사용
-- **코인 (Coin)**: 무상 활동 적립 재화 — 출석·글·댓글·응원수신·가입축하·모의투자 보상 (Reward + Airdrop 잔액). 출금 불가, 상점/모의투자 소비 전용 (구 명칭 "포인트")
+- **캐시 (Cash)**: 유상 충전 재화 — 토스페이먼츠 PG 충전 (PgCharged + Deposit 잔액). **상점 구매 전용**
+- **토큰 (Token)**: 무상 활동 적립 재화 — 가입축하·출석·글·댓글·응원수신·모의투자 보상 (Reward + Airdrop 잔액). **활동·모의투자 전용, 상점 구매 불가** (구 명칭 포인트→코인→토큰, 2026-07 최종)
 - 후원(Donation)·머니 개념은 개미투자 피벗(Phase B)에서 제거됨
 - 후원(Donation)·머니 개념은 개미투자 피벗(Phase B)에서 제거됨
 
 
 ## 레이아웃 구조
 ## 레이아웃 구조

+ 13 - 13
types/paper.ts

@@ -1,31 +1,31 @@
 // 모의투자(Paper Trading) 도메인 타입 — Backend Application/Features/Api/Paper/*/Response.cs 대응 (camelCase 직렬화)
 // 모의투자(Paper Trading) 도메인 타입 — Backend Application/Features/Api/Paper/*/Response.cs 대응 (camelCase 직렬화)
-// ⚠️ enum 은 Web.Api 에 JsonStringEnumConverter 미등록 → byte 값(숫자)으로 직렬화됨.
-//    (Stocks 는 Response 에서 .ToString() 으로 문자열화했으나 Paper 는 raw enum 타입 그대로라 숫자 전송)
+// enum 은 Backend Response DTO 에서 .ToString() 으로 문자열화됨 (Stocks 컨벤션 통일 — enum.ToString() PascalCase).
+//    값은 Domain/Entities/Paper/ValueObject/* 의 enum 멤버명과 정확히 일치.
 
 
-// ── enum (byte 값, d4 §③ / Domain/Entities/Paper/ValueObject/*) ──
+// ── enum (문자열 값 = enum 멤버명, d4 §③ / Domain/Entities/Paper/ValueObject/*) ──
 export const PaperOrderSide = {
 export const PaperOrderSide = {
-	Buy: 1,
-	Sell: 2
+	Buy: 'Buy',
+	Sell: 'Sell'
 } as const;
 } as const;
 export type PaperOrderSideValue = (typeof PaperOrderSide)[keyof typeof PaperOrderSide];
 export type PaperOrderSideValue = (typeof PaperOrderSide)[keyof typeof PaperOrderSide];
 
 
 export const PaperFillRule = {
 export const PaperFillRule = {
-	Open: 1,
-	Close: 2
+	Open: 'Open',
+	Close: 'Close'
 } as const;
 } as const;
 export type PaperFillRuleValue = (typeof PaperFillRule)[keyof typeof PaperFillRule];
 export type PaperFillRuleValue = (typeof PaperFillRule)[keyof typeof PaperFillRule];
 
 
 export const PaperOrderStatus = {
 export const PaperOrderStatus = {
-	Pending: 1,
-	Filled: 2,
-	Cancelled: 3,
-	Rejected: 4
+	Pending: 'Pending',
+	Filled: 'Filled',
+	Cancelled: 'Cancelled',
+	Rejected: 'Rejected'
 } as const;
 } as const;
 export type PaperOrderStatusValue = (typeof PaperOrderStatus)[keyof typeof PaperOrderStatus];
 export type PaperOrderStatusValue = (typeof PaperOrderStatus)[keyof typeof PaperOrderStatus];
 
 
 export const PaperLedgerType = {
 export const PaperLedgerType = {
-	Deposit: 1,
-	Withdraw: 2
+	Deposit: 'Deposit',
+	Withdraw: 'Withdraw'
 } as const;
 } as const;
 export type PaperLedgerTypeValue = (typeof PaperLedgerType)[keyof typeof PaperLedgerType];
 export type PaperLedgerTypeValue = (typeof PaperLedgerType)[keyof typeof PaperLedgerType];