forked from Sachinchaurasiya360/InternHack
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbase.prisma
More file actions
1438 lines (1289 loc) · 42.8 KB
/
base.prisma
File metadata and controls
1438 lines (1289 loc) · 42.8 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
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
generator client {
provider = "prisma-client-js"
}
datasource db {
provider = "postgresql"
}
model user {
id Int @id @default(autoincrement())
name String
email String @unique
password String
role UserRole @default(STUDENT)
isActive Boolean @default(true)
isProfilePublic Boolean @default(false)
isVerified Boolean @default(false)
verificationOtp String?
otpExpiresAt DateTime?
resetPasswordOtp String?
resetOtpExpiresAt DateTime?
passwordResetAttempts Int @default(0)
passwordResetLockedUntil DateTime?
contactNo String?
profilePic String?
coverImage String?
resumes String[] @default([])
company String?
designation String?
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
subscriptionPlan SubscriptionPlan @default(FREE)
subscriptionStatus SubscriptionStatus @default(EXPIRED)
subscriptionStartDate DateTime?
subscriptionEndDate DateTime?
bio String?
college String?
graduationYear Int?
skills String[] @default([])
linkedinUrl String?
githubUrl String?
portfolioUrl String?
location String?
jobStatus String?
projects Json @default("[]")
achievements Json @default("[]")
leetcodeUrl String?
unsubscribeDigest Boolean @default(false)
tokenVersion Int @default(0)
adminProfile adminProfile? @relation("AdminProfile")
applications application[] @relation("StudentApplications")
atsScores atsScore[] @relation("StudentAtsScores")
blogPosts blogPost[] @relation("BlogAuthor")
createdCompanies company[] @relation("UserCreatedCompanies")
addedContacts companyContact[] @relation("UserAddedContacts")
reviewedContributions companyContribution[] @relation("AdminReviewedContributions")
contributions companyContribution[] @relation("UserContributions")
companyReviews companyReview[] @relation("UserReviews")
dsaBookmarks dsaBookmark[] @relation("StudentDsaBookmarks")
dsaProblemReports dsaProblemReport[]
emailCampaigns emailCampaign[] @relation("UserEmailCampaigns")
employeeProfile employee? @relation("EmployeeUser")
postedJobs job[] @relation("RecruiterJobs")
payments payment[] @relation("UserPayments")
createdSkillTests skillTest[] @relation("SkillTestCreator")
skillTestAttempts skillTestAttempt[] @relation("StudentSkillTestAttempts")
aptitudeProgress studentAptitudeProgress[] @relation("StudentAptitudeProgress")
studentBadges studentBadge[] @relation("StudentBadges")
dsaProgress studentDsaProgress[] @relation("StudentDsaProgress")
dsaSubmissions dsaSubmission[] @relation("StudentDsaSubmissions")
sqlProgress studentSqlProgress[] @relation("StudentSqlProgress")
savedCandidates savedCandidate[] @relation("RecruiterSavedCandidates")
savedByRecruiters savedCandidate[] @relation("StudentSavedByRecruiters")
usageLogs usageLog[] @relation("UserUsageLogs")
customRoles userCustomRole[] @relation("UserCustomRoles")
verifiedSkills verifiedSkill[] @relation("StudentVerifiedSkills")
jobPreference userJobPreference? @relation("UserJobPreferences")
jobMatches jobMatch[] @relation("UserJobMatches")
agentConversations jobAgentConversation[] @relation("UserAgentConversations")
jobAgentEmailLogs jobAgentEmailLog[] @relation("UserJobAgentEmailLogs")
milestoneEmails milestoneEmail[] @relation("StudentMilestoneEmails")
externalApplications externalJobApplication[] @relation("StudentExternalApplications")
repoRequests repoRequest[] @relation("UserRepoRequests")
guideFeedbacks guideFeedback[]
interviewProgress userInterviewProgress[] @relation("StudentInterviewProgress")
interviewExperiences interviewExperience[] @relation("UserInterviewExperiences")
interviewUpvotes interviewExperienceUpvote[] @relation("UserInterviewUpvotes")
roadmapEnrollments roadmapEnrollment[] @relation("UserRoadmapEnrollments")
scheduledEmails scheduledEmail[] @relation("UserScheduledEmails")
privateRoadmaps roadmap[] @relation("UserPrivateRoadmaps")
generatedResumes generatedResume[] @relation("UserGeneratedResumes")
leetcodeImports leetcodeImportLog[] @relation("UserLeetcodeImports")
generatedCoverLetters generatedCoverLetter[] @relation("StudentCoverLetters")
recommendation userRecommendation? @relation("UserRecommendation")
hackathonParticipations hackathonParticipation[] @relation("UserHackathonParticipations")
@@index([role])
@@index([role, isActive])
@@index([createdAt])
}
model userInterviewProgress {
id Int @id @default(autoincrement())
userId Int @unique
completedIds String[] @default([])
bookmarkedIds String[] @default([])
lastVisitedId String?
lastVisitedAt DateTime?
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
user user @relation("StudentInterviewProgress", fields: [userId], references: [id], onDelete: Cascade)
@@index([userId])
}
model adminProfile {
id Int @id @default(autoincrement())
userId Int @unique
tier AdminTier @default(ADMIN)
isActive Boolean @default(true)
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
user user @relation("AdminProfile", fields: [userId], references: [id], onDelete: Cascade)
}
model job {
id Int @id @default(autoincrement())
title String
description String
location String
salary String
company String
status JobStatus @default(DRAFT)
customFields Json @default("[]")
deadline DateTime?
tags String[] @default([])
recruiterId Int?
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
applications application[]
recruiter user? @relation("RecruiterJobs", fields: [recruiterId], references: [id])
rounds round[]
@@index([recruiterId])
@@index([status])
@@index([status, createdAt])
@@index([deadline])
@@index([createdAt])
}
model round {
id Int @id @default(autoincrement())
jobId Int
name String
description String?
orderIndex Int
instructions String?
customFields Json @default("[]")
evaluationCriteria Json @default("[]")
assessmentQuestions Json @default("[]")
timeLimitSecs Int?
autoGrade Boolean @default(false)
activateAt DateTime?
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
job job @relation(fields: [jobId], references: [id], onDelete: Cascade)
roundSubmissions roundSubmission[]
@@unique([jobId, orderIndex])
@@index([jobId])
}
model application {
id Int @id @default(autoincrement())
jobId Int
studentId Int
status ApplicationStatus @default(APPLIED)
currentRoundId Int?
customFieldAnswers Json @default("{}")
resumeUrl String?
coverLetter String?
studentNotes String? @db.Text
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
job job @relation(fields: [jobId], references: [id], onDelete: Cascade)
student user @relation("StudentApplications", fields: [studentId], references: [id], onDelete: Cascade)
interviews interview[] @relation("ApplicationInterviews")
roundSubmissions roundSubmission[]
@@unique([jobId, studentId])
@@index([jobId])
@@index([studentId])
@@index([status])
@@index([createdAt])
@@index([jobId, status])
}
model roundSubmission {
id Int @id @default(autoincrement())
applicationId Int
roundId Int
status RoundStatus @default(PENDING)
fieldAnswers Json @default("{}")
attachments String[] @default([])
evaluationScores Json?
recruiterNotes String?
submittedAt DateTime?
evaluatedAt DateTime?
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
application application @relation(fields: [applicationId], references: [id], onDelete: Cascade)
round round @relation(fields: [roundId], references: [id], onDelete: Cascade)
@@unique([applicationId, roundId])
@@index([roundId])
}
model scrapedJob {
id Int @id @default(autoincrement())
title String
description String
company String
location String
salary String?
tags String[] @default([])
applicationUrl String
source String
sourceId String
sourceUrl String?
status ScrapedJobStatus @default(ACTIVE)
scrapedAt DateTime @default(now())
lastSeenAt DateTime @default(now())
metadata Json @default("{}")
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
@@unique([source, sourceId])
@@index([status])
@@index([source])
@@index([createdAt])
}
model atsScore {
id Int @id @default(autoincrement())
studentId Int
resumeUrl String
jobTitle String?
jobDescription String?
overallScore Int
categoryScores Json
suggestions Json
keywordAnalysis Json
rawResponse Json
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
student user @relation("StudentAtsScores", fields: [studentId], references: [id], onDelete: Cascade)
@@index([studentId])
@@index([createdAt])
}
model scrapeLog {
id Int @id @default(autoincrement())
source String
status String
jobsFound Int @default(0)
jobsCreated Int @default(0)
jobsUpdated Int @default(0)
error String?
duration Int
createdAt DateTime @default(now())
}
model fundingSignal {
id Int @id @default(autoincrement())
companyName String
companyWebsite String?
logoUrl String?
fundingRound String?
fundingAmount String?
amountUsd BigInt?
announcedAt DateTime
hqLocation String?
industry String?
description String?
sourceUrl String
source String
sourceId String
investors String[] @default([])
tags String[] @default([])
careersUrl String?
hiringSignal Boolean @default(false)
status FundingSignalStatus @default(ACTIVE)
metadata Json @default("{}")
scrapedAt DateTime @default(now())
lastSeenAt DateTime @default(now())
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
@@unique([source, sourceId])
@@index([status])
@@index([source])
@@index([announcedAt])
@@index([industry])
}
model fundingSignalLog {
id Int @id @default(autoincrement())
source String
status String
signalsFound Int @default(0)
signalsCreated Int @default(0)
signalsUpdated Int @default(0)
error String?
duration Int
createdAt DateTime @default(now())
}
model company {
id Int @id @default(autoincrement())
name String
slug String @unique
logo String?
description String
mission String?
industry String
size CompanySize
city String
state String?
address String?
officeLocations Json @default("[]")
website String?
socialLinks Json @default("{}")
technologies String[] @default([])
hiringStatus Boolean @default(false)
foundedYear Int?
photos String[] @default([])
avgRating Float @default(0)
reviewCount Int @default(0)
isApproved Boolean @default(false)
createdById Int
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
createdBy user @relation("UserCreatedCompanies", fields: [createdById], references: [id])
contacts companyContact[]
reviews companyReview[]
interviewExperiences interviewExperience[]
@@index([city])
@@index([industry])
@@index([isApproved])
@@index([createdById])
}
model companyReview {
id Int @id @default(autoincrement())
companyId Int
userId Int
rating Int
title String
content String
pros String?
cons String?
interviewExperience String?
workCulture String?
salaryInsights String?
status ReviewStatus @default(PENDING)
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
company company @relation(fields: [companyId], references: [id], onDelete: Cascade)
user user @relation("UserReviews", fields: [userId], references: [id], onDelete: Cascade)
@@index([companyId])
@@index([userId])
@@index([status])
@@index([createdAt])
}
model companyContact {
id Int @id @default(autoincrement())
companyId Int
name String
designation String
email String?
phone String?
linkedinUrl String?
isPublic Boolean @default(true)
addedById Int?
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
addedBy user? @relation("UserAddedContacts", fields: [addedById], references: [id])
company company @relation(fields: [companyId], references: [id], onDelete: Cascade)
@@index([companyId])
}
model companyContribution {
id Int @id @default(autoincrement())
userId Int
type ContributionType
companyId Int?
data Json
status ContributionStatus @default(PENDING)
adminNotes String?
reviewedById Int?
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
reviewedBy user? @relation("AdminReviewedContributions", fields: [reviewedById], references: [id])
user user @relation("UserContributions", fields: [userId], references: [id], onDelete: Cascade)
@@index([status])
@@index([userId])
}
model newsletterSubscriber {
id Int @id @default(autoincrement())
email String @unique
createdAt DateTime @default(now())
}
model payment {
id Int @id @default(autoincrement())
userId Int
amount Int
currency String @default("USD")
plan SubscriptionPlan
billing String
status PaymentStatus @default(PENDING)
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
dodoCheckoutUrl String?
dodoPaymentId String? @unique
dodoSubscriptionId String?
user user @relation("UserPayments", fields: [userId], references: [id], onDelete: Cascade)
@@index([userId])
@@index([status])
@@index([dodoPaymentId])
}
model opensourceRepo {
id Int @id @default(autoincrement())
name String
owner String
description String
language String
techStack String[] @default([])
difficulty RepoDifficulty @default(BEGINNER)
domain RepoDomain @default(WEB)
issueTypes String[] @default([])
stars Int @default(0)
forks Int @default(0)
openIssues Int @default(0)
url String
logo String?
tags String[] @default([])
highlights String[] @default([])
trending Boolean @default(false)
lastUpdated DateTime @default(now())
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
@@index([domain])
@@index([difficulty])
@@index([language])
}
model repoRequest {
id Int @id @default(autoincrement())
name String
owner String
description String
language String
url String
domain RepoDomain @default(WEB)
difficulty RepoDifficulty @default(BEGINNER)
techStack String[] @default([])
tags String[] @default([])
reason String
status RepoRequestStatus @default(PENDING)
adminNote String?
userId Int
user user @relation("UserRepoRequests", fields: [userId], references: [id], onDelete: Cascade)
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
@@index([status])
@@index([userId])
}
model blogPost {
id Int @id @default(autoincrement())
title String
slug String @unique
content String
excerpt String?
category BlogCategory
tags String[] @default([])
authorId Int
status BlogStatus @default(DRAFT)
featuredImage String?
readingTime Int @default(0)
viewCount Int @default(0)
isFeatured Boolean @default(false)
publishedAt DateTime?
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
author user @relation("BlogAuthor", fields: [authorId], references: [id], onDelete: Cascade)
@@index([authorId])
@@index([status])
@@index([category])
@@index([publishedAt])
}
model gsocOrganization {
id Int @id @default(autoincrement())
name String
slug String @unique
url String
imageUrl String?
imageBgColor String?
description String
category String
topics String[] @default([])
technologies String[] @default([])
yearsParticipated Int[] @default([])
totalProjects Int @default(0)
projectsData Json?
contactEmail String?
mailingList String?
ideasUrl String?
guideUrl String?
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
@@index([category])
@@index([name])
}
model ycCompany {
id Int @id @default(autoincrement())
ycId Int @unique
name String
slug String
oneLiner String?
longDescription String?
batch String?
batchShort String?
status String?
website String?
smallLogoUrl String?
allLocations String?
teamSize Int?
industry String?
subindustry String?
tags String[] @default([])
industries String[] @default([])
regions String[] @default([])
stage String?
isHiring Boolean @default(false)
topCompany Boolean @default(false)
ycUrl String?
launchedAt DateTime?
founders Json?
socialLinks Json?
scrapedAt DateTime?
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
@@index([batchShort])
@@index([industry])
@@index([status])
@@index([isHiring])
@@index([topCompany])
@@index([name])
}
model leetcodeImportLog {
id Int @id @default(autoincrement())
userId Int
username String?
source String @default("LEETCODE_USERNAME")
matched Int @default(0)
imported Int @default(0)
importedAt DateTime @default(now())
user user @relation("UserLeetcodeImports", fields: [userId], references: [id], onDelete: Cascade)
@@index([userId])
@@index([importedAt])
}
model dsaTopic {
id Int @id @default(autoincrement())
name String
slug String @unique
description String?
orderIndex Int @unique
createdAt DateTime @default(now())
}
model dsaProblem {
id Int @id @default(autoincrement())
title String
slug String @unique
difficulty String
leetcodeId Int?
leetcodeUrl String?
leetcodeSlug String? @unique
gfgUrl String?
articleUrl String?
videoUrl String?
hackerrankUrl String?
codechefUrl String?
tags String[] @default([])
companies String[] @default([])
hints String[] @default([])
sheets String[] @default([])
description String?
examples String?
constraints String?
acceptanceRate String?
totalAccepted Int?
totalSubmissions Int?
similarQuestions Json? @default("[]")
category String?
isPremium Boolean @default(false)
bookmarks dsaBookmark[]
progress studentDsaProgress[]
testCases dsaTestCase[]
submissions dsaSubmission[]
reports dsaProblemReport[]
@@index([difficulty])
@@index([leetcodeId])
}
model dsaProblemReport {
id Int @id @default(autoincrement())
reason String
message String?
createdAt DateTime @default(now())
userId Int
user user @relation(fields: [userId], references: [id], onDelete: Cascade)
problemId Int
problem dsaProblem @relation(fields: [problemId], references: [id], onDelete: Cascade)
}
model studentDsaProgress {
id Int @id @default(autoincrement())
studentId Int
problemId Int
source String @default("INTERNAL")
solved Boolean @default(true)
notes String?
solvedAt DateTime @default(now())
problem dsaProblem @relation(fields: [problemId], references: [id], onDelete: Cascade)
student user @relation("StudentDsaProgress", fields: [studentId], references: [id], onDelete: Cascade)
@@unique([studentId, problemId])
@@index([studentId])
}
model dsaBookmark {
id Int @id @default(autoincrement())
studentId Int
problemId Int
createdAt DateTime @default(now())
problem dsaProblem @relation(fields: [problemId], references: [id], onDelete: Cascade)
student user @relation("StudentDsaBookmarks", fields: [studentId], references: [id], onDelete: Cascade)
@@unique([studentId, problemId])
@@index([studentId])
}
model dsaTestCase {
id Int @id @default(autoincrement())
problemId Int
input String
expected String
label String?
orderIndex Int @default(0)
createdAt DateTime @default(now())
problem dsaProblem @relation(fields: [problemId], references: [id], onDelete: Cascade)
@@index([problemId])
}
model dsaSubmission {
id Int @id @default(autoincrement())
studentId Int
problemId Int
language String
code String
passed Int @default(0)
total Int @default(0)
allPassed Boolean @default(false)
timeMs Int?
memoryKb Int?
results Json @default("[]")
createdAt DateTime @default(now())
student user @relation("StudentDsaSubmissions", fields: [studentId], references: [id], onDelete: Cascade)
problem dsaProblem @relation(fields: [problemId], references: [id], onDelete: Cascade)
@@index([studentId, problemId])
@@index([studentId])
@@index([createdAt])
}
model studentSqlProgress {
id Int @id @default(autoincrement())
studentId Int
exerciseId String
solved Boolean @default(false)
code String?
solvedAt DateTime @default(now())
student user @relation("StudentSqlProgress", fields: [studentId], references: [id], onDelete: Cascade)
@@unique([studentId, exerciseId])
@@index([studentId])
}
model aptitudeCategory {
id Int @id @default(autoincrement())
name String @unique
slug String @unique
description String?
orderIndex Int @default(0)
createdAt DateTime @default(now())
topics aptitudeTopic[]
}
model aptitudeTopic {
id Int @id @default(autoincrement())
categoryId Int
name String
slug String @unique
description String?
orderIndex Int @default(0)
sourceUrl String?
createdAt DateTime @default(now())
questions aptitudeQuestion[]
category aptitudeCategory @relation(fields: [categoryId], references: [id], onDelete: Cascade)
}
model aptitudeQuestion {
id Int @id @default(autoincrement())
topicId Int
question String
optionA String
optionB String
optionC String
optionD String
optionE String?
correctAnswer String
explanation String?
difficulty String @default("MEDIUM")
companies String[] @default([])
sourceUrl String?
createdAt DateTime @default(now())
topic aptitudeTopic @relation(fields: [topicId], references: [id], onDelete: Cascade)
progress studentAptitudeProgress[]
}
model studentAptitudeProgress {
id Int @id @default(autoincrement())
studentId Int
questionId Int
answered Boolean @default(false)
correct Boolean @default(false)
createdAt DateTime @default(now())
lastPracticedAt DateTime @default(now())
question aptitudeQuestion @relation(fields: [questionId], references: [id], onDelete: Cascade)
student user @relation("StudentAptitudeProgress", fields: [studentId], references: [id], onDelete: Cascade)
@@unique([studentId, questionId])
@@index([studentId])
}
model skillTest {
id Int @id @default(autoincrement())
skillName String
title String
description String?
difficulty TestDifficulty @default(INTERMEDIATE)
timeLimitSecs Int @default(1800)
passThreshold Int @default(70)
isActive Boolean @default(true)
createdById Int?
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
createdBy user? @relation("SkillTestCreator", fields: [createdById], references: [id])
attempts skillTestAttempt[]
questions skillTestQuestion[]
@@unique([skillName, difficulty])
@@index([skillName])
@@index([isActive])
}
model skillTestQuestion {
id Int @id @default(autoincrement())
testId Int
question String
options Json
correctIndex Int
explanation String?
orderIndex Int @default(0)
createdAt DateTime @default(now())
test skillTest @relation(fields: [testId], references: [id], onDelete: Cascade)
@@index([testId])
}
model skillTestAttempt {
id Int @id @default(autoincrement())
testId Int
studentId Int
score Int
passed Boolean
answers Json
proctorLog Json?
proctoringScore Int?
autoTerminated Boolean @default(false)
startedAt DateTime @default(now())
completedAt DateTime?
createdAt DateTime @default(now())
student user @relation("StudentSkillTestAttempts", fields: [studentId], references: [id], onDelete: Cascade)
test skillTest @relation(fields: [testId], references: [id], onDelete: Cascade)
@@index([studentId])
@@index([testId])
}
model verifiedSkill {
id Int @id @default(autoincrement())
studentId Int
skillName String
score Int
attemptId Int?
verifiedAt DateTime @default(now())
student user @relation("StudentVerifiedSkills", fields: [studentId], references: [id], onDelete: Cascade)
@@unique([studentId, skillName])
@@index([studentId])
@@index([skillName])
}
model usageLog {
id Int @id @default(autoincrement())
userId Int
action UsageAction
createdAt DateTime @default(now())
user user @relation("UserUsageLogs", fields: [userId], references: [id], onDelete: Cascade)
@@index([userId, action, createdAt])
}
model jobAgentEmailLog {
id Int @id @default(autoincrement())
userId Int
jobIds Int[] @default([])
context String?
sentCount Int
createdAt DateTime @default(now())
user user @relation("UserJobAgentEmailLogs", fields: [userId], references: [id], onDelete: Cascade)
@@index([userId, createdAt])
}
model hackathon {
id Int @id @default(autoincrement())
name String
organizer String
logo String?
description String
prizePool String
startDate String
endDate String
location String
locationType String
website String?
tags String[] @default([])
tracks String[] @default([])
eligibility String?
status String @default("upcoming")
ecosystem String
highlights String[] @default([])
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
participations hackathonParticipation[]
@@index([status])
@@index([ecosystem])
}
enum HackathonParticipationStatus {
INTERESTED
PARTICIPATING
}
model hackathonParticipation {
id Int @id @default(autoincrement())
userId Int
hackathonId Int
status HackathonParticipationStatus @default(INTERESTED)
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
user user @relation("UserHackathonParticipations", fields: [userId], references: [id], onDelete: Cascade)
hackathon hackathon @relation(fields: [hackathonId], references: [id], onDelete: Cascade)
@@unique([userId, hackathonId])
@@index([userId])
@@index([hackathonId])
}
model iitProfessor {
id Int @id @default(autoincrement())
collegeName String
collegeType String
department String
name String
areaOfInterest String?
email String?
createdAt DateTime @default(now())
@@index([collegeName])
@@index([department])
@@index([name])
}
model govInternship {
id Int @id @default(autoincrement())
name String
category String
timeline String
organizer String
domain String
stipend String
eligibility String
reality String
applyUrl String?
createdAt DateTime @default(now())
@@index([category])
}
model badge {
id Int @id @default(autoincrement())
name String
slug String @unique
description String
iconUrl String?
category BadgeCategory
criteria Json @default("{}")
isActive Boolean @default(true)
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
studentBadges studentBadge[]
@@index([category])
@@index([isActive])
}
model studentBadge {
id Int @id @default(autoincrement())
studentId Int
badgeId Int
earnedAt DateTime @default(now())
badge badge @relation(fields: [badgeId], references: [id], onDelete: Cascade)
student user @relation("StudentBadges", fields: [studentId], references: [id], onDelete: Cascade)
@@unique([studentId, badgeId])
@@index([studentId])
@@index([badgeId])
}
model savedCandidate {
id Int @id @default(autoincrement())
recruiterId Int
studentId Int
notes String?
createdAt DateTime @default(now())
recruiter user @relation("RecruiterSavedCandidates", fields: [recruiterId], references: [id], onDelete: Cascade)
student user @relation("StudentSavedByRecruiters", fields: [studentId], references: [id], onDelete: Cascade)
@@unique([recruiterId, studentId])
@@index([recruiterId])
@@index([studentId])
}
model aiServiceConfig {
id Int @id @default(autoincrement())
service AIServiceType @unique
provider AIProviderType @default(GEMINI)
modelName String @default("gemini-2.5-flash-lite")
updatedAt DateTime @updatedAt
requestLogs aiRequestLog[]
}
model aiRequestLog {