-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtypes.ts
More file actions
82 lines (72 loc) · 1.52 KB
/
types.ts
File metadata and controls
82 lines (72 loc) · 1.52 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
export interface Player {
id: string;
name: string;
active: boolean; // Is currently present at the court
stats: {
matchesPlayed: number;
wins: number;
losses: number;
draws: number; // Added for matches that end in a tie
gamesWon: number;
gamesLost: number;
restCount: number; // How many times they sat out
};
}
export interface Team {
player1Id: string;
player2Id: string;
}
export interface Match {
id: string;
timestamp: number;
teamA: Team;
teamB: Team;
scoreA: number;
scoreB: number;
isFinished: boolean;
courtNumber: number;
endTime?: number;
location?: string;
}
export interface FeedMessage {
id: string;
timestamp: number;
type: 'SYSTEM' | 'MATCH_START' | 'MATCH_END' | 'ANNOUNCEMENT';
content: string;
author?: string; // Optional author for announcements
}
export interface AppState {
players: Player[];
matches: Match[];
feed: FeedMessage[];
}
export enum Tab {
PLAYERS = 'PLAYERS',
MATCHES = 'MATCHES',
STATS = 'STATS',
FEED = 'FEED',
ADMIN = 'ADMIN'
}
export type ToastType = 'success' | 'error' | 'warning' | 'info';
export interface Toast {
id: string;
message: string;
type: ToastType;
duration?: number;
}
export interface SessionSummary {
id: string;
playedAt: number;
location?: string;
status: string;
}
// Supabase session record types
export interface SessionRecord {
id: string;
played_at: string;
location: string | null;
status: string;
}
export interface SessionLocationRecord {
location: string | null;
}