@adaptware/eagles-db 0.1.36 → 0.1.38

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-a3d9b695d947951ed70e866b5fe5fe9438d58ee410e3c62d37e70587ea2ee8f9",
2
+ "name": "prisma-client-5ac043c7414ca642bbc8e7b02ef3040a50e4dc0f37a86e5bea0ddb8963dd11da",
3
3
  "main": "index.js",
4
4
  "types": "index.d.ts",
5
5
  "browser": "index-browser.js",
@@ -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
+ candidate_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
+ candidate User @relation("CandidateActivityLogs", fields: [candidate_id], references: [id], onDelete: Cascade, onUpdate: Cascade)
98
+ actor User? @relation("ActorActivityLogs", fields: [actor_id], references: [id], onDelete: SetNull, onUpdate: Cascade)
99
+
100
+ @@index([candidate_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)
@@ -108,18 +130,16 @@ model Application {
108
130
  fit_check FitCheck? @relation(fields: [fit_check_id], references: [id], onDelete: Cascade, onUpdate: Cascade)
109
131
  interviews Interview[]
110
132
  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)
133
+ // Audit fields
134
+ created_at DateTime @default(now())
135
+ updated_at DateTime @updatedAt
136
+ created_by String
137
+ updated_by String
138
+ is_active Boolean @default(true)
117
139
 
118
140
  @@unique([candidate_id, job_description_id]) // Ensures candidate applies only once per job
119
141
  @@index([candidate_id])
120
142
  @@index([job_description_id])
121
- @@index([organisation_id])
122
- @@index([resume_id])
123
143
  }
124
144
 
