-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathtypes.ts
101 lines (89 loc) · 1.98 KB
/
types.ts
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
import { type z } from 'zod';
import type { selectStudentSchema } from './family/schema';
export const interestKeys = [
'alcohol',
'anime',
'artGraphics',
'baking',
'charity',
'clubbing',
'cooking',
'danceBallroom',
'danceContemporary',
'dramatics',
'exerciseAndHealth',
'film',
'finance',
'football',
'hiking',
'kpop',
'martialArts',
'otherSports',
'performingMusicClassical',
'performingMusicPopRockJazz',
'photography',
'politics',
'racketSports',
'rowing',
'rugby',
'tabletopGames',
'videoGames'
] as const;
export type Interests = Record<(typeof interestKeys)[number], 0 | 1 | 2>;
export const studentRoles = ['fresher', 'parent'] as const;
export const genderOptions = ['male', 'female', 'other', 'n/a'] as const;
export type Gender = (typeof genderOptions)[number];
export type UserRole = 'parent' | 'fresher';
export type AuthRoles =
| 'parent'
| 'fresher'
| 'authenticated'
| 'all'
| 'unauthenticated'
| 'admin';
export type Env = {
Variables: {
shortcode: string | null;
user_is: UserRole | null;
};
};
export type Student = z.infer<typeof selectStudentSchema>;
export const stateOptions = [
'parents_open',
'parents_close',
'freshers_open',
'closed'
] as const;
export type State = (typeof stateOptions)[number];
export type AllocatorGender = 'Female' | 'Male' | 'other' | 'na'
export type AllocatorStudent = {
firstName: string,
lastName: string,
preferredName: string,
gender: AllocatorGender,
shortcode: string,
course: string,
socialMedia: string[]
}
export type AllocatorFresher = {
_id: string,
student: AllocatorStudent
interests: Interests
family: number | undefined
}
export type AllocatorParent = {
_id: string,
student: AllocatorStudent,
interests: Interests,
family: number
}
export type AllocatorFamily = {
_id: number,
parents: {
proposerId: AllocatorParent
proposeeId: AllocatorParent
}
kids: AllocatorFresher[]
hasFemale: boolean,
hasJmc: boolean
}