@adaptware/eagles-db 0.1.37 → 0.1.39

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-9cd12895fc83544f1eb274541a2d65d3cdbd6e8f5f8d8a6f54ce5de255b139bc",
2
+ "name": "prisma-client-3d6f737e76c812c2732fa6b2b1ce3c4668c542f50849008927bd91bbb546fede",
3
3
  "main": "index.js",
4
4
  "types": "index.d.ts",
5
5
  "browser": "index-browser.js",
@@ -83,45 +83,23 @@ enum ActivityActorType {
83
83
  SYSTEM
84
84
  }
85
85
 
86
- enum ActivityActionType {
87
- ROUND_COMPLETED
88
- STAGE_CHANGED
89
- AI_ANALYSIS_REFRESHED
90
- FEEDBACK_ADDED
91
- NOTE_ADDED
92
- INTERVIEW_SCHEDULED
93
- INTERVIEW_COMPLETED
94
- STATUS_UPDATED
95
- OTHER
96
- }
97
-
98
- enum ActivitySource {
99
- SYSTEM_TRIGGER
100
- MANUAL_ACTION
101
- API
102
- SCHEDULER
103
- WEBHOOK
104
- }
105
-
106
86
  model ActivityLog {
107
- id String @id @default(uuid())
108
- candidate_id String
109
- actor_id String?
110
- actor_type ActivityActorType
111
- action_type ActivityActionType
112
- message String
113
- timestamp DateTime @default(now())
114
- metadata Json?
115
- created_at DateTime @default(now())
116
-
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)
117
96
  // Relations
118
- candidate User @relation("CandidateActivityLogs", fields: [candidate_id], references: [id], onDelete: Cascade, onUpdate: Cascade)
119
- actor User? @relation("ActorActivityLogs", fields: [actor_id], references: [id], onDelete: SetNull, onUpdate: Cascade)
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
+ user User? @relation(fields: [userId], references: [id])
100
+ userId String?
120
101
 
121
- @@index([candidate_id])
122
- @@index([timestamp])
123
- @@index([candidate_id, timestamp])
124
- @@index([action_type])
102
+ @@index([application_id])
125
103
  }
126
104
 
127
105
  // PENDING could be understood as unscreened
@@ -133,20 +111,19 @@ enum ApplicationStatus {
133
111
  }
134
112
 