125
145
  model Approval {
@@ -209,7 +229,6 @@ model AssessmentLibrary {
209
229
  evaluation_Plans EvaluationPlan[]
210
230
 
211
231
  @@index([organisation_id])
212
- @@index([created_at])
213
232
  }
214
233
 
215
234
  /**
@@ -248,7 +267,6 @@ model AssignmentLibrary {
248
267
  evaluationPlan EvaluationPlan[]
249
268
 
250
269
  @@index([job_description_id])
251
- @@index([created_at])
252
270
  }
253
271
 
254
272
  enum JobType {
@@ -465,6 +483,7 @@ model FitCheck {
465
483
  id String @id @default(uuid())
466
484
  /// FK to organisations table
467
485
  organisation_id String?
486
+ candidate_id String?
468
487
  resume_id String
469
488
  job_description_id String
470
489
 
@@ -502,6 +521,7 @@ model FitCheck {
502
521
  updated_at DateTime @updatedAt
503
522
  /// Relations
504
523
  organisation Organisation? @relation(fields: [organisation_id], references: [id], onDelete: Cascade, onUpdate: Cascade)
524
+ candidate User? @relation(fields: [candidate_id], references: [id], onDelete: Cascade, onUpdate: Cascade)
505
525
  resume Resume @relation(fields: [resume_id], references: [id], onDelete: Cascade, onUpdate: Cascade)
506
526
  job_description JobDescription @relation(fields: [job_description_id], references: [id], onDelete: Cascade, onUpdate: Cascade)
507
527
  application Application?
@@ -607,7 +627,6 @@ model Interview {
607
627
  interviewNotes InterviewNotes[]
608
628
 
609
629
  @@unique([interviewer_id, candidate_id, evaluation_plan_id])
610
- @@index([application_id])
611
630
  @@index([candidate_id])
612
631
  @@index([interviewer_id])
613
632
  @@index([job_description_id])
@@ -643,8 +662,6 @@ model InterviewLibrary {
643
662
  organisation Organisation @relation(fields: [organisation_id], references: [id], onDelete: Cascade, onUpdate: Cascade)
644
663
 
645
664
  @@index([organisation_id])
646
- @@index([category])
647
- @@index([created_at])
648
665
  }
649
666
 
650
667
  model InterviewNotes {
@@ -725,7 +742,6 @@ model JobDescriptionData {
725
742
  jobDescription JobDescription @relation(fields: [job_description_id], references: [id], onDelete: Cascade, onUpdate: Cascade)
726
743
 
727
744
  @@unique([job_description_id, key])
728
- @@index([created_at])
729
745
  }
730
746
 
731
747
  model Message {
@@ -894,7 +910,6 @@ model OverallFeedback {
894
910
 
895
911
  @@unique([interview_id, interviewer_id]) // 👈 updated uniqueness logic
896
912
  @@index([interview_id])
897
- @@index([interviewer_id])
898
913
  }
899
914
 
900
915
  model Panelist {
@@ -1093,7 +1108,6 @@ model Suggestion {
1093
1108
  organisation Organisation @relation(fields: [organisation_id], references: [id], onDelete: Cascade)
1094
1109
 
1095
1110
  @@index([interview_id])
1096
- @@index([transcript_id])
1097
1111
  }
1098
1112
 
1099
1113
  model Transcript {
@@ -1168,9 +1182,12 @@ model User {
1168
1182
  candidateResponses CandidateQuestionResponse[]
1169
1183
  questions Question[]
1170
1184
  ongoing_evaluations OngoingEvaluation[] // optional one-to-many
1185
+ candidate_activity_logs ActivityLog[] @relation("CandidateActivityLogs")
1186
+ actor_activity_logs ActivityLog[] @relation("ActorActivityLogs")
1171
1187
  actions Action[]
1172
1188
  calendly Calendly?
1173
1189
  google Google?
1190
+ fitChecks FitCheck[]
1174
1191
 
1175
1192
  name String?
1176
1193
  phone String?
package/client/wasm.js CHANGED
@@ -163,6 +163,18 @@ exports.Prisma.ActionScalarFieldEnum = {
163
163
  is_active: 'is_active'
164
164
  };
165
165
 
166
+ exports.Prisma.ActivityLogScalarFieldEnum = {
167
+ id: 'id',
168
+ candidate_id: 'candidate_id',
169
+ actor_id: 'actor_id',
170
+ actor_type: 'actor_type',
171
+ message: 'message',
172
+ timestamp: 'timestamp',
173
+ metadata: 'metadata',
174
+ created_at: 'created_at',
175
+ is_active: 'is_active'
176
+ };
177
+
166
178
  exports.Prisma.ApplicationScalarFieldEnum = {
167
179
  id: 'id',
168
180
  candidate_id: 'candidate_id',
@@ -364,6 +376,7 @@ exports.Prisma.FeedbackScalarFieldEnum = {
364
376
  exports.Prisma.FitCheckScalarFieldEnum = {
365
377
  id: 'id',
366
378
  organisation_id: 'organisation_id',
379
+ candidate_id: 'candidate_id',
367
380
  resume_id: 'resume_id',
368
381
  job_description_id: 'job_description_id',
369
382
  skills_match: 'skills_match',
@@ -803,6 +816,12 @@ exports.ActionStatus = exports.$Enums.ActionStatus = {
803
816
  CANCELLED: 'CANCELLED'
804
817
  };
805
818
 
819
+ exports.ActivityActorType = exports.$Enums.ActivityActorType = {
820
+ USER: 'USER',
821
+ AI: 'AI',
822
+ SYSTEM: 'SYSTEM'
823
+ };
824
+
806
825
  exports.ApplicationStatus = exports.$Enums.ApplicationStatus = {
807
826
  PENDING: 'PENDING',
808
827
  IN_PROGRESS: 'IN_PROGRESS',
@@ -997,6 +1016,7 @@ exports.Prisma.ModelName = {
997
1016
  CandidateQuestionResponse: 'CandidateQuestionResponse',
998
1017
  UserRole: 'UserRole',
999
1018
  Action: 'Action',
1019
+ ActivityLog: 'ActivityLog',
1000
1020
  Application: 'Application',
1001
1021
  Approval: 'Approval',
1002
1022
  Assessment: 'Assessment',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adaptware/eagles-db",
3
- "version": "0.1.36",
3
+ "version": "0.1.38",
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
@@ -0,0 +1,22 @@
1
+ enum ActivityActorType {
2
+ USER
3
+ AI
4
+ SYSTEM
5
+ }
6
+
7
+ model ActivityLog {
8
+ id String @id @default(uuid())
9
+ candidate_id String
10
+ actor_id String?
11
+ actor_type ActivityActorType @default(USER)
12
+ message String
13
+ timestamp DateTime @default(now())
14
+ metadata Json?
15
+ created_at DateTime @default(now())
16
+ is_active Boolean @default(true)
17
+ // Relations
18
+ candidate User @relation("CandidateActivityLogs", fields: [candidate_id], references: [id], onDelete: Cascade, onUpdate: Cascade)
19
+ actor User? @relation("ActorActivityLogs", fields: [actor_id], references: [id], onDelete: SetNull, onUpdate: Cascade)
20
+
21
+ @@index([candidate_id])
22
+ }
@@ -7,20 +7,19 @@ enum ApplicationStatus {
7
7
  }
8
8
 
9
9
  model Application {
10
- id String @id @default(uuid())
11
- candidate_id String
12
- resume_id String
13
- organisation_id String
14
- job_description_id String
15
- status ApplicationStatus @default(PENDING)
16
- fit_check_score Float?
17
- fit_check_status FitCheckStatus?
18
- applied_at DateTime @default(now())
19
- evaluation_plan_id String?
20
- evaluation_plan EvaluationPlan? @relation(fields: [evaluation_plan_id], references: [id])
21
- fit_check_id String? @unique
22
- round_no Int @default(0)
23
-
10
+ id String @id @default(uuid())
11
+ candidate_id String
12
+ resume_id String
13
+ organisation_id String
14
+ job_description_id String
15
+ status ApplicationStatus @default(PENDING)
16
+ fit_check_score Float?
17
+ fit_check_status FitCheckStatus?
18
+ applied_at DateTime @default(now())
19
+ evaluation_plan_id String?
20
+ evaluation_plan EvaluationPlan? @relation(fields: [evaluation_plan_id], references: [id])
21
+ fit_check_id String? @unique
22
+ round_no Int @default(0)
24
23
  // Relations
25
24
  candidate User @relation(fields: [candidate_id], references: [id], onDelete: Cascade, onUpdate: Cascade)
26
25
  organisation Organisation @relation(fields: [organisation_id], references: [id], onDelete: Cascade, onUpdate: Cascade)
@@ -29,16 +28,14 @@ model Application {
29
28
  fit_check FitCheck? @relation(fields: [fit_check_id], references: [id], onDelete: Cascade, onUpdate: Cascade)
30
29
  interviews Interview[]
31
30
  ongoing_evaluations OngoingEvaluation[]
32
-
33
- created_at DateTime @default(now())
34
- updated_at DateTime @updatedAt
35
- created_by String
36
- updated_by String
37
- is_active Boolean @default(true)
31
+ // Audit fields
32
+ created_at DateTime @default(now())
33
+ updated_at DateTime @updatedAt
34
+ created_by String
35
+ updated_by String
36
+ is_active Boolean @default(true)
38
37
 
39
38
  @@unique([candidate_id, job_description_id]) // Ensures candidate applies only once per job
40
39
  @@index([candidate_id])
41
40
  @@index([job_description_id])
42
- @@index([organisation_id])
43
- @@index([resume_id])
44
41
  }
@@ -29,5 +29,4 @@ model AssessmentLibrary {
29
29
  evaluation_Plans EvaluationPlan[]
30
30
 
31
31
  @@index([organisation_id])
32
- @@index([created_at])
33
32
  }
@@ -1,20 +1,19 @@
1
-
2
1
  model AssignmentLibrary {
3
- id String @id @default(uuid())
4
- deadline Int
2
+ id String @id @default(uuid())
3
+ deadline Int
5
4
  /// Flexible JSON for assignment-specific config (rubrics, instructions, criteria, etc.)
6
- assignment Json?
7
- job_description_id String
8
- organisation_id String
9
- created_at DateTime @default(now())
10
- updated_at DateTime @updatedAt
11
- created_by String
12
- updated_by String
13
- is_active Boolean @default(true)
14
- organisation Organisation @relation(fields: [organisation_id], references: [id], onDelete: Cascade, onUpdate: Cascade)
15
- jobDescription JobDescription @relation(fields: [job_description_id], references: [id], onDelete: Cascade, onUpdate: Cascade)
5
+ assignment Json?
6
+ job_description_id String
7
+ organisation_id String
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
+ organisation Organisation @relation(fields: [organisation_id], references: [id], onDelete: Cascade, onUpdate: Cascade)
14
+ jobDescription JobDescription @relation(fields: [job_description_id], references: [id], onDelete: Cascade, onUpdate: Cascade)
16
15
  /// Back-relation: one-to-one from EvaluationPlan (FK lives on EvaluationPlan.assignment_library_id)
17
- evaluationPlan EvaluationPlan[]
16
+ evaluationPlan EvaluationPlan[]
17
+
18
18
  @@index([job_description_id])
19
- @@index([created_at])
20
19
  }
@@ -9,6 +9,7 @@ model FitCheck {
9
9
  id String @id @default(uuid())
10
10
  /// FK to organisations table
11
11
  organisation_id String?
12
+ candidate_id String?
12
13
  resume_id String
13
14
  job_description_id String
14
15
 
@@ -46,6 +47,7 @@ model FitCheck {
46
47
  updated_at DateTime @updatedAt
47
48
  /// Relations
48
49
  organisation Organisation? @relation(fields: [organisation_id], references: [id], onDelete: Cascade, onUpdate: Cascade)
50
+ candidate User? @relation(fields: [candidate_id], references: [id], onDelete: Cascade, onUpdate: Cascade)
49
51
  resume Resume @relation(fields: [resume_id], references: [id], onDelete: Cascade, onUpdate: Cascade)
50
52
  job_description JobDescription @relation(fields: [job_description_id], references: [id], onDelete: Cascade, onUpdate: Cascade)
51
53
  application Application?
@@ -58,7 +58,6 @@ model Interview {
58
58
  interviewNotes InterviewNotes[]
59
59
 
60
60
  @@unique([interviewer_id, candidate_id, evaluation_plan_id])
61
- @@index([application_id])
62
61
  @@index([candidate_id])
63
62
  @@index([interviewer_id])
64
63
  @@index([job_description_id])
@@ -28,6 +28,4 @@ model InterviewLibrary {
28
28
  organisation Organisation @relation(fields: [organisation_id], references: [id], onDelete: Cascade, onUpdate: Cascade)
29
29
 
30
30
  @@index([organisation_id])
31
- @@index([category])
32
- @@index([created_at])
33
31
  }
@@ -12,5 +12,4 @@ model JobDescriptionData {
12
12
  jobDescription JobDescription @relation(fields: [job_description_id], references: [id], onDelete: Cascade, onUpdate: Cascade)
13
13
 
14
14
  @@unique([job_description_id, key])
15
- @@index([created_at])
16
15
  }
@@ -31,5 +31,4 @@ model OverallFeedback {
31
31
 
32
32
  @@unique([interview_id, interviewer_id]) // 👈 updated uniqueness logic
33
33
  @@index([interview_id])
34
- @@index([interviewer_id])
35
34
  }
@@ -17,5 +17,4 @@ model Suggestion {
17
17
  organisation Organisation @relation(fields: [organisation_id], references: [id], onDelete: Cascade)
18
18
 
19
19
  @@index([interview_id])
20
- @@index([transcript_id])
21
20
  }
@@ -43,9 +43,12 @@ model User {
43
43
  candidateResponses CandidateQuestionResponse[]
44
44
  questions Question[]
45
45
  ongoing_evaluations OngoingEvaluation[] // optional one-to-many
46
+ candidate_activity_logs ActivityLog[] @relation("CandidateActivityLogs")
47
+ actor_activity_logs ActivityLog[] @relation("ActorActivityLogs")
46
48
  actions Action[]
47
49
  calendly Calendly?
48
50
  google Google?
51
+ fitChecks FitCheck[]
49
52
 
50
53
  name String?
51
54
  phone String?