@adaptware/eagles-db 0.1.61 → 0.1.67

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.
@@ -1,5 +1,5 @@
1
1
  {
2
- "name": "prisma-client-121e3a516f410ee79df521c6b91777aec162855656c96d09b350fff854f75186",
2
+ "name": "prisma-client-5297fc472d2b9310debb93b931d8e67f63913d7d036c79b4a032d9bd6e5efdf5",
3
3
  "main": "index.js",
4
4
  "types": "index.d.ts",
5
5
  "browser": "index-browser.js",
@@ -1,10 +1,13 @@
1
1
  model CandidateQuestionResponse {
2
2
  id String @id @default(uuid())
3
+ //foreign keys
3
4
  question_id String
4
5
  candidate_id String
5
6
  assessment_id String
7
+ //data
6
8
  response String
7
9
  score Float?
10
+ /// Audit fields
8
11
  created_by String
9
12
  updated_by String
10
13
  created_at DateTime @default(now())
@@ -15,8 +18,8 @@ model CandidateQuestionResponse {
15
18
  assessment Assessment @relation(fields: [assessment_id], references: [id], onDelete: Cascade)
16
19
  candidate User @relation(fields: [candidate_id], references: [id], onDelete: Cascade, onUpdate: Cascade)
17
20
 
21
+ @@unique([assessment_id, question_id, candidate_id])
18
22
  @@index([candidate_id])
19
- @@index([question_id])
20
23
  @@index([assessment_id])
21
24
  }
22
25
 
@@ -159,26 +162,21 @@ model Approval {
159
162
  organisation Organisation @relation(fields: [organisaton_id], references: [id], onDelete: Cascade, onUpdate: Cascade)
160
163
  }
161
164
 
162
- enum AssessmentStatus {
163
- SCHEDULED // Assessment has been created and scheduled
164
- IN_PROGRESS // Candidate is currently giving the assessment
165
- COMPLETED // Assessment completed by candidate
166
- CANCELLED // Assessment cancelled by admin or system
167
- RESCHEDULED // Assessment rescheduled to a new time
168
- NO_SHOW // Candidate failed to take the assessment
169
- EVALUATION_PENDING // Waiting for manual/AI review of answers
170
- EVALUATED // Final evaluation completed and locked
171
- }
172
-
173
165
  model Assessment {
174
166
  id String @id @default(uuid())
167
+ //foreign keys
168
+ organisation_id String?
175
169
  assessment_library_id String
176
170
  candidate_id String
177
171
  reviewer_id String?
172
+ //data
178
173
  score Float?
179
- feedback String?
180
- scheduled_start_time DateTime? @default(now()) // Start Time to start the assessment
181
- assessment_status AssessmentStatus @default(SCHEDULED)
174
+ feedback Json?
175
+ scheduled_start_time DateTime?
176
+ scheduled_end_time DateTime?
177
+ actual_start_time DateTime?
178
+ actual_end_time DateTime?
179
+ /// Audit fields
182
180
  created_at DateTime @default(now())
183
181
  updated_at DateTime @updatedAt
184
182
  created_by String
@@ -190,9 +188,10 @@ model Assessment {
190
188
  reviewer User? @relation("ReviewerAssessments", fields: [reviewer_id], references: [id], onDelete: SetNull, onUpdate: Cascade)
191
189
  questions AssessmentQuestion[] @relation("AssessmentToAssessmentQuestion")
192
190
  candidateResponse CandidateQuestionResponse[]
193
- panelistId String?
191
+ organisation Organisation? @relation(fields: [organisation_id], references: [id], onDelete: Cascade, onUpdate: Cascade)
194
192
  User User? @relation(fields: [userId], references: [id])
195
193
  userId String?
194
+ ongoingEvaluation OngoingEvaluation?
196
195
 
197
196
  @@unique([assessment_library_id, candidate_id])
198
197
  @@index([assessment_library_id])
@@ -270,6 +269,7 @@ model Assignment {
270
269
  status AssignmentStatus @default(AVAILABLE)
271
270
  cancel_reason String?
272
271
  solution_url String?
272
+ zip_url String?
273
273
  scheduled_start_time DateTime?
274
274
  scheduled_end_time DateTime?
275
275
  created_at DateTime @default(now())
@@ -594,6 +594,7 @@ model Google {
594
594
  enum IntegrationProvider {
595
595
  NAUKRI
596
596
  ZOHO_RECRUIT
597
+ LINKEDIN
597
598
  }
598
599
 
599
600
  enum IntegrationAuthType {
@@ -733,25 +734,27 @@ model Interview {
733
734
  section_feedback Json[]
734
735
  interview_preparation Json?
735
736
  final_feedback Json?
737
+
736
738
  /// Audit fields
737
- created_at DateTime @default(now())
738
- updated_at DateTime @updatedAt
739
- created_by String
740
- updated_by String
741
- is_active Boolean @default(true)
739
+ created_at DateTime @default(now())
740
+ updated_at DateTime @updatedAt
741
+ created_by String
742
+ updated_by String
743
+ is_active Boolean @default(true)
742
744
  // Relations
743
- candidate User? @relation("CandidateInterviews", fields: [candidate_id], references: [id], onDelete: SetNull)
744
- interviewer User? @relation("InterviewerInterviews", fields: [interviewer_id], references: [id], onDelete: SetNull)
745
- organisation Organisation @relation(fields: [organisation_id], references: [id], onDelete: Cascade, onUpdate: Cascade)
746
- job_description JobDescription @relation(fields: [job_description_id], references: [id], onDelete: Cascade, onUpdate: Cascade)
747
- resume Resume @relation(fields: [resume_id], references: [id], onDelete: Cascade, onUpdate: Cascade)
748
- evaluation_plan EvaluationPlan? @relation(fields: [evaluation_plan_id], references: [id], onDelete: SetNull, onUpdate: Cascade)
749
- application Application? @relation(fields: [application_id], references: [id], onDelete: SetNull, onUpdate: Cascade)
750
- ongoing_evaluation OngoingEvaluation?
751
- transcripts Transcript[]
752
- suggestions Suggestion[]
753
- feedback Feedback[]
754
- interviewNotes InterviewNotes[]
745
+ candidate User? @relation("CandidateInterviews", fields: [candidate_id], references: [id], onDelete: SetNull)
746
+ interviewer User? @relation("InterviewerInterviews", fields: [interviewer_id], references: [id], onDelete: SetNull)
747
+ organisation Organisation @relation(fields: [organisation_id], references: [id], onDelete: Cascade, onUpdate: Cascade)
748
+ job_description JobDescription @relation(fields: [job_description_id], references: [id], onDelete: Cascade, onUpdate: Cascade)
749
+ resume Resume @relation(fields: [resume_id], references: [id], onDelete: Cascade, onUpdate: Cascade)
750
+ evaluation_plan EvaluationPlan? @relation(fields: [evaluation_plan_id], references: [id], onDelete: SetNull, onUpdate: Cascade)
751
+ application Application? @relation(fields: [application_id], references: [id], onDelete: SetNull, onUpdate: Cascade)
752
+ ongoing_evaluation OngoingEvaluation?
753
+ transcripts Transcript[]
754
+ suggestions Suggestion[]
755
+ feedback Feedback[]
756
+ interviewNotes InterviewNotes[]
757
+ liveAnalysis LiveAnalysis[]
755
758
 
756
759
  @@unique([interviewer_id, candidate_id, evaluation_plan_id])
757
760
  @@index([candidate_id])
@@ -804,6 +807,8 @@ model JobDescription {
804
807
  updated_by String
805
808
  is_active Boolean @default(true)
806
809
  openings Int @default(1)
810
+ job_profile_id String?
811
+ job_profile JobProfile? @relation(fields: [job_profile_id], references: [id], onDelete: SetNull, onUpdate: Cascade)
807
812
  organisation Organisation @relation(fields: [organisation_id], references: [id], onDelete: Cascade, onUpdate: Cascade)
808
813
  applications Application[]
809
814
  interviews Interview[]
@@ -823,6 +828,7 @@ model JobDescription {
823
828
 
824
829
  @@index([organisation_id])
825
830
  @@index([hiring_manager_id])
831
+ @@index([job_profile_id])
826
832
  }
827
833
 
828
834
  model JobDescriptionData {
@@ -841,6 +847,75 @@ model JobDescriptionData {
841
847
  @@unique([job_description_id, key])
842
848
  }
843
849
 
850
+ enum JobProfileStatus {
851
+ DRAFT
852
+ INTAKE_SENT
853
+ INTAKE_IN_PROGRESS
854
+ COMPLETE
855
+ }
856
+
857
+ model JobProfile {
858
+ id String @id @default(uuid())
859
+ organisation_id String
860
+ created_by String
861
+ assigned_to String?
862
+ status JobProfileStatus @default(DRAFT)
863
+
864
+ // Basics
865
+ title String?
866
+ role_type String?
867
+ work_arrangement String?
868
+ location String?
869
+ experience_min String?
870
+ reporting String?
871
+ comp_range String?
872
+ comp_benchmark String?
873
+
874
+ // Requirements (structured from AI conversation)
875
+ responsibilities Json?
876
+ deliverables Json?
877
+ must_have_skills Json?
878
+ nice_to_have_skills Json?
879
+ dealbreakers Json?
880
+ culture Json?
881
+ success_metrics Json?
882
+
883
+ // Competencies
884
+ competencies Json?
885
+
886
+ // Conversation state
887
+ conversation_history Json?
888
+ current_phase String?
889
+ orion_execution_id String?
890
+
891
+ // Audit
892
+ created_at DateTime @default(now())
893
+ updated_at DateTime @updatedAt
894
+ is_active Boolean @default(true)
895
+
896
+ // Relations
897
+ organisation Organisation @relation(fields: [organisation_id], references: [id], onDelete: Cascade, onUpdate: Cascade)
898
+ creator User @relation("ProfileCreator", fields: [created_by], references: [id], onDelete: Restrict, onUpdate: Cascade)
899
+ assignee User? @relation("ProfileAssignee", fields: [assigned_to], references: [id], onDelete: SetNull, onUpdate: Cascade)
900
+ job_descriptions JobDescription[]
901
+
902
+ @@index([organisation_id])
903
+ @@index([assigned_to])
904
+ @@index([created_by])
905
+ }
906
+
907
+ model LiveAnalysis {
908
+ id String @id @default(uuid())
909
+ interview_id String
910
+ analysis Json
911
+ created_at DateTime @default(now())
912
+ updated_at DateTime @updatedAt
913
+ created_by String
914
+ updated_by String
915
+ is_active Boolean @default(true)
916
+ interview Interview @relation(fields: [interview_id], references: [id])
917
+ }
918
+
844
919
  model Message {
845
920
  id String @id @default(uuid())
846
921
  sender_id String
@@ -894,6 +969,7 @@ model OngoingEvaluation {
894
969
  evaluation_plan_id String
895
970
  interview_id String? @unique
896
971
  assignment_id String? @unique
972
+ assessment_id String? @unique
897
973
  status OngoingEvaluationStatus?
898
974
  state OngoingEvaluationState? @default(NOT_STARTED)
899
975
  round_status OngoingEvaluationRoundStatus? @default(NOT_SCHEDULED)
@@ -907,6 +983,7 @@ model OngoingEvaluation {
907
983
  evaluation_plan EvaluationPlan @relation(fields: [evaluation_plan_id], references: [id], onDelete: Cascade, onUpdate: Cascade)
908
984
  interview Interview? @relation(fields: [interview_id], references: [id], onDelete: SetNull, onUpdate: Cascade)
909
985
  assignment Assignment?
986
+ assessment Assessment? @relation(fields: [assessment_id], references: [id], onDelete: SetNull)
910
987
  created_at DateTime @default(now())
911
988
  updated_at DateTime @updatedAt
912
989
  created_by String
@@ -961,6 +1038,7 @@ model Organisation {
961
1038
  applications Application[]
962
1039
  user_roles UserRole[]
963
1040
  job_descriptions JobDescription[]
1041
+ job_profiles JobProfile[]
964
1042
  assessment_library AssessmentLibrary[]
965
1043
  assignment_library AssignmentLibrary[]
966
1044
  interviews Interview[]
@@ -973,6 +1051,7 @@ model Organisation {
973
1051
  actions Action[]
974
1052
  integration_credentials IntegrationCredential[]
975
1053
  zoho_sync_mappings ZohoSyncMapping[]
1054
+ assessments Assessment[]
976
1055
 
977
1056
  @@index([name])
978
1057
  }
@@ -1227,6 +1306,8 @@ model User {
1227
1306
  calendly Calendly?
1228
1307
  google Google?
1229
1308
  fitChecks FitCheck[]
1309
+ created_job_profiles JobProfile[] @relation("ProfileCreator")
1310
+ assigned_job_profiles JobProfile[] @relation("ProfileAssignee")
1230
1311
 
1231
1312
  name String?
1232
1313
  phone String?
package/client/wasm.js CHANGED
@@ -209,19 +209,21 @@ exports.Prisma.ApprovalScalarFieldEnum = {
209
209
 
210
210
  exports.Prisma.AssessmentScalarFieldEnum = {
211
211
  id: 'id',
212
+ organisation_id: 'organisation_id',
212
213
  assessment_library_id: 'assessment_library_id',
213
214
  candidate_id: 'candidate_id',
214
215
  reviewer_id: 'reviewer_id',
215
216
  score: 'score',
216
217
  feedback: 'feedback',
217
218
  scheduled_start_time: 'scheduled_start_time',
218
- assessment_status: 'assessment_status',
219
+ scheduled_end_time: 'scheduled_end_time',
220
+ actual_start_time: 'actual_start_time',
221
+ actual_end_time: 'actual_end_time',
219
222
  created_at: 'created_at',
220
223
  updated_at: 'updated_at',
221
224
  created_by: 'created_by',
222
225
  updated_by: 'updated_by',
223
226
  is_active: 'is_active',
224
- panelistId: 'panelistId',
225
227
  userId: 'userId'
226
228
  };
227
229
 
@@ -264,6 +266,7 @@ exports.Prisma.AssignmentScalarFieldEnum = {
264
266
  status: 'status',
265
267
  cancel_reason: 'cancel_reason',
266
268
  solution_url: 'solution_url',
269
+ zip_url: 'zip_url',
267
270
  scheduled_start_time: 'scheduled_start_time',
268
271
  scheduled_end_time: 'scheduled_end_time',
269
272
  created_at: 'created_at',
@@ -553,7 +556,8 @@ exports.Prisma.JobDescriptionScalarFieldEnum = {
553
556
  created_by: 'created_by',
554
557
  updated_by: 'updated_by',
555
558
  is_active: 'is_active',
556
- openings: 'openings'
559
+ openings: 'openings',
560
+ job_profile_id: 'job_profile_id'
557
561
  };
558
562
 
559
563
  exports.Prisma.JobDescriptionDataScalarFieldEnum = {
@@ -568,6 +572,47 @@ exports.Prisma.JobDescriptionDataScalarFieldEnum = {
568
572
  is_active: 'is_active'
569
573
  };
570
574
 
575
+ exports.Prisma.JobProfileScalarFieldEnum = {
576
+ id: 'id',
577
+ organisation_id: 'organisation_id',
578
+ created_by: 'created_by',
579
+ assigned_to: 'assigned_to',
580
+ status: 'status',
581
+ title: 'title',
582
+ role_type: 'role_type',
583
+ work_arrangement: 'work_arrangement',
584
+ location: 'location',
585
+ experience_min: 'experience_min',
586
+ reporting: 'reporting',
587
+ comp_range: 'comp_range',
588
+ comp_benchmark: 'comp_benchmark',
589
+ responsibilities: 'responsibilities',
590
+ deliverables: 'deliverables',
591
+ must_have_skills: 'must_have_skills',
592
+ nice_to_have_skills: 'nice_to_have_skills',
593
+ dealbreakers: 'dealbreakers',
594
+ culture: 'culture',
595
+ success_metrics: 'success_metrics',
596
+ competencies: 'competencies',
597
+ conversation_history: 'conversation_history',
598
+ current_phase: 'current_phase',
599
+ orion_execution_id: 'orion_execution_id',
600
+ created_at: 'created_at',
601
+ updated_at: 'updated_at',
602
+ is_active: 'is_active'
603
+ };
604
+
605
+ exports.Prisma.LiveAnalysisScalarFieldEnum = {
606
+ id: 'id',
607
+ interview_id: 'interview_id',
608
+ analysis: 'analysis',
609
+ created_at: 'created_at',
610
+ updated_at: 'updated_at',
611
+ created_by: 'created_by',
612
+ updated_by: 'updated_by',
613
+ is_active: 'is_active'
614
+ };
615
+
571
616
  exports.Prisma.MessageScalarFieldEnum = {
572
617
  id: 'id',
573
618
  sender_id: 'sender_id',
@@ -590,6 +635,7 @@ exports.Prisma.OngoingEvaluationScalarFieldEnum = {
590
635
  evaluation_plan_id: 'evaluation_plan_id',
591
636
  interview_id: 'interview_id',
592
637
  assignment_id: 'assignment_id',
638
+ assessment_id: 'assessment_id',
593
639
  status: 'status',
594
640
  state: 'state',
595
641
  round_status: 'round_status',
@@ -849,17 +895,6 @@ exports.FitCheckStatus = exports.$Enums.FitCheckStatus = {
849
895
  NOT_RECOMMENDED: 'NOT_RECOMMENDED'
850
896
  };
851
897
 
852
- exports.AssessmentStatus = exports.$Enums.AssessmentStatus = {
853
- SCHEDULED: 'SCHEDULED',
854
- IN_PROGRESS: 'IN_PROGRESS',
855
- COMPLETED: 'COMPLETED',
856
- CANCELLED: 'CANCELLED',
857
- RESCHEDULED: 'RESCHEDULED',
858
- NO_SHOW: 'NO_SHOW',
859
- EVALUATION_PENDING: 'EVALUATION_PENDING',
860
- EVALUATED: 'EVALUATED'
861
- };
862
-
863
898
  exports.AssessmentCategory = exports.$Enums.AssessmentCategory = {
864
899
  MCQ: 'MCQ',
865
900
  COMPETENCY: 'COMPETENCY',
@@ -923,7 +958,8 @@ exports.EvaluationPlanType = exports.$Enums.EvaluationPlanType = {
923
958
 
924
959
  exports.IntegrationProvider = exports.$Enums.IntegrationProvider = {
925
960
  NAUKRI: 'NAUKRI',
926
- ZOHO_RECRUIT: 'ZOHO_RECRUIT'
961
+ ZOHO_RECRUIT: 'ZOHO_RECRUIT',
962
+ LINKEDIN: 'LINKEDIN'
927
963
  };
928
964
 
929
965
  exports.IntegrationAuthType = exports.$Enums.IntegrationAuthType = {
@@ -975,6 +1011,13 @@ exports.JobDescriptionStatus = exports.$Enums.JobDescriptionStatus = {
975
1011
  CLOSED: 'CLOSED'
976
1012
  };
977
1013
 
1014
+ exports.JobProfileStatus = exports.$Enums.JobProfileStatus = {
1015
+ DRAFT: 'DRAFT',
1016
+ INTAKE_SENT: 'INTAKE_SENT',
1017
+ INTAKE_IN_PROGRESS: 'INTAKE_IN_PROGRESS',
1018
+ COMPLETE: 'COMPLETE'
1019
+ };
1020
+
978
1021
  exports.OngoingEvaluationStatus = exports.$Enums.OngoingEvaluationStatus = {
979
1022
  LOCKED: 'LOCKED',
980
1023
  ACTION_REQUIRED: 'ACTION_REQUIRED',
@@ -1064,6 +1107,8 @@ exports.Prisma.ModelName = {
1064
1107
  InterviewNotes: 'InterviewNotes',
1065
1108
  JobDescription: 'JobDescription',
1066
1109
  JobDescriptionData: 'JobDescriptionData',
1110
+ JobProfile: 'JobProfile',
1111
+ LiveAnalysis: 'LiveAnalysis',
1067
1112
  Message: 'Message',
1068
1113
  OngoingEvaluation: 'OngoingEvaluation',
1069
1114
  Organisation: 'Organisation',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adaptware/eagles-db",
3
- "version": "0.1.61",
3
+ "version": "0.1.67",
4
4
  "description": "A Prisma client package for Treadspace database operations",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
Binary file
@@ -1,10 +1,13 @@
1
1
  model CandidateQuestionResponse {
2
2
  id String @id @default(uuid())
3
+ //foreign keys
3
4
  question_id String
4
5
  candidate_id String
5
6
  assessment_id String
7
+ //data
6
8
  response String
7
9
  score Float?
10
+ /// Audit fields
8
11
  created_by String
9
12
  updated_by String
10
13
  created_at DateTime @default(now())
@@ -15,7 +18,7 @@ model CandidateQuestionResponse {
15
18
  assessment Assessment @relation(fields: [assessment_id], references: [id], onDelete: Cascade)
16
19
  candidate User @relation(fields: [candidate_id], references: [id], onDelete: Cascade, onUpdate: Cascade)
17
20
 
21
+ @@unique([assessment_id, question_id, candidate_id])
18
22
  @@index([candidate_id])
19
- @@index([question_id])
20
23
  @@index([assessment_id])
21
24
  }
@@ -1,23 +1,18 @@
1
- enum AssessmentStatus {
2
- SCHEDULED // Assessment has been created and scheduled
3
- IN_PROGRESS // Candidate is currently giving the assessment
4
- COMPLETED // Assessment completed by candidate
5
- CANCELLED // Assessment cancelled by admin or system
6
- RESCHEDULED // Assessment rescheduled to a new time
7
- NO_SHOW // Candidate failed to take the assessment
8
- EVALUATION_PENDING // Waiting for manual/AI review of answers
9
- EVALUATED // Final evaluation completed and locked
10
- }
11
-
12
1
  model Assessment {
13
2
  id String @id @default(uuid())
3
+ //foreign keys
4
+ organisation_id String?
14
5
  assessment_library_id String
15
6
  candidate_id String
16
7
  reviewer_id String?
8
+ //data
17
9
  score Float?
18
- feedback String?
19
- scheduled_start_time DateTime? @default(now()) // Start Time to start the assessment
20
- assessment_status AssessmentStatus @default(SCHEDULED)
10
+ feedback Json?
11
+ scheduled_start_time DateTime?
12
+ scheduled_end_time DateTime?
13
+ actual_start_time DateTime?
14
+ actual_end_time DateTime?
15
+ /// Audit fields
21
16
  created_at DateTime @default(now())
22
17
  updated_at DateTime @updatedAt
23
18
  created_by String
@@ -29,9 +24,10 @@ model Assessment {
29
24
  reviewer User? @relation("ReviewerAssessments", fields: [reviewer_id], references: [id], onDelete: SetNull, onUpdate: Cascade)
30
25
  questions AssessmentQuestion[] @relation("AssessmentToAssessmentQuestion")
31
26
  candidateResponse CandidateQuestionResponse[]
32
- panelistId String?
27
+ organisation Organisation? @relation(fields: [organisation_id], references: [id], onDelete: Cascade, onUpdate: Cascade)
33
28
  User User? @relation(fields: [userId], references: [id])
34
29
  userId String?
30
+ ongoingEvaluation OngoingEvaluation?
35
31
 
36
32
  @@unique([assessment_library_id, candidate_id])
37
33
  @@index([assessment_library_id])
@@ -18,6 +18,7 @@ model Assignment {
18
18
  status AssignmentStatus @default(AVAILABLE)
19
19
  cancel_reason String?
20
20
  solution_url String?
21
+ zip_url String?
21
22
  scheduled_start_time DateTime?
22
23
  scheduled_end_time DateTime?
23
24
  created_at DateTime @default(now())
@@ -1,6 +1,7 @@
1
1
  enum IntegrationProvider {
2
2
  NAUKRI
3
3
  ZOHO_RECRUIT
4
+ LINKEDIN
4
5
  }
5
6
 
6
7
  enum IntegrationAuthType {
@@ -47,6 +47,7 @@ model Interview {
47
47
  section_feedback Json[]
48
48
  interview_preparation Json?
49
49
  final_feedback Json?
50
+
50
51
  /// Audit fields
51
52
  created_at DateTime @default(now())
52
53
  updated_at DateTime @updatedAt
@@ -66,7 +67,7 @@ model Interview {
66
67
  suggestions Suggestion[]
67
68
  feedback Feedback[]
68
69
  interviewNotes InterviewNotes[]
69
-
70
+ liveAnalysis LiveAnalysis[]
70
71
  @@unique([interviewer_id, candidate_id, evaluation_plan_id])
71
72
  @@index([candidate_id])
72
73
  @@index([interviewer_id])
@@ -25,6 +25,8 @@ model JobDescription {
25
25
  updated_by String
26
26
  is_active Boolean @default(true)
27
27
  openings Int @default(1)
28
+ job_profile_id String?
29
+ job_profile JobProfile? @relation(fields: [job_profile_id], references: [id], onDelete: SetNull, onUpdate: Cascade)
28
30
  organisation Organisation @relation(fields: [organisation_id], references: [id], onDelete: Cascade, onUpdate: Cascade)
29
31
  applications Application[]
30
32
  interviews Interview[]
@@ -44,4 +46,5 @@ model JobDescription {
44
46
 
45
47
  @@index([organisation_id])
46
48
  @@index([hiring_manager_id])
49
+ @@index([job_profile_id])
47
50
  }
@@ -0,0 +1,56 @@
1
+ enum JobProfileStatus {
2
+ DRAFT
3
+ INTAKE_SENT
4
+ INTAKE_IN_PROGRESS
5
+ COMPLETE
6
+ }
7
+
8
+ model JobProfile {
9
+ id String @id @default(uuid())
10
+ organisation_id String
11
+ created_by String
12
+ assigned_to String?
13
+ status JobProfileStatus @default(DRAFT)
14
+
15
+ // Basics
16
+ title String?
17
+ role_type String?
18
+ work_arrangement String?
19
+ location String?
20
+ experience_min String?
21
+ reporting String?
22
+ comp_range String?
23
+ comp_benchmark String?
24
+
25
+ // Requirements (structured from AI conversation)
26
+ responsibilities Json?
27
+ deliverables Json?
28
+ must_have_skills Json?
29
+ nice_to_have_skills Json?
30
+ dealbreakers Json?
31
+ culture Json?
32
+ success_metrics Json?
33
+
34
+ // Competencies
35
+ competencies Json?
36
+
37
+ // Conversation state
38
+ conversation_history Json?
39
+ current_phase String?
40
+ orion_execution_id String?
41
+
42
+ // Audit
43
+ created_at DateTime @default(now())
44
+ updated_at DateTime @updatedAt
45
+ is_active Boolean @default(true)
46
+
47
+ // Relations
48
+ organisation Organisation @relation(fields: [organisation_id], references: [id], onDelete: Cascade, onUpdate: Cascade)
49
+ creator User @relation("ProfileCreator", fields: [created_by], references: [id], onDelete: Restrict, onUpdate: Cascade)
50
+ assignee User? @relation("ProfileAssignee", fields: [assigned_to], references: [id], onDelete: SetNull, onUpdate: Cascade)
51
+ job_descriptions JobDescription[]
52
+
53
+ @@index([organisation_id])
54
+ @@index([assigned_to])
55
+ @@index([created_by])
56
+ }
@@ -0,0 +1,17 @@
1
+ model LiveAnalysis {
2
+ id String @id @default(uuid())
3
+ //foreign keys
4
+ interview_id String
5
+ //data
6
+ analysis Json
7
+ //audit fields
8
+ created_at DateTime @default(now())
9
+ updated_at DateTime @updatedAt
10
+ created_by String
11
+ updated_by String
12
+ is_active Boolean @default(true)
13
+ //relations
14
+ interview Interview @relation(fields: [interview_id], references: [id])
15
+
16
+ @@index([interview_id])
17
+ }
@@ -35,6 +35,7 @@ model OngoingEvaluation {
35
35
  evaluation_plan_id String
36
36
  interview_id String? @unique
37
37
  assignment_id String? @unique
38
+ assessment_id String? @unique
38
39
  status OngoingEvaluationStatus?
39
40
  state OngoingEvaluationState? @default(NOT_STARTED)
40
41
  round_status OngoingEvaluationRoundStatus? @default(NOT_SCHEDULED)
@@ -48,6 +49,7 @@ model OngoingEvaluation {
48
49
  evaluation_plan EvaluationPlan @relation(fields: [evaluation_plan_id], references: [id], onDelete: Cascade, onUpdate: Cascade)
49
50
  interview Interview? @relation(fields: [interview_id], references: [id], onDelete: SetNull, onUpdate: Cascade)
50
51
  assignment Assignment?
52
+ assessment Assessment? @relation(fields: [assessment_id], references: [id], onDelete: SetNull)
51
53
  created_at DateTime @default(now())
52
54
  updated_at DateTime @updatedAt
53
55
  created_by String