@adaptware/eagles-db 0.1.35 → 0.1.37

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-d8b906f5045b32feb05d0a6f29f5c617815d470b2ff0cbbd6faf541af315ed2c",
2
+ "name": "prisma-client-9cd12895fc83544f1eb274541a2d65d3cdbd6e8f5f8d8a6f54ce5de255b139bc",
3
3
  "main": "index.js",
4
4
  "types": "index.d.ts",
5
5
  "browser": "index-browser.js",
@@ -77,6 +77,53 @@ model Action {
77
77
  @@index([due_date])
78
78
  }
79
79
 
80
+ enum ActivityActorType {
81
+ USER
82
+ AI
83
+ SYSTEM
84
+ }
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
+ 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
+
117
+ // 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)
120
+
121
+ @@index([candidate_id])
122
+ @@index([timestamp])
123
+ @@index([candidate_id, timestamp])
124
+ @@index([action_type])
125
+ }
126
+
80
127
  // PENDING could be understood as unscreened
81
128
  enum ApplicationStatus {
82
129
  PENDING
@@ -465,6 +512,7 @@ model FitCheck {
465
512
  id String @id @default(uuid())
466
513
  /// FK to organisations table
467
514
  organisation_id String?
515
+ candidate_id String?
468
516
  resume_id String
469
517
  job_description_id String
470
518
 
@@ -502,6 +550,7 @@ model FitCheck {
502
550
  updated_at DateTime @updatedAt
503
551
  /// Relations
504
552
  organisation Organisation? @relation(fields: [organisation_id], references: [id], onDelete: Cascade, onUpdate: Cascade)
553
+ candidate User? @relation(fields: [candidate_id], references: [id], onDelete: Cascade, onUpdate: Cascade)
505
554
  resume Resume @relation(fields: [resume_id], references: [id], onDelete: Cascade, onUpdate: Cascade)
506
555
  job_description JobDescription @relation(fields: [job_description_id], references: [id], onDelete: Cascade, onUpdate: Cascade)
507
556
  application Application?
@@ -1167,9 +1216,12 @@ model User {
1167
1216
  candidateResponses CandidateQuestionResponse[]
1168
1217
  questions Question[]
1169
1218
  ongoing_evaluations OngoingEvaluation[] // optional one-to-many
1219
+ candidate_activity_logs ActivityLog[] @relation("CandidateActivityLogs")
1220
+ actor_activity_logs ActivityLog[] @relation("ActorActivityLogs")
1170
1221
  actions Action[]
1171
1222
  calendly Calendly?
1172
1223
  google Google?
1224
+ fitChecks FitCheck[]
1173
1225
 
1174
1226
  name String?
1175
1227
  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
+ action_type: 'action_type',
172
+ message: 'message',
173
+ timestamp: 'timestamp',
174
+ metadata: 'metadata',
175
+ created_at: 'created_at'
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',
@@ -802,6 +815,24 @@ exports.ActionStatus = exports.$Enums.ActionStatus = {
802
815
  CANCELLED: 'CANCELLED'
803
816
  };
804
817
 
818
+ exports.ActivityActorType = exports.$Enums.ActivityActorType = {
819
+ USER: 'USER',
820
+ AI: 'AI',
821
+ SYSTEM: 'SYSTEM'
822
+ };
823
+
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
+
805
836
  exports.ApplicationStatus = exports.$Enums.ApplicationStatus = {
806
837
  PENDING: 'PENDING',
807
838
  IN_PROGRESS: 'IN_PROGRESS',
@@ -996,6 +1027,7 @@ exports.Prisma.ModelName = {
996
1027
  CandidateQuestionResponse: 'CandidateQuestionResponse',
997
1028
  UserRole: 'UserRole',
998
1029
  Action: 'Action',
1030
+ ActivityLog: 'ActivityLog',
999
1031
  Application: 'Application',
1000
1032
  Approval: 'Approval',
1001
1033
  Assessment: 'Assessment',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adaptware/eagles-db",
3
- "version": "0.1.35",
3
+ "version": "0.1.37",
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,46 @@
1
+ enum ActivityActorType {
2
+ USER
3
+ AI
4
+ SYSTEM
5
+ }
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
+ 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
+
38
+ // 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)
41
+
42
+ @@index([candidate_id])
43
+ @@index([timestamp])
44
+ @@index([candidate_id, timestamp])
45
+ @@index([action_type])
46
+ }
@@ -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?
@@ -1,17 +1,18 @@
1
1
  model Resume {
2
- id String @id @default(uuid())
2
+ id String @id @default(uuid())
3
3
  user_id String?
4
4
  organisation_id String?
5
5
  job_description_id String?
6
6
  uploaded_resume_path String?
7
- created_at DateTime @default(now())
8
- updated_at DateTime @updatedAt
7
+ created_at DateTime @default(now())
8
+ updated_at DateTime @updatedAt
9
9
  created_by String
10
10
  updated_by String
11
- is_active Boolean @default(true)
12
- user User? @relation(fields: [user_id], references: [id], onDelete: SetNull, onUpdate: Cascade)
13
- organisation Organisation? @relation(fields: [organisation_id], references: [id], onDelete: SetNull, onUpdate: Cascade)
14
- job_description JobDescription? @relation(fields: [job_description_id], references: [id], onDelete: SetNull, onUpdate: Cascade)
11
+ is_active Boolean @default(true)
12
+ name String?
13
+ user User? @relation(fields: [user_id], references: [id], onDelete: SetNull, onUpdate: Cascade)
14
+ organisation Organisation? @relation(fields: [organisation_id], references: [id], onDelete: SetNull, onUpdate: Cascade)
15
+ job_description JobDescription? @relation(fields: [job_description_id], references: [id], onDelete: SetNull, onUpdate: Cascade)
15
16
  applications Application[]
16
17
  interviews Interview[]
17
18
  ongoing_evaluations OngoingEvaluation[] // optional one-to-many
@@ -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?