@adaptware/eagles-db 0.1.82 → 0.1.84

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-8998d26d2f1ef17bbd9d1b29add72c8f38339c98ed1cca6f9bbd1425c1e16bb0",
2
+ "name": "prisma-client-ce0ead501ab5f4943030635b9183cffe4d4daabd0bff6b1c5e5c12552b7c8110",
3
3
  "main": "index.js",
4
4
  "types": "index.d.ts",
5
5
  "browser": "index-browser.js",
@@ -208,33 +208,22 @@ model Assessment {
208
208
 
209
209
  /// Defines how an assessment is conducted.
210
210
 
211
- enum AssessmentCategory {
212
- MCQ
213
- COMPETENCY
214
- CASE_STUDY
215
- ASSIGNMENT
216
- }
217
-
218
211
  model AssessmentLibrary {
219
- id String @id @default(uuid())
220
- title String
221
- assessment_type String?
222
- description String?
223
- assessment_category AssessmentCategory
224
- time_required Int
225
- passing_score Float?
226
- max_score Float?
227
- organisation_id String
228
- created_by_ai Boolean @default(false)
229
- created_at DateTime @default(now())
230
- updated_at DateTime @updatedAt
231
- created_by String
232
- updated_by String
233
- is_active Boolean @default(true)
234
- organisation Organisation @relation(fields: [organisation_id], references: [id], onDelete: Cascade, onUpdate: Cascade)
235
- questions Question[] // One assessment → many questions
236
- assessments Assessment[]
237
- evaluation_Plans EvaluationPlan[]
212
+ id String @id @default(uuid())
213
+ title String
214
+ time_required Int
215
+ passing_score Float?
216
+ max_score Float?
217
+ organisation_id String
218
+ created_at DateTime @default(now())
219
+ updated_at DateTime @updatedAt
220
+ created_by String
221
+ updated_by String
222
+ is_active Boolean @default(true)
223
+ organisation Organisation @relation(fields: [organisation_id], references: [id], onDelete: Cascade, onUpdate: Cascade)
224
+ questions Question[] // One assessment → many questions
225
+ assessments Assessment[]
226
+ evaluation_Plans EvaluationPlan[]
238
227
 
239
228
  @@index([organisation_id])
240
229
  }
@@ -523,7 +512,7 @@ model EvaluationPlan {
523
512
  elimination_round Boolean @default(false)
524
513
  evaluation_type EvaluationType
525
514
  type_of_round RoundType
526
- timeline Int
515
+ timeline Int?
527
516
  order_no Int?
528
517
  details Json?
529
518
  plan_type EvaluationPlanType @default(GENERIC)
@@ -545,7 +534,6 @@ model EvaluationPlan {
545
534
  assignment_library AssignmentLibrary? @relation(fields: [assignment_library_id], references: [id], onDelete: SetNull)
546
535
  ongoing_evaluations OngoingEvaluation[]
547
536
 
548
- @@unique([job_description_id, order_no])
549
537
  @@index([job_description_id])
550
538
  }
551
539
 
@@ -1023,16 +1011,6 @@ model Notes {
1023
1011
  @@index([user_id, created_at])
1024
1012
  }
1025
1013
 
1026
- enum OngoingEvaluationStatus {
1027
- LOCKED
1028
- ACTION_REQUIRED
1029
- IN_PROGRESS
1030
- EVALUATED
1031
- CLEARED
1032
- NOT_CLEARED
1033
- SKIPPED
1034
- }
1035
-
1036
1014
  enum OngoingEvaluationState {
1037
1015
  NOT_STARTED
1038
1016
  IN_PROGRESS
@@ -1051,37 +1029,24 @@ enum OngoingEvaluationRoundStatus {
1051
1029
  }
1052
1030
 
1053
1031
  model OngoingEvaluation {
1032
+ // Primary Key
1054
1033
  id String @id @default(uuid())
1034
+ // Foreign Keys
1035
+ organisation_id String
1055
1036
  application_id String
1056
1037
  candidate_id String
1057
1038
  resume_id String
1058
- organisation_id String
1059
1039
  job_description_id String
1060
1040
  evaluation_plan_id String
1061
1041
  interview_id String? @unique
1062
1042
  assignment_id String? @unique
1063
1043
  assessment_id String? @unique
1064
- status OngoingEvaluationStatus?
1044
+ // Data Fields
1065
1045
  state OngoingEvaluationState? @default(NOT_STARTED)
1066
1046
  round_status OngoingEvaluationRoundStatus? @default(NOT_SCHEDULED)
1067
1047
  comments String? @default("")
1068
- // Relations
1069
- jobDescription JobDescription? @relation(fields: [job_description_id], references: [id], onDelete: SetNull)
1070
- application Application @relation(fields: [application_id], references: [id], onDelete: Cascade, onUpdate: Cascade)
1071
- candidate User? @relation(fields: [candidate_id], references: [id], onDelete: Cascade, onUpdate: Cascade)
1072
- resume Resume? @relation(fields: [resume_id], references: [id], onDelete: Cascade, onUpdate: Cascade)
1073
- organisation Organisation? @relation(fields: [organisation_id], references: [id], onDelete: Cascade, onUpdate: Cascade)
1074
- evaluation_plan EvaluationPlan @relation(fields: [evaluation_plan_id], references: [id], onDelete: Cascade, onUpdate: Cascade)
1075
- interview Interview? @relation(fields: [interview_id], references: [id], onDelete: SetNull, onUpdate: Cascade)
1076
- assignment Assignment?
1077
- assessment Assessment? @relation(fields: [assessment_id], references: [id], onDelete: SetNull)
1078
- created_at DateTime @default(now())
1079
- updated_at DateTime @updatedAt
1080
- created_by String
1081
- updated_by String
1082
- is_active Boolean @default(true)
1083
- is_current Boolean @default(false)
1084
- // Evaluation Plan Details Will be stored only when candidate starts for the evaluation round
1048
+ completed_at DateTime?
1049
+ /// Evaluation Plan Fields Filled After Round Started
1085
1050
  title String?
1086
1051
  description String?
1087
1052
  order_no Int?
@@ -1091,8 +1056,27 @@ model OngoingEvaluation {
1091
1056
  elimination_round Boolean? @default(false)
1092
1057
  evaluation_type EvaluationType?
1093
1058
  type_of_round RoundType?
1094
- timeline Int?
1059
+ duration Int?
1060
+ deadline Int?
1061
+ duration_unit DurationUnit?
1095
1062
  details Json?
1063
+ // Audit Fields
1064
+ created_at DateTime @default(now())
1065
+ updated_at DateTime @updatedAt
1066
+ created_by String
1067
+ updated_by String
1068
+ is_active Boolean @default(true)
1069
+ is_current Boolean @default(false)
1070
+ // Relations
1071
+ jobDescription JobDescription? @relation(fields: [job_description_id], references: [id], onDelete: SetNull)
1072
+ application Application @relation(fields: [application_id], references: [id], onDelete: Cascade, onUpdate: Cascade)
1073
+ candidate User? @relation(fields: [candidate_id], references: [id], onDelete: Cascade, onUpdate: Cascade)
1074
+ resume Resume? @relation(fields: [resume_id], references: [id], onDelete: Cascade, onUpdate: Cascade)
1075
+ organisation Organisation? @relation(fields: [organisation_id], references: [id], onDelete: Cascade, onUpdate: Cascade)
1076
+ evaluation_plan EvaluationPlan @relation(fields: [evaluation_plan_id], references: [id], onDelete: Cascade, onUpdate: Cascade)
1077
+ interview Interview? @relation(fields: [interview_id], references: [id], onDelete: SetNull, onUpdate: Cascade)
1078
+ assignment Assignment?
1079
+ assessment Assessment? @relation(fields: [assessment_id], references: [id], onDelete: SetNull)
1096
1080
 
1097
1081
  @@unique([application_id, evaluation_plan_id])
1098
1082
  @@index([application_id])
package/client/wasm.js CHANGED
@@ -236,14 +236,10 @@ exports.Prisma.AssessmentScalarFieldEnum = {
236
236
  exports.Prisma.AssessmentLibraryScalarFieldEnum = {
237
237
  id: 'id',
238
238
  title: 'title',
239
- assessment_type: 'assessment_type',
240
- description: 'description',
241
- assessment_category: 'assessment_category',
242
239
  time_required: 'time_required',
243
240
  passing_score: 'passing_score',
244
241
  max_score: 'max_score',
245
242
  organisation_id: 'organisation_id',
246
- created_by_ai: 'created_by_ai',
247
243
  created_at: 'created_at',
248
244
  updated_at: 'updated_at',
249
245
  created_by: 'created_by',
@@ -666,25 +662,19 @@ exports.Prisma.NotesScalarFieldEnum = {
666
662
 
667
663
  exports.Prisma.OngoingEvaluationScalarFieldEnum = {
668
664
  id: 'id',
665
+ organisation_id: 'organisation_id',
669
666
  application_id: 'application_id',
670
667
  candidate_id: 'candidate_id',
671
668
  resume_id: 'resume_id',
672
- organisation_id: 'organisation_id',
673
669
  job_description_id: 'job_description_id',
674
670
  evaluation_plan_id: 'evaluation_plan_id',
675
671
  interview_id: 'interview_id',
676
672
  assignment_id: 'assignment_id',
677
673
  assessment_id: 'assessment_id',
678
- status: 'status',
679
674
  state: 'state',
680
675
  round_status: 'round_status',
681
676
  comments: 'comments',
682
- created_at: 'created_at',
683
- updated_at: 'updated_at',
684
- created_by: 'created_by',
685
- updated_by: 'updated_by',
686
- is_active: 'is_active',
687
- is_current: 'is_current',
677
+ completed_at: 'completed_at',
688
678
  title: 'title',
689
679
  description: 'description',
690
680
  order_no: 'order_no',
@@ -694,8 +684,16 @@ exports.Prisma.OngoingEvaluationScalarFieldEnum = {
694
684
  elimination_round: 'elimination_round',
695
685
  evaluation_type: 'evaluation_type',
696
686
  type_of_round: 'type_of_round',
697
- timeline: 'timeline',
698
- details: 'details'
687
+ duration: 'duration',
688
+ deadline: 'deadline',
689
+ duration_unit: 'duration_unit',
690
+ details: 'details',
691
+ created_at: 'created_at',
692
+ updated_at: 'updated_at',
693
+ created_by: 'created_by',
694
+ updated_by: 'updated_by',
695
+ is_active: 'is_active',
696
+ is_current: 'is_current'
699
697
  };
700
698
 
701
699
  exports.Prisma.OrganisationScalarFieldEnum = {
@@ -986,13 +984,6 @@ exports.ApplicationStatus = exports.$Enums.ApplicationStatus = {
986
984
  REJECTED: 'REJECTED'
987
985
  };
988
986
 
989
- exports.AssessmentCategory = exports.$Enums.AssessmentCategory = {
990
- MCQ: 'MCQ',
991
- COMPETENCY: 'COMPETENCY',
992
- CASE_STUDY: 'CASE_STUDY',
993
- ASSIGNMENT: 'ASSIGNMENT'
994
- };
995
-
996
987
  exports.AssignmentStatus = exports.$Enums.AssignmentStatus = {
997
988
  AVAILABLE: 'AVAILABLE',
998
989
  SCHEDULED: 'SCHEDULED',
@@ -1130,16 +1121,6 @@ exports.JobProfileStatus = exports.$Enums.JobProfileStatus = {
1130
1121
  COMPLETE: 'COMPLETE'
1131
1122
  };
1132
1123
 
1133
- exports.OngoingEvaluationStatus = exports.$Enums.OngoingEvaluationStatus = {
1134
- LOCKED: 'LOCKED',
1135
- ACTION_REQUIRED: 'ACTION_REQUIRED',
1136
- IN_PROGRESS: 'IN_PROGRESS',
1137
- EVALUATED: 'EVALUATED',
1138
- CLEARED: 'CLEARED',
1139
- NOT_CLEARED: 'NOT_CLEARED',
1140
- SKIPPED: 'SKIPPED'
1141
- };
1142
-
1143
1124
  exports.OngoingEvaluationState = exports.$Enums.OngoingEvaluationState = {
1144
1125
  NOT_STARTED: 'NOT_STARTED',
1145
1126
  IN_PROGRESS: 'IN_PROGRESS',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adaptware/eagles-db",
3
- "version": "0.1.82",
3
+ "version": "0.1.84",
4
4
  "description": "A Prisma client package for Treadspace database operations",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -0,0 +1,5 @@
1
+ -- DropUnique: allows reorder/swap without a two-phase order_no dance; ordering is enforced in app logic.
2
+ ALTER TABLE "EvaluationPlan" DROP CONSTRAINT IF EXISTS "EvaluationPlan_job_description_id_order_no_key";
3
+
4
+ -- Non-unique index for lookups by job + order (e.g. swap).
5
+ CREATE INDEX "EvaluationPlan_job_description_id_order_no_idx" ON "EvaluationPlan"("job_description_id", "order_no");
@@ -0,0 +1,15 @@
1
+ -- EvaluationPlan.timeline optional (legacy column; app uses duration/deadline/duration_unit).
2
+ ALTER TABLE "EvaluationPlan" ALTER COLUMN "timeline" DROP NOT NULL;
3
+
4
+ -- OngoingEvaluation: denormalized duration fields; migrate legacy timeline into duration (minutes) then drop timeline.
5
+ ALTER TABLE "OngoingEvaluation" ADD COLUMN "duration" INTEGER;
6
+ ALTER TABLE "OngoingEvaluation" ADD COLUMN "deadline" INTEGER;
7
+ ALTER TABLE "OngoingEvaluation" ADD COLUMN "duration_unit" "DurationUnit";
8
+
9
+ UPDATE "OngoingEvaluation"
10
+ SET
11
+ "duration" = "timeline",
12
+ "duration_unit" = 'MINUTES'::"DurationUnit"
13
+ WHERE "timeline" IS NOT NULL AND "duration" IS NULL;
14
+
15
+ ALTER TABLE "OngoingEvaluation" DROP COLUMN IF EXISTS "timeline";
@@ -0,0 +1,8 @@
1
+ -- Remove unused AssessmentLibrary metadata columns.
2
+ ALTER TABLE "AssessmentLibrary" DROP COLUMN IF EXISTS "assessment_type";
3
+ ALTER TABLE "AssessmentLibrary" DROP COLUMN IF EXISTS "description";
4
+ ALTER TABLE "AssessmentLibrary" DROP COLUMN IF EXISTS "assessment_category";
5
+ ALTER TABLE "AssessmentLibrary" DROP COLUMN IF EXISTS "created_by_ai";
6
+
7
+ -- Enum only referenced by dropped column.
8
+ DROP TYPE IF EXISTS "AssessmentCategory";
@@ -1,32 +1,21 @@
1
1
  /// Defines how an assessment is conducted.
2
2
 
3
- enum AssessmentCategory {
4
- MCQ
5
- COMPETENCY
6
- CASE_STUDY
7
- ASSIGNMENT
8
- }
9
-
10
3
  model AssessmentLibrary {
11
- id String @id @default(uuid())
12
- title String
13
- assessment_type String?
14
- description String?
15
- assessment_category AssessmentCategory
16
- time_required Int
17
- passing_score Float?
18
- max_score Float?
19
- organisation_id String
20
- created_by_ai Boolean @default(false)
21
- created_at DateTime @default(now())
22
- updated_at DateTime @updatedAt
23
- created_by String
24
- updated_by String
25
- is_active Boolean @default(true)
26
- organisation Organisation @relation(fields: [organisation_id], references: [id], onDelete: Cascade, onUpdate: Cascade)
27
- questions Question[] // One assessment → many questions
28
- assessments Assessment[]
29
- evaluation_Plans EvaluationPlan[]
4
+ id String @id @default(uuid())
5
+ title String
6
+ time_required Int
7
+ passing_score Float?
8
+ max_score Float?
9
+ organisation_id String
10
+ created_at DateTime @default(now())
11
+ updated_at DateTime @updatedAt
12
+ created_by String
13
+ updated_by String
14
+ is_active Boolean @default(true)
15
+ organisation Organisation @relation(fields: [organisation_id], references: [id], onDelete: Cascade, onUpdate: Cascade)
16
+ questions Question[] // One assessment → many questions
17
+ assessments Assessment[]
18
+ evaluation_Plans EvaluationPlan[]
30
19
 
31
20
  @@index([organisation_id])
32
21
  }
@@ -66,7 +66,7 @@ model EvaluationPlan {
66
66
  elimination_round Boolean @default(false)
67
67
  evaluation_type EvaluationType
68
68
  type_of_round RoundType
69
- timeline Int
69
+ timeline Int?
70
70
  order_no Int?
71
71
  details Json?
72
72
  plan_type EvaluationPlanType @default(GENERIC)
@@ -88,6 +88,5 @@ model EvaluationPlan {
88
88
  assignment_library AssignmentLibrary? @relation(fields: [assignment_library_id], references: [id], onDelete: SetNull)
89
89
  ongoing_evaluations OngoingEvaluation[]
90
90
 
91
- @@unique([job_description_id, order_no])
92
91
  @@index([job_description_id])
93
92
  }
@@ -1,13 +1,3 @@
1
- enum OngoingEvaluationStatus {
2
- LOCKED
3
- ACTION_REQUIRED
4
- IN_PROGRESS
5
- EVALUATED
6
- CLEARED
7
- NOT_CLEARED
8
- SKIPPED
9
- }
10
-
11
1
  enum OngoingEvaluationState {
12
2
  NOT_STARTED
13
3
  IN_PROGRESS
@@ -26,37 +16,24 @@ enum OngoingEvaluationRoundStatus {
26
16
  }
27
17
 
28
18
  model OngoingEvaluation {
19
+ // Primary Key
29
20
  id String @id @default(uuid())
21
+ // Foreign Keys
22
+ organisation_id String
30
23
  application_id String
31
24
  candidate_id String
32
25
  resume_id String
33
- organisation_id String
34
26
  job_description_id String
35
27
  evaluation_plan_id String
36
28
  interview_id String? @unique
37
29
  assignment_id String? @unique
38
30
  assessment_id String? @unique
39
- status OngoingEvaluationStatus?
31
+ // Data Fields
40
32
  state OngoingEvaluationState? @default(NOT_STARTED)
41
33
  round_status OngoingEvaluationRoundStatus? @default(NOT_SCHEDULED)
42
34
  comments String? @default("")
43
- // Relations
44
- jobDescription JobDescription? @relation(fields: [job_description_id], references: [id], onDelete: SetNull)
45
- application Application @relation(fields: [application_id], references: [id], onDelete: Cascade, onUpdate: Cascade)
46
- candidate User? @relation(fields: [candidate_id], references: [id], onDelete: Cascade, onUpdate: Cascade)
47
- resume Resume? @relation(fields: [resume_id], references: [id], onDelete: Cascade, onUpdate: Cascade)
48
- organisation Organisation? @relation(fields: [organisation_id], references: [id], onDelete: Cascade, onUpdate: Cascade)
49
- evaluation_plan EvaluationPlan @relation(fields: [evaluation_plan_id], references: [id], onDelete: Cascade, onUpdate: Cascade)
50
- interview Interview? @relation(fields: [interview_id], references: [id], onDelete: SetNull, onUpdate: Cascade)
51
- assignment Assignment?
52
- assessment Assessment? @relation(fields: [assessment_id], references: [id], onDelete: SetNull)
53
- created_at DateTime @default(now())
54
- updated_at DateTime @updatedAt
55
- created_by String
56
- updated_by String
57
- is_active Boolean @default(true)
58
- is_current Boolean @default(false)
59
- // Evaluation Plan Details Will be stored only when candidate starts for the evaluation round
35
+ completed_at DateTime?
36
+ /// Evaluation Plan Fields Filled After Round Started
60
37
  title String?
61
38
  description String?
62
39
  order_no Int?
@@ -66,8 +43,27 @@ model OngoingEvaluation {
66
43
  elimination_round Boolean? @default(false)
67
44
  evaluation_type EvaluationType?
68
45
  type_of_round RoundType?
69
- timeline Int?
46
+ duration Int?
47
+ deadline Int?
48
+ duration_unit DurationUnit?
70
49
  details Json?
50
+ // Audit Fields
51
+ created_at DateTime @default(now())
52
+ updated_at DateTime @updatedAt
53
+ created_by String
54
+ updated_by String
55
+ is_active Boolean @default(true)
56
+ is_current Boolean @default(false)
57
+ // Relations
58
+ jobDescription JobDescription? @relation(fields: [job_description_id], references: [id], onDelete: SetNull)
59
+ application Application @relation(fields: [application_id], references: [id], onDelete: Cascade, onUpdate: Cascade)
60
+ candidate User? @relation(fields: [candidate_id], references: [id], onDelete: Cascade, onUpdate: Cascade)
61
+ resume Resume? @relation(fields: [resume_id], references: [id], onDelete: Cascade, onUpdate: Cascade)
62
+ organisation Organisation? @relation(fields: [organisation_id], references: [id], onDelete: Cascade, onUpdate: Cascade)
63
+ evaluation_plan EvaluationPlan @relation(fields: [evaluation_plan_id], references: [id], onDelete: Cascade, onUpdate: Cascade)
64
+ interview Interview? @relation(fields: [interview_id], references: [id], onDelete: SetNull, onUpdate: Cascade)
65
+ assignment Assignment?
66
+ assessment Assessment? @relation(fields: [assessment_id], references: [id], onDelete: SetNull)
71
67
 
72
68
  @@unique([application_id, evaluation_plan_id])
73
69
  @@index([application_id])