o2o-triple-pick/lib/types.ts

61 lines
1.6 KiB
TypeScript

// TriplePick 도메인 타입 — 기능정의서 데이터모델과 정합
// Firebase 연결 시 이 타입을 Firestore 변환기(converter)에 그대로 사용한다.
export type Outcome = "TEAM_A_WIN" | "DRAW" | "TEAM_B_WIN";
export type ModelName = "GPT" | "Claude" | "Gemini";
// scheduled: 오픈 전 / open: 투표 가능 / locked: 킥오프 후 마감 / live / finished
export type MatchStatus =
| "scheduled"
| "open"
| "locked"
| "live"
| "finished"
| "upcoming";
export interface Team {
name: string; // 표시명 (예: Korea Republic)
shortName: string; // 짧은 표시 (예: 한국)
code: string; // KOR / CZE
flag: string; // 이모지 국기 (1차), 추후 에셋 교체 가능
}
export interface Match {
matchId: string;
roundLabel: string; // "Match 01"
group: string; // "A"
teamA: Team;
teamB: Team;
kickoffKst: string; // ISO with +09:00
venue: string;
opensAt: string; // ISO — 투표 오픈 (킥오프 -48h, D-2)
lockAt: string; // ISO — 투표 마감 (킥오프 정각 = 경기 시작 전까지)
status: MatchStatus;
hookText: string; // "한국 첫 경기, AI의 선택은 갈렸다"
result?: { scoreA: number; scoreB: number; outcome: Outcome } | null;
}
export interface AIPrediction {
matchId: string;
model: ModelName;
outcome: Outcome;
scoreA: number;
scoreB: number;
confidencePct: number; // 0-100
reasonShort: string;
generatedAt: string; // 데이터 기준일
}
export interface CrowdStats {
matchId: string;
total: number;
teamAWin: number;
draw: number;
teamBWin: number;
}
export interface UserPick {
outcome: Outcome;
scoreA: number;
scoreB: number;
}