@adaptware/eagles-db 0.1.58 → 0.1.60

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -77,6 +77,29 @@ model Action {
77
77
  @@index([due_date])
78
78
  }
79
79
 
80
+ enum ActivityActorType {
81
+ USER
82
+ AI
83
+ SYSTEM
84
+ }
85
+
86
+ model ActivityLog {
87
+ id String @id @default(uuid())
88
+ application_id String
89
+ actor_id String?
90
+ actor_type ActivityActorType @default(USER)
91
+ message String
92
+ timestamp DateTime @default(now())
93
+ metadata Json?
94
+ created_at DateTime @default(now())
95
+ is_active Boolean @default(true)
96
+ // Relations
97
+ actor User? @relation("ActorActivityLogs", fields: [actor_id], references: [id], onDelete: SetNull, onUpdate: Cascade)
98
+ application Application @relation(fields: [application_id], references: [id], onDelete: Cascade, onUpdate: Cascade)
99
+
100
+ @@index([application_id])
101
+ }
102
+
80
103
  // PENDING could be understood as unscreened
81
104
  enum ApplicationStatus {
82
105
  PENDING
@@ -86,20 +109,19 @@ enum ApplicationStatus {
86
109
  }
87
110
 
88
111
  model Application {
89
- id String @id @default(uuid())
90
- candidate_id String
91
- resume_id String
92
- organisation_id String
93
- job_description_id String
94
- status ApplicationStatus @default(PENDING)
95
- fit_check_score Float?
96
- fit_check_status FitCheckStatus?
97
- applied_at DateTime @default(now())
98
- evaluation_plan_id String?
99
- evaluation_plan EvaluationPlan? @relation(fields: [evaluation_plan_id], references: [id])
100
- fit_check_id String? @unique
101
- round_no Int @default(0)
102
-
112
+ id String @id @default(uuid())
113
+ candidate_id String
114
+ resume_id String
115
+ organisation_id String
116
+ job_description_id String
117
+ status ApplicationStatus @default(PENDING)
118
+ fit_check_score Float?
119
+ fit_check_status FitCheckStatus?
120
+ applied_at DateTime @default(now())
121
+ evaluation_plan_id String?
122
+ evaluation_plan EvaluationPlan? @relation(fields: [evaluation_plan_id], references: [id])
123
+ fit_check_id String? @unique
124
+ round_no Int @default(0)
103
125
  // Relations
104
126
  candidate User @relation(fields: [candidate_id], references: [id], onDelete: Cascade, onUpdate: Cascade)
105
127
  organisation Organisation @relation(fields: [organisation_id], references: [id], onDelete: Cascade, onUpdate: Cascade)
@@ -107,19 +129,19 @@ model Application {
107
129
  job_description JobDescription @relation(fields: [job_description_id], references: [id], onDelete: Cascade, onUpdate: Cascade)
108
130
  fit_check FitCheck? @relation(fields: [fit_check_id], references: [id], onDelete: Cascade, onUpdate: Cascade)
109
131
  interviews Interview[]
132
+ assignments Assignment[]
110
133
  ongoing_evaluations OngoingEvaluation[]
111
-
112
- created_at DateTime @default(now())
113
- updated_at DateTime @updatedAt
114
- created_by String
115
- updated_by String
116
- is_active Boolean @default(true)
134
+ activity_logs ActivityLog[]
135
+ // Audit fields
136
+ created_at DateTime @default(now())
137
+ updated_at DateTime @updatedAt
138
+ created_by String
139
+ updated_by String
140
+ is_active Boolean @default(true)
117
141
 
118
142
  @@unique([candidate_id, job_description_id]) // Ensures candidate applies only once per job
119
143
  @@index([candidate_id])
120
144
  @@index([job_description_id])
121
- @@index([organisation_id])
122
- @@index([resume_id])
123
145
  }
124
146
 
125
147
  model Approval {
@@ -149,32 +171,31 @@ enum AssessmentStatus {
149
171
  }
150
172
 
151
173
  model Assessment {
152
- id String @id @default(uuid())
153
- assessment_id String
154
- candidate_id String
155
- reviewer_id String?
156
- score Float?
157
- feedback String?
158
- scheduled_start_time DateTime? @default(now()) // Start Time to start the assessment
159
- assessment_status AssessmentStatus @default(SCHEDULED)
160
- created_at DateTime @default(now())
161
- updated_at DateTime @updatedAt
162
- created_by String
163
- updated_by String
164
- is_active Boolean @default(true)
174
+ id String @id @default(uuid())
175
+ assessment_library_id String
176
+ candidate_id String
177
+ reviewer_id String?
178
+ score Float?
179
+ feedback String?
180
+ scheduled_start_time DateTime? @default(now()) // Start Time to start the assessment
181
+ assessment_status AssessmentStatus @default(SCHEDULED)
182
+ created_at DateTime @default(now())
183
+ updated_at DateTime @updatedAt
184
+ created_by String
185
+ updated_by String
186
+ is_active Boolean @default(true)
165
187
  // Relations
166
- assessment_libarary AssessmentLibrary @relation(fields: [assessment_id], references: [id], onDelete: Cascade, onUpdate: Cascade)
167
- candidate User @relation("CandidateAssessments", fields: [candidate_id], references: [id], onDelete: Cascade, onUpdate: Cascade)
168
- reviewer User? @relation("ReviewerAssessments", fields: [reviewer_id], references: [id], onDelete: SetNull, onUpdate: Cascade)
169
- questions AssessmentQuestion[] @relation("AssessmentToAssessmentQuestion")
170
- candidateResponse CandidateQuestionResponse[]
171
- Panelist Panelist? @relation(fields: [panelistId], references: [id])
172
- panelistId String?
173
- User User? @relation(fields: [userId], references: [id])
174
- userId String?
175
-
176
- @@unique([assessment_id, candidate_id])
177
- @@index([assessment_id])
188
+ assessment_library AssessmentLibrary @relation(fields: [assessment_library_id], references: [id], onDelete: Cascade, onUpdate: Cascade)
189
+ candidate User @relation("CandidateAssessments", fields: [candidate_id], references: [id], onDelete: Cascade, onUpdate: Cascade)
190
+ reviewer User? @relation("ReviewerAssessments", fields: [reviewer_id], references: [id], onDelete: SetNull, onUpdate: Cascade)
191
+ questions AssessmentQuestion[] @relation("AssessmentToAssessmentQuestion")
192
+ candidateResponse CandidateQuestionResponse[]
193
+ panelistId String?
194
+ User User? @relation(fields: [userId], references: [id])
195
+ userId String?
196
+
197
+ @@unique([assessment_library_id, candidate_id])
198
+ @@index([assessment_library_id])
178
199
  @@index([candidate_id])
179
200
  }
180
201
 
@@ -209,7 +230,6 @@ model AssessmentLibrary {
209
230
  evaluation_Plans EvaluationPlan[]
210
231
 
211
232
  @@index([organisation_id])
212
- @@index([created_at])
213
233
  }
214
234
 
215
235
  /**
@@ -230,6 +250,48 @@ model AssessmentQuestion {
230
250
  @@id([assessment_id, question_id])
231
251
  }
232
252
 
253
+ enum AssignmentStatus {
254
+ AVAILABLE
255
+ SCHEDULED
256
+ CANCELLED
257
+ }
258
+
259
+ model Assignment {
260
+ id String @id @default(uuid())
261
+ candidate_id String
262
+ assignment_library_id String
263
+ reviewer_id String?
264
+ application_id String?
265
+ job_description_id String
266
+ organisation_id String
267
+ ongoing_evaluation_id String? @unique
268
+ overallScore Int?
269
+ feedback Json?
270
+ status AssignmentStatus @default(AVAILABLE)
271
+ cancel_reason String?
272
+ solution_url String?
273
+ scheduled_start_time DateTime?
274
+ scheduled_end_time DateTime?
275
+ created_at DateTime @default(now())
276
+ updated_at DateTime @updatedAt
277
+ created_by String
278
+ updated_by String
279
+ is_active Boolean @default(true)
280
+ // Relations
281
+ candidate User? @relation("CandidateAssignments", fields: [candidate_id], references: [id], onDelete: Cascade)
282
+ assignment_library AssignmentLibrary @relation(fields: [assignment_library_id], references: [id], onDelete: Cascade, onUpdate: Cascade)
283
+ reviewer User? @relation("AssignmentReviewer", fields: [reviewer_id], references: [id], onDelete: SetNull)
284
+ organisation Organisation @relation(fields: [organisation_id], references: [id], onDelete: Cascade, onUpdate: Cascade)
285
+ job_description JobDescription @relation(fields: [job_description_id], references: [id], onDelete: Cascade, onUpdate: Cascade)
286
+ application Application? @relation(fields: [application_id], references: [id], onDelete: Cascade, onUpdate: Cascade)
287
+ ongoing_evaluation OngoingEvaluation? @relation(fields: [ongoing_evaluation_id], references: [id], onDelete: Cascade, onUpdate: Cascade)
288
+
289
+ @@unique([candidate_id, ongoing_evaluation_id])
290
+ @@index([candidate_id])
291
+ @@index([reviewer_id])
292
+ @@index([job_description_id])
293
+ }
294
+
233
295
  model AssignmentLibrary {
234
296
  id String @id @default(uuid())
235
297
  deadline Int
@@ -246,9 +308,9 @@ model AssignmentLibrary {
246
308
  jobDescription JobDescription @relation(fields: [job_description_id], references: [id], onDelete: Cascade, onUpdate: Cascade)
247
309
  /// Back-relation: one-to-one from EvaluationPlan (FK lives on EvaluationPlan.assignment_library_id)
248
310
  evaluationPlan EvaluationPlan[]
311
+ assignments Assignment[]
249
312
 
250
313
  @@index([job_description_id])
251
- @@index([created_at])
252
314
  }
253
315
 
254
316
  enum JobType {
@@ -423,7 +485,6 @@ model EvaluationPlan {
423
485
  // Relations
424
486
  jobDescription JobDescription @relation(fields: [job_description_id], references: [id], onDelete: Cascade)
425
487
  questions Question[] // One evaluation plan → many questions
426
- panelists Panelist[]
427
488
  interviews Interview[]
428
489
  applications Application[]
429
490
  // New optional one-to-one relation with AssessmentLibrary
@@ -465,6 +526,7 @@ model FitCheck {
465
526
  id String @id @default(uuid())
466
527
  /// FK to organisations table
467
528
  organisation_id String?
529
+ candidate_id String?
468
530
  resume_id String
469
531
  job_description_id String
470
532
 
@@ -502,6 +564,7 @@ model FitCheck {
502
564
  updated_at DateTime @updatedAt
503
565
  /// Relations
504
566
  organisation Organisation? @relation(fields: [organisation_id], references: [id], onDelete: Cascade, onUpdate: Cascade)
567
+ candidate User? @relation(fields: [candidate_id], references: [id], onDelete: Cascade, onUpdate: Cascade)
505
568
  resume Resume @relation(fields: [resume_id], references: [id], onDelete: Cascade, onUpdate: Cascade)
506
569
  job_description JobDescription @relation(fields: [job_description_id], references: [id], onDelete: Cascade, onUpdate: Cascade)
507
570
  application Application?
@@ -528,23 +591,97 @@ model Google {
528
591
  is_active Boolean @default(true)
529
592
  }
530
593
 
531
- model IntermediateFeedback {
532
- id String @id @default(uuid())
533
- interview_id String
534
- overall_feedback_id String?
535
- intermediate_feedback Json
536
- order_no Int @default(autoincrement())
537
- created_at DateTime @default(now())
538
- updated_at DateTime @updatedAt
539
- created_by String
540
- updated_by String
541
- is_active Boolean @default(true)
542
- // Relations
543
- interview Interview @relation(fields: [interview_id], references: [id], onDelete: Cascade, onUpdate: Cascade)
544
- OverallFeedback OverallFeedback? @relation(fields: [overall_feedback_id], references: [id], onDelete: SetNull, onUpdate: Cascade)
545
- transcripts Transcript[]
594
+ enum IntegrationProvider {
595
+ NAUKRI
596
+ ZOHO_RECRUIT
597
+ }
546
598
 
547
- @@index([interview_id])
599
+ enum IntegrationAuthType {
600
+ OAUTH2
601
+ API_KEY
602
+ }
603
+
604
+ enum SyncDirection {
605
+ PUSH
606
+ PULL
607
+ BIDIRECTIONAL
608
+ }
609
+
610
+ enum SyncEntityType {
611
+ CANDIDATE
612
+ JOB_OPENING
613
+ INTERVIEW
614
+ APPLICATION
615
+ }
616
+
617
+ enum SyncStatus {
618
+ SYNCED
619
+ PENDING
620
+ FAILED
621
+ }
622
+
623
+ model IntegrationCredential {
624
+ id String @id @default(uuid())
625
+ organisation_id String?
626
+ provider IntegrationProvider
627
+ auth_type IntegrationAuthType
628
+ access_token String?
629
+ refresh_token String?
630
+ token_expires_at DateTime?
631
+ api_key String?
632
+ api_secret String?
633
+ metadata Json @default("{}")
634
+ is_active Boolean @default(true)
635
+
636
+ organisation Organisation? @relation(fields: [organisation_id], references: [id], onDelete: Cascade)
637
+
638
+ created_at DateTime @default(now())
639
+ updated_at DateTime @updatedAt
640
+ created_by String
641
+ updated_by String
642
+
643
+ @@unique([organisation_id, provider])
644
+ @@index([provider])
645
+ }
646
+
647
+ model IntegrationJobSync {
648
+ id String @id @default(uuid())
649
+ job_description_id String
650
+ provider IntegrationProvider
651
+ external_id String?
652
+ sync_enabled Boolean @default(true)
653
+ last_synced_at DateTime?
654
+ sync_direction SyncDirection @default(PUSH)
655
+ metadata Json @default("{}")
656
+
657
+ job_description JobDescription @relation(fields: [job_description_id], references: [id], onDelete: Cascade)
658
+
659
+ created_at DateTime @default(now())
660
+ updated_at DateTime @updatedAt
661
+
662
+ @@unique([job_description_id, provider])
663
+ @@index([provider])
664
+ }
665
+
666
+ model ZohoSyncMapping {
667
+ id String @id @default(uuid())
668
+ organisation_id String
669
+ entity_type SyncEntityType
670
+ treadspace_id String
671
+ zoho_module String
672
+ zoho_record_id String
673
+ last_synced_at DateTime @default(now())
674
+ sync_status SyncStatus @default(PENDING)
675
+ error_message String?
676
+
677
+ organisation Organisation @relation(fields: [organisation_id], references: [id], onDelete: Cascade)
678
+
679
+ created_at DateTime @default(now())
680
+ updated_at DateTime @updatedAt
681
+
682
+ @@unique([organisation_id, entity_type, treadspace_id])
683
+ @@index([zoho_record_id])
684
+ @@index([sync_status])
548
685
  }
549
686
 
550
687
  enum InterviewStatus {
@@ -565,88 +702,62 @@ enum InterviewFeedback {
565
702
  }
566
703
 
567
704
  model Interview {
568
- id String @id @default(uuid())
705
+ id String @id @default(uuid())
706
+ /// Foreign keys
707
+ organisation_id String
569
708
  candidate_id String
570
709
  interviewer_id String?
571
710
  evaluation_plan_id String
572
711
  application_id String?
573
712
  resume_id String
574
713
  job_description_id String
575
- organisation_id String
714
+ /// Data
576
715
  room_name String?
577
716
  interview_summary String[]
578
- ai_interview_feedback InterviewFeedback?
579
- interview_feedback InterviewFeedback?
580
- interview_rating Float? // Overall rating out of 100 based on evaluation
581
717
  scheduled_start_time DateTime?
582
718
  scheduled_end_time DateTime?
583
719
  actual_start_time DateTime?
584
720
  actual_end_time DateTime?
585
721
  recording_url String?
586
- interview_status InterviewStatus @default(SCHEDULED)
722
+ interview_status InterviewStatus @default(SCHEDULED)
587
723
  google_event_id String?
588
- created_at DateTime @default(now())
589
- updated_at DateTime @updatedAt
724
+ /// Old Feedback fields will be deprecated soon
725
+ ai_interview_feedback InterviewFeedback?
726
+ interview_feedback InterviewFeedback?
727
+ overall_feedback String?
728
+ interview_rating Float? // Overall rating out of 100 based on evaluation
729
+ /// New Feedback fields
730
+ ai_feedback Json?
731
+ human_feedback Json?
732
+ interviewer_feedback Json?
733
+ section_feedback Json[]
734
+ interview_preparation Json?
735
+ /// Audit fields
736
+ created_at DateTime @default(now())
737
+ updated_at DateTime @updatedAt
590
738
  created_by String
591
739
  updated_by String
592
- is_active Boolean @default(true)
740
+ is_active Boolean @default(true)
593
741
  // Relations
594
- candidate User? @relation("CandidateInterviews", fields: [candidate_id], references: [id], onDelete: SetNull)
595
- interviewer User? @relation("InterviewerInterviews", fields: [interviewer_id], references: [id], onDelete: SetNull)
596
- organisation Organisation @relation(fields: [organisation_id], references: [id], onDelete: Cascade, onUpdate: Cascade)
597
- job_description JobDescription @relation(fields: [job_description_id], references: [id], onDelete: Cascade, onUpdate: Cascade)
598
- resume Resume @relation(fields: [resume_id], references: [id], onDelete: Cascade, onUpdate: Cascade)
599
- evaluation_plan EvaluationPlan? @relation(fields: [evaluation_plan_id], references: [id], onDelete: SetNull, onUpdate: Cascade)
600
- application Application? @relation(fields: [application_id], references: [id], onDelete: SetNull, onUpdate: Cascade)
742
+ candidate User? @relation("CandidateInterviews", fields: [candidate_id], references: [id], onDelete: SetNull)
743
+ interviewer User? @relation("InterviewerInterviews", fields: [interviewer_id], references: [id], onDelete: SetNull)
744
+ organisation Organisation @relation(fields: [organisation_id], references: [id], onDelete: Cascade, onUpdate: Cascade)
745
+ job_description JobDescription @relation(fields: [job_description_id], references: [id], onDelete: Cascade, onUpdate: Cascade)
746
+ resume Resume @relation(fields: [resume_id], references: [id], onDelete: Cascade, onUpdate: Cascade)
747
+ evaluation_plan EvaluationPlan? @relation(fields: [evaluation_plan_id], references: [id], onDelete: SetNull, onUpdate: Cascade)
748
+ application Application? @relation(fields: [application_id], references: [id], onDelete: SetNull, onUpdate: Cascade)
601
749
  ongoing_evaluation OngoingEvaluation?
602
- intermediateFeedbacks IntermediateFeedback[]
603
750
  transcripts Transcript[]
604
751
  suggestions Suggestion[]
605
- overallFeedback OverallFeedback[]
606
752
  feedback Feedback[]
607
753
  interviewNotes InterviewNotes[]
608
754
 
609
755
  @@unique([interviewer_id, candidate_id, evaluation_plan_id])
610
- @@index([application_id])
611
756
  @@index([candidate_id])
612
757
  @@index([interviewer_id])
613
758
  @@index([job_description_id])
614
759
  }
615
760
 
616
- /// Defines the category or purpose of the interview, suitable for any job role.
617
- enum InterviewCategory {
618
- SCREENING // Initial screening interview
619
- TECHNICAL // Skill or role-specific interview
620
- BEHAVIORAL // Behavioral or situational round
621
- CASE_STUDY // Case-based or analytical round
622
- MANAGERIAL // Leadership or management-focused
623
- CULTURAL_FIT // Checks alignment with company culture
624
- FINAL_DISCUSSION // Final HR or offer discussion
625
- GENERAL // Generic or flexible-purpose interview
626
- }
627
-
628
- /// Represents a reusable interview template applicable to any job type.
629
- model InterviewLibrary {
630
- id String @id @default(uuid())
631
- title String
632
- description String
633
- organisation_id String
634
- category InterviewCategory
635
- evaluation_type EvaluationType
636
- duration Float
637
- passing_marks Float
638
- is_active Boolean @default(true)
639
- created_by String
640
- updated_by String
641
- created_at DateTime @default(now())
642
- updated_at DateTime @updatedAt
643
- organisation Organisation @relation(fields: [organisation_id], references: [id], onDelete: Cascade, onUpdate: Cascade)
644
-
645
- @@index([organisation_id])
646
- @@index([category])
647
- @@index([created_at])
648
- }
649
-
650
761
  model InterviewNotes {
651
762
  id String @id @default(uuid())
652
763
  interview_id String
@@ -695,6 +806,7 @@ model JobDescription {
695
806
  organisation Organisation @relation(fields: [organisation_id], references: [id], onDelete: Cascade, onUpdate: Cascade)
696
807
  applications Application[]
697
808
  interviews Interview[]
809
+ assignments Assignment[]
698
810
  fit_check FitCheck[] // one-to-many link
699
811
  job_description_data JobDescriptionData[] // one-to-many link
700
812
  evaluationPlan EvaluationPlan[] // relation to evaluation methods
@@ -706,6 +818,7 @@ model JobDescription {
706
818
  hiring_manager User? @relation("HiringManager", fields: [hiring_manager_id], references: [id], onDelete: SetNull, onUpdate: Cascade)
707
819
  recruiters User[]
708
820
  transcripts Transcript[]
821
+ integration_job_syncs IntegrationJobSync[]
709
822
 
710
823
  @@index([organisation_id])
711
824
  @@index([hiring_manager_id])
@@ -725,7 +838,6 @@ model JobDescriptionData {
725
838
  jobDescription JobDescription @relation(fields: [job_description_id], references: [id], onDelete: Cascade, onUpdate: Cascade)
726
839
 
727
840
  @@unique([job_description_id, key])
728
- @@index([created_at])
729
841
  }
730
842
 
731
843
  model Message {
@@ -780,6 +892,7 @@ model OngoingEvaluation {
780
892
  job_description_id String
781
893
  evaluation_plan_id String
782
894
  interview_id String? @unique
895
+ assignment_id String? @unique
783
896
  status OngoingEvaluationStatus?
784
897
  state OngoingEvaluationState? @default(NOT_STARTED)
785
898
  round_status OngoingEvaluationRoundStatus? @default(NOT_SCHEDULED)
@@ -792,6 +905,7 @@ model OngoingEvaluation {
792
905
  organisation Organisation? @relation(fields: [organisation_id], references: [id], onDelete: Cascade, onUpdate: Cascade)
793
906
  evaluation_plan EvaluationPlan @relation(fields: [evaluation_plan_id], references: [id], onDelete: Cascade, onUpdate: Cascade)
794
907
  interview Interview? @relation(fields: [interview_id], references: [id], onDelete: SetNull, onUpdate: Cascade)
908
+ assignment Assignment?
795
909
  created_at DateTime @default(now())
796
910
  updated_at DateTime @updatedAt
797
911
  created_by String
@@ -835,93 +949,33 @@ model Organisation {
835
949
  address String
836
950
  company_values Json[]
837
951
 
838
- interviewers User[]
839
- created_at DateTime @default(now())
840
- updated_at DateTime @updatedAt
841
- created_by String
842
- updated_by String
843
- is_active Boolean @default(true)
844
- alias String? @unique
845
- logo String?
846
- applications Application[]
847
- user_roles UserRole[]
848
- job_descriptions JobDescription[]
849
- assessment_library AssessmentLibrary[]
850
- assignment_library AssignmentLibrary[]
851
- interview_library InterviewLibrary[]
852
- interviews Interview[]
853
- fit_check FitCheck[] // one-to-many link
854
- resumes Resume[] // one-to-many link
855
- panelists Panelist[] // one-to-many link
856
- approvals Approval[] // one-to-many link
857
- suggestions Suggestion[]
858
- ongoing_evaluations OngoingEvaluation[] // optional one-to-many
859
- actions Action[]
952
+ interviewers User[]
953
+ created_at DateTime @default(now())
954
+ updated_at DateTime @updatedAt
955
+ created_by String
956
+ updated_by String
957
+ is_active Boolean @default(true)
958
+ alias String? @unique
959
+ logo String?
960
+ applications Application[]
961
+ user_roles UserRole[]
962
+ job_descriptions JobDescription[]
963
+ assessment_library AssessmentLibrary[]
964
+ assignment_library AssignmentLibrary[]
965
+ interviews Interview[]
966
+ assignments Assignment[]
967
+ fit_check FitCheck[] // one-to-many link
968
+ resumes Resume[] // one-to-many link
969
+ approvals Approval[] // one-to-many link
970
+ suggestions Suggestion[]
971
+ ongoing_evaluations OngoingEvaluation[] // optional one-to-many
972
+ actions Action[]
973
+ integration_credentials IntegrationCredential[]
974
+ zoho_sync_mappings ZohoSyncMapping[]
860
975
 
861
976
  @@index([name])
862
977
  }
863
978
 
864
- enum FeedbackType {
865
- HUMAN
866
- AI
867
- }
868
-
869
- enum OverallRecommendation {
870
- StrongHire
871
- Hire
872
- LeaningHire
873
- NoHire
874
- StrongNoHire
875
- }
876
-
877
- model OverallFeedback {
878
- id String @id @default(uuid())
879
- interview_id String
880
- interviewer_id String? // 👈 optional field
881
- feedback_type FeedbackType
882
- overall_score Float
883
- overall_recommendation OverallRecommendation
884
- overall_feedback Json
885
- created_at DateTime @default(now())
886
- updated_at DateTime @updatedAt
887
- created_by String
888
- updated_by String
889
- is_active Boolean @default(true)
890
- // Relations
891
- interview Interview @relation(fields: [interview_id], references: [id], onDelete: Cascade, onUpdate: Cascade)
892
- interviewer Panelist? @relation(fields: [interviewer_id], references: [id], onDelete: SetNull, onUpdate: Cascade)
893
- intermediateFeedbacks IntermediateFeedback[] // 👈 one-to-many relation added here
894
-
895
- @@unique([interview_id, interviewer_id]) // 👈 updated uniqueness logic
896
- @@index([interview_id])
897
- @@index([interviewer_id])
898
- }
899
-
900
- model Panelist {
901
- id String @id @default(uuid())
902
- name String
903
- designation String
904
- experience String // e.g. "10+", keeping as String for flexibility
905
- expertise String // e.g. "Product Strategy, Figma..."
906
- suited_interview String // e.g. "Consulting, Customer understanding..."
907
- industry String // e.g. "Healthcare, Fintech"
908
- special_areas String? // Optional field
909
- organisation_id String
910
- user_id String @unique
911
-
912
- user User @relation(fields: [user_id], references: [id])
913
- organisation Organisation @relation(fields: [organisation_id], references: [id])
914
- evaluationPlans EvaluationPlan[]
915
- overallFeedbacks OverallFeedback[]
916
- created_at DateTime @default(now())
917
- updated_at DateTime @updatedAt
918
- created_by String
919
- updated_by String
920
- is_active Boolean @default(true)
921
-
922
- assessments Assessment[]
923
- }
924
-
925
979
  model Permission {
926
980
  id String @id @default(uuid())
927
981
  permissions String[] @default([])
@@ -1093,11 +1147,10 @@ model Suggestion {
1093
1147
  organisation Organisation @relation(fields: [organisation_id], references: [id], onDelete: Cascade)
1094
1148
 
1095
1149
  @@index([interview_id])
1096
- @@index([transcript_id])
1097
1150
  }
1098
1151
 
1099
1152
  model Transcript {
1100
- id String @id @default(uuid())
1153
+ id String @id @default(uuid())
1101
1154
  interview_id String?
1102
1155
  suggestion_id String?
1103
1156
  intermediate_feedback_id String?
@@ -1106,17 +1159,16 @@ model Transcript {
1106
1159
  candidate_timestamp DateTime?
1107
1160
  interviewer String
1108
1161
  candidate String
1109
- order_no Int @default(autoincrement())
1110
- created_at DateTime @default(now())
1111
- updated_at DateTime @updatedAt
1162
+ order_no Int @default(autoincrement())
1163
+ created_at DateTime @default(now())
1164
+ updated_at DateTime @updatedAt
1112
1165
  created_by String
1113
1166
  updated_by String
1114
- is_active Boolean @default(true)
1167
+ is_active Boolean @default(true)
1115
1168
  // Relations
1116
- interview Interview? @relation(fields: [interview_id], references: [id], onDelete: SetNull, onUpdate: SetNull)
1117
- suggestion Suggestion? @relation(fields: [suggestion_id], references: [id], onDelete: SetNull)
1118
- intermediate_feedback IntermediateFeedback? @relation(fields: [intermediate_feedback_id], references: [id], onDelete: SetNull)
1119
- job_description JobDescription? @relation(fields: [job_description_id], references: [id], onDelete: SetNull, onUpdate: Cascade)
1169
+ interview Interview? @relation(fields: [interview_id], references: [id], onDelete: SetNull, onUpdate: SetNull)
1170
+ suggestion Suggestion? @relation(fields: [suggestion_id], references: [id], onDelete: SetNull)
1171
+ job_description JobDescription? @relation(fields: [job_description_id], references: [id], onDelete: SetNull, onUpdate: Cascade)
1120
1172
 
1121
1173
  @@unique([interview_id, order_no])
1122
1174
  @@index([interview_id])
@@ -1154,7 +1206,6 @@ model User {
1154
1206
  job_description JobDescription[]
1155
1207
  hiring_manager_job_descriptions JobDescription[] @relation("HiringManager")
1156
1208
  approvals Approval[]
1157
- panelist Panelist?
1158
1209
  sent_messages Message[] @relation("Sent Messages")
1159
1210
  received_messages Message[] @relation("Received Messages")
1160
1211
  profile_created Boolean
@@ -1165,12 +1216,16 @@ model User {
1165
1216
  assessment_results Assessment[]
1166
1217
  candidate_assessments Assessment[] @relation("CandidateAssessments")
1167
1218
  reviewer_assessments Assessment[] @relation("ReviewerAssessments")
1219
+ candidate_assignments Assignment[] @relation("CandidateAssignments")
1220
+ reviewer_assignments Assignment[] @relation("AssignmentReviewer")
1168
1221
  candidateResponses CandidateQuestionResponse[]
1169
1222
  questions Question[]
1170
1223
  ongoing_evaluations OngoingEvaluation[] // optional one-to-many
1224
+ actor_activity_logs ActivityLog[] @relation("ActorActivityLogs")
1171
1225
  actions Action[]
1172
1226
  calendly Calendly?
1173
1227
  google Google?
1228
+ fitChecks FitCheck[]
1174
1229
 
1175
1230
  name String?
1176
1231
  phone String?