-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtypes.ts
More file actions
155 lines (140 loc) · 3.1 KB
/
Copy pathtypes.ts
File metadata and controls
155 lines (140 loc) · 3.1 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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
export type Role = 'student' | 'admin';
export interface Profile {
id: string;
full_name: string | null;
avatar_url: string | null;
website: string | null;
bio: string | null;
updated_at: string | null;
// Computed/Joined fields
role?: Role;
email?: string;
}
export interface User {
id: string;
email: string;
prn_number: string;
full_name: string;
role: Role;
points: number;
created_at?: string;
}
export interface MemberRecord {
id: string;
prn_number: string;
full_name: string;
email: string;
status: 'verified' | 'pending';
created_at: string;
}
export interface SystemLog {
id: string;
type: 'member_init' | 'registration' | 'auth_attempt' | 'update';
message: string;
timestamp: string;
user_prn?: string;
}
export type Event = {
id: string;
title: string;
date: string;
time: string;
description: string;
speaker: string;
banner_url: string;
status: 'upcoming' | 'ongoing' | 'completed';
created_at: string;
registration_schema: any; // jsonb
registration_type: 'google_form' | 'internal' | 'external';
registration_link: string;
details_image_url: string;
};
export interface Resource {
id: string;
title: string;
category: 'youtube' | 'website';
url: string;
thumbnail?: string;
tags: string[];
bestFor?: string;
contentType?: string;
}
export type Project = {
id: string;
title: string;
description: string;
screenshot_url: string;
github_url: string;
live_url: string;
deployment_link?: string; // Optional deployment link
tech_stack: string[]; // _text array in postgres usually maps to string[]
student_name: string;
is_featured: boolean;
created_at: string;
};
export interface Contest {
id: string;
title: string;
type: 'weekly' | 'monthly';
description?: string;
start_time: string;
end_time: string;
created_by?: string;
created_at?: string;
// status computed on frontend (upcoming, active, ended)
}
export interface Problem {
id: string;
contest_id: string;
title: string;
description: string;
difficulty: 'Easy' | 'Medium' | 'Hard';
points: number;
function_name: string;
created_at?: string;
}
export interface TestCase {
id: string;
problem_id: string;
input: string;
expected_output: string;
is_hidden: boolean;
}
export interface Submission {
id: string;
user_id: string;
contest_id: string;
problem_id: string;
language: string;
code: string;
status: 'accepted' | 'wrong' | 'error' | 'pending';
score: number;
created_at: string;
}
export interface LeaderboardEntry {
id: string;
user_id: string;
contest_id: string;
total_score: number;
solved_count: number;
rank: number;
// Joined
full_name?: string;
}
// Legacy types (keep if needed or refactor)
export interface Question {
id: string;
title: string;
difficulty: 'Easy' | 'Medium' | 'Hard';
description: string;
points: number;
test_cases: { input: string; output: string }[];
}
export type TeamMember = {
id: string;
name: string;
role: string;
photo_url: string;
category: 'core' | 'technical' | 'design' | 'marketing' | 'mentor';
created_at: string;
};