135
113
  model Application {
136
- id String @id @default(uuid())
137
- candidate_id String
138
- resume_id String
139
- organisation_id String
140
- job_description_id String
141
- status ApplicationStatus @default(PENDING)
142
- fit_check_score Float?
143
- fit_check_status FitCheckStatus?
144
- applied_at DateTime @default(now())
145
- evaluation_plan_id String?
146
- evaluation_plan EvaluationPlan? @relation(fields: [evaluation_plan_id], references: [id])
147
- fit_check_id String? @unique
148
- round_no Int @default(0)
149
-
114
+ id String @id @default(uuid())
115
+ candidate_id String
116
+ resume_id String
117
+ organisation_id String
118
+ job_description_id String
119
+ status ApplicationStatus @default(PENDING)
120
+ fit_check_score Float?
121
+ fit_check_status FitCheckStatus?
122
+ applied_at DateTime @default(now())
123
+ evaluation_plan_id String?
124
+ evaluation_plan EvaluationPlan? @relation(fields: [evaluation_plan_id], references: [id])
125
+ fit_check_id String? @unique
126
+ round_no Int @default(0)
150
127
  // Relations
151
128
  candidate User @relation(fields: [candidate_id], references: [id], onDelete: Cascade, onUpdate: Cascade)
152
129
  organisation Organisation @relation(fields: [organisation_id], references: [id], onDelete: Cascade, onUpdate: Cascade)
@@ -155,18 +132,17 @@ model Application {
155
132
  fit_check FitCheck? @relation(fields: [fit_check_id], references: [id], onDelete: Cascade, onUpdate: Cascade)
156
133
  interviews Interview[]
157
134
  ongoing_evaluations OngoingEvaluation[]
158
-
159
- created_at DateTime @default(now())
160
- updated_at DateTime @updatedAt
161
- created_by String
162
- updated_by String
163
- is_active Boolean @default(true)
135
+ activity_logs ActivityLog[]
136
+ // Audit fields
137
+ created_at DateTime @default(now())
138
+ updated_at DateTime @updatedAt
139
+ created_by String
140
+ updated_by String
141
+ is_active Boolean @default(true)
164
142
 
165
143
  @@unique([candidate_id, job_description_id]) // Ensures candidate applies only once per job
166
144
  @@index([candidate_id])
167
145
  @@index([job_description_id])
168
- @@index([organisation_id])
169
- @@index([resume_id])
170
146
  }
171
147
 
172
148
  model Approval {
@@ -256,7 +232,6 @@ model AssessmentLibrary {
256
232
  evaluation_Plans EvaluationPlan[]
257
233
 
258
234
  @@index([organisation_id])
259
- @@index([created_at])
260
235
  }
261
236
 
262
237
  /**
@@ -295,7 +270,6 @@ model AssignmentLibrary {
295
270
  evaluationPlan EvaluationPlan[]
296
271
 
297
272
  @@index([job_description_id])
298
- @@index([created_at])
299
273
  }
300
274
 
301
275
  enum JobType {
@@ -656,7 +630,6 @@ model Interview {
656
630
  interviewNotes InterviewNotes[]
657
631
 
658
632
  @@unique([interviewer_id, candidate_id, evaluation_plan_id])
659
- @@index([application_id])
660
633
  @@index([candidate_id])
661
634
  @@index([interviewer_id])
662
635
  @@index([job_description_id])
@@ -692,8 +665,6 @@ model InterviewLibrary {
692
665
  organisation Organisation @relation(fields: [organisation_id], references: [id], onDelete: Cascade, onUpdate: Cascade)
693
666
 
694
667
  @@index([organisation_id])
695
- @@index([category])
696
- @@index([created_at])
697
668
  }
698
669
 
699
670
  model InterviewNotes {
@@ -774,7 +745,6 @@ model JobDescriptionData {
774
745
  jobDescription JobDescription @relation(fields: [job_description_id], references: [id], onDelete: Cascade, onUpdate: Cascade)
775
746
 
776
747
  @@unique([job_description_id, key])
777
- @@index([created_at])
778
748
  }
779
749
 
780
750
  model Message {
@@ -943,7 +913,6 @@ model OverallFeedback {
943
913
 
944
914
  @@unique([interview_id, interviewer_id]) // 👈 updated uniqueness logic
945
915
  @@index([interview_id])
946
- @@index([interviewer_id])
947
916
  }
948
917
 
949
918
  model Panelist {
@@ -1073,6 +1042,7 @@ model Resume {
1073
1042
  created_by String
1074
1043
  updated_by String
1075
1044
  is_active Boolean @default(true)
1045
+ name String?
1076
1046
  user User? @relation(fields: [user_id], references: [id], onDelete: SetNull, onUpdate: Cascade)
1077
1047
  organisation Organisation? @relation(fields: [organisation_id], references: [id], onDelete: SetNull, onUpdate: Cascade)
1078
1048
  job_description JobDescription? @relation(fields: [job_description_id], references: [id], onDelete: SetNull, onUpdate: Cascade)
@@ -1141,7 +1111,6 @@ model Suggestion {
1141
1111
  organisation Organisation @relation(fields: [organisation_id], references: [id], onDelete: Cascade)
1142
1112
 
1143
1113
  @@index([interview_id])
1144
- @@index([transcript_id])
1145
1114
  }
1146
1115
 
1147
1116
  model Transcript {
@@ -1216,7 +1185,6 @@ model User {
1216
1185
  candidateResponses CandidateQuestionResponse[]
1217
1186
  questions Question[]
1218
1187
  ongoing_evaluations OngoingEvaluation[] // optional one-to-many
1219
- candidate_activity_logs ActivityLog[] @relation("CandidateActivityLogs")
1220
1188
  actor_activity_logs ActivityLog[] @relation("ActorActivityLogs")
1221
1189
  actions Action[]
1222
1190
  calendly Calendly?
@@ -1239,6 +1207,7 @@ model User {
1239
1207
  ethnicity String?
1240
1208
  veteran_status String?
1241
1209
  disability_status String?
1210
+ activityLogs ActivityLog[]
1242
1211
 
1243
1212
  @@index([role_id])
1244
1213
  @@index([permission_id])
package/client/wasm.js CHANGED
@@ -165,14 +165,15 @@ exports.Prisma.ActionScalarFieldEnum = {
165
165
 
166
166
  exports.Prisma.ActivityLogScalarFieldEnum = {
167
167
  id: 'id',
168
- candidate_id: 'candidate_id',
168
+ application_id: 'application_id',
169
169
  actor_id: 'actor_id',
170
170
  actor_type: 'actor_type',
171
- action_type: 'action_type',
172
171
  message: 'message',
173
172
  timestamp: 'timestamp',
174
173
  metadata: 'metadata',
175
- created_at: 'created_at'
174
+ created_at: 'created_at',
175
+ is_active: 'is_active',
176
+ userId: 'userId'
176
177
  };
177
178
 
178
179
  exports.Prisma.ApplicationScalarFieldEnum = {
@@ -678,6 +679,7 @@ exports.Prisma.ResumeScalarFieldEnum = {
678
679
  created_by: 'created_by',
679
680
  updated_by: 'updated_by',
680
681
  is_active: 'is_active',
682
+ name: 'name',
681
683
  yearsOfExperience: 'yearsOfExperience'
682
684
  };
683
685
 
@@ -821,18 +823,6 @@ exports.ActivityActorType = exports.$Enums.ActivityActorType = {
821
823
  SYSTEM: 'SYSTEM'
822
824
  };
823
825
 
824
- exports.ActivityActionType = exports.$Enums.ActivityActionType = {
825
- ROUND_COMPLETED: 'ROUND_COMPLETED',
826
- STAGE_CHANGED: 'STAGE_CHANGED',
827
- AI_ANALYSIS_REFRESHED: 'AI_ANALYSIS_REFRESHED',
828
- FEEDBACK_ADDED: 'FEEDBACK_ADDED',
829
- NOTE_ADDED: 'NOTE_ADDED',
830
- INTERVIEW_SCHEDULED: 'INTERVIEW_SCHEDULED',
831
- INTERVIEW_COMPLETED: 'INTERVIEW_COMPLETED',
832
- STATUS_UPDATED: 'STATUS_UPDATED',
833
- OTHER: 'OTHER'
834
- };
835
-
836
826
  exports.ApplicationStatus = exports.$Enums.ApplicationStatus = {
837
827
  PENDING: 'PENDING',
838
828
  IN_PROGRESS: 'IN_PROGRESS',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adaptware/eagles-db",
3
- "version": "0.1.37",
3
+ "version": "0.1.39",
4
4
  "description": "A Prisma client package for Treadspace database operations",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -4,43 +4,21 @@ enum ActivityActorType {
4
4
  SYSTEM
5
5
  }
6
6
 
7
- enum ActivityActionType {
8
- ROUND_COMPLETED
9
- STAGE_CHANGED
10
- AI_ANALYSIS_REFRESHED
11
- FEEDBACK_ADDED
12
- NOTE_ADDED
13
- INTERVIEW_SCHEDULED
14
- INTERVIEW_COMPLETED
15
- STATUS_UPDATED
16
- OTHER
17
- }
18
-
19
- enum ActivitySource {
20
- SYSTEM_TRIGGER
21
- MANUAL_ACTION
22
- API
23
- SCHEDULER
24
- WEBHOOK
25
- }
26
-
27
7
  model ActivityLog {
28
- id String @id @default(uuid())
29
- candidate_id String
30
- actor_id String?
31
- actor_type ActivityActorType
32
- action_type ActivityActionType
33
- message String
34
- timestamp DateTime @default(now())
35
- metadata Json?
36
- created_at DateTime @default(now())
37
-
8
+ id String @id @default(uuid())
9
+ application_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)
38
17
  // Relations
39
- candidate User @relation("CandidateActivityLogs", fields: [candidate_id], references: [id], onDelete: Cascade, onUpdate: Cascade)
40
- actor User? @relation("ActorActivityLogs", fields: [actor_id], references: [id], onDelete: SetNull, onUpdate: Cascade)
18
+ actor User? @relation("ActorActivityLogs", fields: [actor_id], references: [id], onDelete: SetNull, onUpdate: Cascade)
19
+ application Application @relation(fields: [application_id], references: [id], onDelete: Cascade, onUpdate: Cascade)
20
+ user User? @relation(fields: [userId], references: [id])
21
+ userId String?
41
22
 
42
- @@index([candidate_id])
43
- @@index([timestamp])
44
- @@index([candidate_id, timestamp])
45
- @@index([action_type])
23
+ @@index([application_id])
46
24
  }
@@ -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,15 @@ 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
+ activity_logs ActivityLog[]
32
+ // Audit fields
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)
38
38
 
39
39
  @@unique([candidate_id, job_description_id]) // Ensures candidate applies only once per job
40
40
  @@index([candidate_id])
41
41
  @@index([job_description_id])
42
- @@index([organisation_id])
43
- @@index([resume_id])
44
42
  }
@@ -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
  }
@@ -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,29 +43,29 @@ 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
46
  actor_activity_logs ActivityLog[] @relation("ActorActivityLogs")
48
47
  actions Action[]
49
48
  calendly Calendly?
50
49
  google Google?
51
50
  fitChecks FitCheck[]
52
51
 
53
- name String?
54
- phone String?
55
- description String?
56
- date_of_birth DateTime?
57
- designation String?
58
- location String?
59
- salary String?
60
- work_experience Json?
61
- education Json?
62
- skills Json?
63
- notice_period String?
52
+ name String?
53
+ phone String?
54
+ description String?
55
+ date_of_birth DateTime?
56
+ designation String?
57
+ location String?
58
+ salary String?
59
+ work_experience Json?
60
+ education Json?
61
+ skills Json?
62
+ notice_period String?
64
63
  preferred_work_mode String?
65
- gender String?
66
- ethnicity String?
67
- veteran_status String?
68
- disability_status String?
64
+ gender String?
65
+ ethnicity String?
66
+ veteran_status String?
67
+ disability_status String?
68
+ activityLogs ActivityLog[]
69
69
 
70
70
  @@index([role_id])
71
71
  @@index([permission_id])