Skip to content

Commit 2bc3e47

Browse files
feat: editable profiles (#100)
https://project.hackthehill.com/projects/track-the-hack/work_packages/46/activity --------- Co-authored-by: macsaheen <saheen_j@ymail.com>
1 parent 17841bb commit 2bc3e47

5 files changed

Lines changed: 635 additions & 186 deletions

File tree

prisma/schema.prisma

Lines changed: 147 additions & 118 deletions
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,32 @@
1-
// This is your Prisma schema file,
2-
// learn more about it in the docs: https://pris.ly/d/prisma-schema
3-
41
generator client {
5-
provider = "prisma-client-js"
2+
provider = "prisma-client-js"
63
}
74

85
datasource db {
9-
provider = "mysql"
10-
// NOTE: When using postgresql, mysql or sqlserver, uncomment the @db.Text annotations in model Account below
11-
// Further reading:
12-
// https://next-auth.js.org/adapters/prisma#create-the-prisma-schema
13-
// https://www.prisma.io/docs/reference/api-reference/prisma-schema-reference#string
14-
url = env("DATABASE_URL")
15-
relationMode = "prisma"
6+
provider = "mysql"
7+
url = env("DATABASE_URL")
8+
relationMode = "prisma"
169
}
1710

18-
// Necessary for Next auth
1911
model Account {
20-
id String @id @default(cuid())
21-
userId String
22-
type String
23-
provider String
24-
providerAccountId String
25-
refresh_token String? @db.Text
26-
refresh_token_expires_in Int?
27-
access_token String? @db.Text
28-
ext_expires_in Int?
29-
expires_at Int?
30-
token_type String?
31-
scope String?
32-
id_token String? @db.Text
33-
session_state String?
34-
user User @relation(fields: [userId], references: [id], onDelete: Cascade)
35-
36-
@@unique([provider, providerAccountId])
37-
@@index([userId])
12+
id String @id @default(cuid())
13+
userId String
14+
type String
15+
provider String
16+
providerAccountId String
17+
refresh_token String? @db.Text
18+
refresh_token_expires_in Int?
19+
access_token String? @db.Text
20+
expires_at Int?
21+
token_type String?
22+
scope String?
23+
id_token String? @db.Text
24+
session_state String?
25+
ext_expires_in Int?
26+
user User @relation(fields: [userId], references: [id], onDelete: Cascade)
27+
28+
@@unique([provider, providerAccountId])
29+
@@index([userId])
3830
}
3931

4032
model AuditLog {
@@ -75,120 +67,157 @@ model User {
7567
}
7668

7769
model VerificationToken {
78-
identifier String
79-
token String @unique
80-
expires DateTime
70+
identifier String
71+
token String @unique
72+
expires DateTime
8173
82-
@@unique([identifier, token])
74+
@@unique([identifier, token])
8375
}
8476

8577
model HackerInfo {
86-
id String @id @default(cuid()) @map("submissionID")
87-
preferredLanguage Language @default(EN)
88-
email String
89-
firstName String
90-
lastName String
91-
gender String @default("Prefer not to say")
92-
phoneNumber String
93-
university String?
94-
studyLevel String?
95-
studyProgram String?
96-
graduationYear Int?
97-
attendanceType AttendanceType @default(IN_PERSON)
98-
location String? @map("attendanceLocation")
99-
transportationRequired Boolean @default(false)
100-
dietaryRestrictions String @db.Text
101-
accessibilityRequirements String @db.Text
102-
shirtSize ShirtSize?
103-
emergencyContactName String
104-
emergencyContactRelationship String
105-
emergencyContactPhoneNumber String
106-
numberOfPreviousHackathons Int?
107-
linkGithub String?
108-
linkLinkedin String?
109-
linkPersonalSite String?
110-
linkResume String? @db.Text
111-
lookingForwardTo String? @db.Text
112-
formStartDate DateTime?
113-
formEndDate DateTime?
114-
confirmed Boolean @default(false)
115-
user User? @relation(fields: [userId], references: [id])
116-
userId String?
117-
unsubscribed Boolean @default(false)
118-
unsubscribeToken String? @unique @default(cuid())
119-
onlyOnline Boolean @default(false)
120-
acceptanceExpiry DateTime?
121-
walkIn Boolean @default(false)
122-
winner Boolean @default(false)
123-
presenceInfo PresenceInfo?
124-
125-
@@index([userId])
78+
id String @id @default(cuid()) @map("submissionID")
79+
preferredLanguage Language @default(EN)
80+
email String
81+
firstName String
82+
lastName String
83+
gender String @default("Prefer not to say")
84+
phoneNumber String
85+
university String?
86+
studyLevel String?
87+
studyProgram String?
88+
graduationYear Int?
89+
attendanceType AttendanceType @default(IN_PERSON)
90+
location String? @map("attendanceLocation")
91+
transportationRequired Boolean @default(false)
92+
dietaryRestrictions String @db.Text
93+
accessibilityRequirements String @db.Text
94+
shirtSize ShirtSize?
95+
emergencyContactName String
96+
emergencyContactRelationship String
97+
emergencyContactPhoneNumber String
98+
numberOfPreviousHackathons Int?
99+
linkGithub String?
100+
linkLinkedin String?
101+
linkPersonalSite String?
102+
linkResume String? @db.Text
103+
lookingForwardTo String? @db.Text
104+
formStartDate DateTime?
105+
formEndDate DateTime?
106+
confirmed Boolean @default(false)
107+
userId String?
108+
unsubscribed Boolean @default(false)
109+
unsubscribeToken String? @unique @default(cuid())
110+
onlyOnline Boolean @default(false)
111+
acceptanceExpiry DateTime?
112+
walkIn Boolean @default(false)
113+
winner Boolean @default(false)
114+
user User? @relation(fields: [userId], references: [id])
115+
presenceInfo PresenceInfo?
116+
117+
@@index([userId])
126118
}
127119

128120
model PresenceInfo {
129-
id String @id @default(cuid())
130-
checkedIn Boolean @default(false)
131-
breakfast1 Boolean @default(false)
132-
lunch1 Boolean @default(false)
133-
dinner1 Boolean @default(false)
134-
snacks Boolean @default(false)
135-
snacks2 Boolean @default(false)
136-
redbull Boolean @default(false)
137-
breakfast2 Boolean @default(false)
138-
lunch2 Boolean @default(false)
139-
lunch22 Boolean @default(false)
140-
hackerInfo HackerInfo @relation(fields: [hackerInfoId], references: [id])
141-
hackerInfoId String @unique
121+
id String @id @default(cuid())
122+
checkedIn Boolean @default(false)
123+
breakfast1 Boolean @default(false)
124+
lunch1 Boolean @default(false)
125+
dinner1 Boolean @default(false)
126+
breakfast2 Boolean @default(false)
127+
lunch2 Boolean @default(false)
128+
hackerInfoId String @unique
129+
snacks Boolean @default(false)
130+
redbull Boolean @default(false)
131+
snacks2 Boolean @default(false)
132+
lunch22 Boolean @default(false)
133+
hackerInfo HackerInfo @relation(fields: [hackerInfoId], references: [id])
134+
}
135+
136+
model Payment {
137+
id String @id @default(cuid())
138+
company_name String
139+
amount Int
140+
reps_name String
141+
tier Tiers
142+
logo String
143+
paid String
144+
date DateTime
145+
invoice String
142146
}
143147

144148
model Event {
145-
id String @id @default(cuid())
146-
start DateTime
147-
end DateTime
148-
name String
149-
type EventType @default(ALL)
150-
host String?
151-
description String @db.Text
152-
room String
153-
image String?
154-
link String?
155-
linkText String?
156-
tiktok String?
149+
id String @id @default(cuid())
150+
start DateTime
151+
end DateTime
152+
name String
153+
type EventType @default(ALL)
154+
host String?
155+
description String @db.Text
156+
room String
157+
tiktok String?
158+
image String?
159+
link String?
160+
linkText String?
157161
}
158162

159163
model Follow {
160-
id String @id @default(cuid())
161-
email String @unique
164+
id String @id @default(cuid())
165+
email String @unique
166+
}
167+
168+
169+
model AuditLogToUser {
170+
A Int
171+
B String
172+
173+
@@unique([A, B], map: "_AuditLogToUser_AB_unique")
174+
@@index([B], map: "_AuditLogToUser_B_index")
175+
@@map("_AuditLogToUser")
176+
}
177+
178+
model Link {
179+
id String @id
180+
label String
181+
link String
162182
}
163183

164184
enum Language {
165-
EN
166-
FR
185+
EN
186+
FR
167187
}
168188

169189
enum AttendanceType {
170-
IN_PERSON
171-
ONLINE
190+
IN_PERSON
191+
ONLINE
172192
}
173193

174194
enum ShirtSize {
175-
S
176-
M
177-
L
178-
XL
179-
XXL
195+
S
196+
M
197+
L
198+
XL
199+
XXL
180200
}
181201

182202
enum Role {
183-
HACKER
184-
ORGANIZER
185-
SPONSOR
203+
HACKER
204+
ORGANIZER
205+
SPONSOR
186206
}
187207

188208
enum EventType {
189-
ALL
190-
WORKSHOP
191-
SOCIAL
192-
CAREER_FAIR
193-
FOOD
209+
ALL
210+
WORKSHOP
211+
SOCIAL
212+
CAREER_FAIR
213+
FOOD
214+
}
215+
216+
enum Tiers {
217+
STARTUP
218+
MAYOR
219+
PREMIER
220+
GOVERNOR
221+
PRIME_MINISTER
222+
CUSTOM
194223
}

public/locales/en/hacker.json

Lines changed: 31 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,31 @@
1-
{}
1+
{
2+
"gender": "Gender",
3+
"firstName": "First Name",
4+
"lastName": "Last Name",
5+
"university": "University",
6+
"study": "Study",
7+
"studyLevel": "Study Level",
8+
"studyProgram": "Study Program",
9+
"graduationYear": "Graduation Year",
10+
"phoneNumber": "Phone Number",
11+
"email": "Email",
12+
"emergencyContactName": "Emergency Contact Name",
13+
"emergencyContactRelationship": "Emergency Contact Relationship",
14+
"emergencyContactPhoneNumber": "Emergency Contact Phone Number",
15+
"dietaryRestrictions": "Dietary Restrictions",
16+
"accessibilityRequirements": "Accessibility Requirements",
17+
"preferredLanguage": "Preferred Language",
18+
"shirtSize": "Shirt Size",
19+
"walkIn": "Walk In",
20+
"subscribeToMailingList": "Subscribe to Mailing List",
21+
"attendanceType": "Attendance Type",
22+
"location": "Location",
23+
"transportationRequired": "Transportation Required",
24+
"category_personal_information": "Personal Information",
25+
"category_emergency_contact": "Emergency Contact",
26+
"category_general_information": "General Information",
27+
"category_links_information": "Links Information",
28+
"edit_description": "Careful - you have unsaved changes!",
29+
"edit_reset_button": "Reset",
30+
"edit_save_button": "Save"
31+
}

public/locales/fr/hacker.json

Lines changed: 34 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,34 @@
1-
{}
1+
{
2+
"gender": "Genre",
3+
"firstName": "Prénom",
4+
"lastName": "Nom de famille",
5+
"university": "Université",
6+
"study": "Études",
7+
"studyLevel": "Niveau d'études",
8+
"studyProgram": "Programme d'études",
9+
"graduationYear": "Année de diplomation",
10+
"phoneNumber": "Numéro de téléphone",
11+
"email": "Adresse e-mail",
12+
"emergencyContactName": "Nom du contact en cas d'urgence",
13+
"emergencyContactRelationship": "Relation avec le contact en cas d'urgence",
14+
"emergencyContactPhoneNumber": "Numéro de téléphone du contact en cas d'urgence",
15+
"dietaryRestrictions": "Restrictions alimentaires",
16+
"accessibilityRequirements": "Exigences en matière d'accessibilité",
17+
"preferredLanguage": "Langue préférée",
18+
"shirtSize": "Taille de chemise",
19+
"walkIn": "Marcher",
20+
"subscribeToMailingList": "S'abonner à la liste de diffusion",
21+
"attendanceType": "Type de participation",
22+
"location": "Emplacement",
23+
"transportationRequired": "Transport requis",
24+
"linkGithub": "Lien vers Github",
25+
"linkLinkedin": "Lien vers LinkedIn",
26+
"uploadResume": "Télécharger le CV",
27+
"category_personal_information": "Informations personnelles",
28+
"category_emergency_contact": "Contact en cas d'urgence",
29+
"category_general_information": "Informations générales",
30+
"category_links_information": "Liens",
31+
"edit_description": "Modifications non enregistrées!",
32+
"edit_reset_button": "Réinitialiser",
33+
"edit_save_button": "Sauvegarder"
34+
}

0 commit comments

Comments
 (0)