@adaptware/eagles-db 0.5.59 → 0.5.60

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adaptware/eagles-db",
3
- "version": "0.5.59",
3
+ "version": "0.5.60",
4
4
  "description": "A Prisma client package for Treadspace database operations",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
package/prisma/.DS_Store CHANGED
Binary file
@@ -0,0 +1,2 @@
1
+ -- Migrate legacy terminal-positive status to SELECTED (SHORTLISTED enum value retained but unused).
2
+ UPDATE applications SET status = 'SELECTED' WHERE status = 'SHORTLISTED';
Binary file
@@ -6,39 +6,54 @@ enum FitCheckStatus {
6
6
  @@schema("public")
7
7
  }
8
8
 
9
+ /// 5-level current evaluation. LEVEL_1 is weakest, LEVEL_5 is strongest.
10
+ /// Display copy and numeric rank live in backend `CurrentEvaluationMapper`.
11
+ enum CurrentEvaluation {
12
+ LEVEL_1
13
+ LEVEL_2
14
+ LEVEL_3
15
+ LEVEL_4
16
+ LEVEL_5
17
+
18
+ @@schema("public")
19
+ }
20
+
9
21
  model FitCheck {
10
22
  /// Primary key (UUID)
11
- id String @id @default(uuid())
23
+ id String @id @default(uuid())
12
24
  /// FK to organisations table
13
- organisation_id String?
14
- candidate_id String?
15
- resume_id String
16
- job_description_id String
25
+ organisation_id String?
26
+ candidate_id String?
27
+ resume_id String
28
+ job_description_id String
17
29
  /// Owning application (inverted from Application.fit_check_id)
18
- application_id String? @unique
19
- skills_analysis Json?
20
- overall_analysis Json?
21
- overall_score Float
30
+ application_id String? @unique
31
+ skills_analysis Json?
32
+ overall_analysis Json?
33
+ overall_score Float
22
34
  /// Free-text from Overall Analysis agent; preferred over recommendation Json.
23
35
  overall_recommendation String?
24
36
  /// Why `overall_score` is this value. Distinct from `overall_recommendation`.
25
- score_reasoning String?
26
- short_match_analysis Json[]
27
- fit_comparison Json?
28
- recommendation Json?
29
- competencies_analysis Json?
37
+ score_reasoning String?
38
+ /// 5-level current evaluation (`CurrentEvaluation`). Independent of overall_score.
39
+ current_evaluation CurrentEvaluation?
40
+ short_match_analysis Json[]
41
+ fit_comparison Json?
42
+ recommendation Json?
43
+ competencies_analysis Json?
44
+ competencies_verdict Json?
30
45
  /// Audit fields
31
- created_by String
32
- updated_by String
33
- is_active Boolean @default(true)
34
- created_at DateTime @default(now())
35
- updated_at DateTime @updatedAt
46
+ created_by String
47
+ updated_by String
48
+ is_active Boolean @default(true)
49
+ created_at DateTime @default(now())
50
+ updated_at DateTime @updatedAt
36
51
  /// Relations
37
- organisation Organisation? @relation(fields: [organisation_id], references: [id], onDelete: Cascade, onUpdate: Cascade)
38
- candidate User? @relation(fields: [candidate_id], references: [id], onDelete: Cascade, onUpdate: Cascade)
39
- resume Resume @relation(fields: [resume_id], references: [id], onDelete: Cascade, onUpdate: Cascade)
40
- job_description JobDescription @relation(fields: [job_description_id], references: [id], onDelete: Cascade, onUpdate: Cascade)
41
- application Application? @relation(fields: [application_id], references: [id], onDelete: Cascade, onUpdate: Cascade)
52
+ organisation Organisation? @relation(fields: [organisation_id], references: [id], onDelete: Cascade, onUpdate: Cascade)
53
+ candidate User? @relation(fields: [candidate_id], references: [id], onDelete: Cascade, onUpdate: Cascade)
54
+ resume Resume @relation(fields: [resume_id], references: [id], onDelete: Cascade, onUpdate: Cascade)
55
+ job_description JobDescription @relation(fields: [job_description_id], references: [id], onDelete: Cascade, onUpdate: Cascade)
56
+ application Application? @relation(fields: [application_id], references: [id], onDelete: Cascade, onUpdate: Cascade)
42
57
 
43
58
  /// Ensure one FitCheck per (resume_id, job_description_id) pair
44
59
  @@unique([resume_id, job_description_id])
@@ -52,7 +52,6 @@ model Interview {
52
52
  recording_url String?
53
53
  recording_document_id String? @unique
54
54
  evaluation_type EvaluationType? @default(TREADSPACE_AI_ASSISTED)
55
- is_proctored Boolean @default(true) @map("is_proctored")
56
55
  ai_assistance_mode AiAssistanceMode? @default(ASSISTED)
57
56
  interview_status InterviewStatus @default(SCHEDULED)
58
57
  interview_platform InterviewPlatform @default(TREADSPACE)
@@ -98,11 +97,6 @@ model Interview {
98
97
  created_by String
99
98
  updated_by String
100
99
  is_active Boolean @default(true)
101
-
102
-
103
- //interview proctoring
104
- proctoringSession ProctoringSession?
105
-
106
100
  // Relations
107
101
  candidate User? @relation("CandidateInterviews", fields: [candidate_id], references: [id], onDelete: SetNull)
108
102
  interviewer User? @relation("InterviewerInterviews", fields: [interviewer_id], references: [id], onDelete: SetNull)
@@ -0,0 +1,3 @@
1
+ -- 5-level current evaluation label (string, not enum) and numeric sort rank.
2
+ ALTER TABLE "FitCheck" ADD COLUMN IF NOT EXISTS "current_evaluation" TEXT;
3
+ ALTER TABLE "FitCheck" ADD COLUMN IF NOT EXISTS "current_evaluation_score" DOUBLE PRECISION;
@@ -0,0 +1,16 @@
1
+ -- Replace unused TEXT + score columns with a single CurrentEvaluation enum.
2
+ -- LEVEL_1 is weakest, LEVEL_5 is strongest (Postgres enum order; ORDER BY DESC = strongest first).
3
+
4
+ CREATE TYPE "public"."CurrentEvaluation" AS ENUM (
5
+ 'LEVEL_1',
6
+ 'LEVEL_2',
7
+ 'LEVEL_3',
8
+ 'LEVEL_4',
9
+ 'LEVEL_5'
10
+ );
11
+
12
+ ALTER TABLE "FitCheck" DROP COLUMN IF EXISTS "current_evaluation_score";
13
+
14
+ ALTER TABLE "FitCheck" DROP COLUMN IF EXISTS "current_evaluation";
15
+
16
+ ALTER TABLE "FitCheck" ADD COLUMN "current_evaluation" "public"."CurrentEvaluation";
@@ -0,0 +1,2 @@
1
+ -- Category-level competency verdict summaries from FitCheck Competency Verdict agent.
2
+ ALTER TABLE "FitCheck" ADD COLUMN IF NOT EXISTS "competencies_verdict" JSONB;
@@ -75,9 +75,6 @@ model User {
75
75
  notes Notes[]
76
76
  recruiter_applications Application[] @relation("ApplicationRecruiter")
77
77
 
78
- // user proctoring
79
- proctoringSessions ProctoringSession[]
80
-
81
78
  name String?
82
79
  phone String?
83
80
  /// Contact email for interviews, assessments, and resume export. Login stays on `email`.
Binary file
@@ -1,5 +0,0 @@
1
- -- AlterTable: Add is_proctored to Interview
2
- ALTER TABLE "Interview" ADD COLUMN IF NOT EXISTS "is_proctored" BOOLEAN NOT NULL DEFAULT true;
3
-
4
- -- AlterTable: Add is_proctored to proctoring_sessions
5
- ALTER TABLE "proctoring_sessions" ADD COLUMN IF NOT EXISTS "is_proctored" BOOLEAN NOT NULL DEFAULT true;
@@ -1,126 +0,0 @@
1
- enum RiskLevel {
2
- LOW
3
- MEDIUM
4
- HIGH
5
- CRITICAL
6
-
7
- @@schema("public")
8
- }
9
-
10
- enum AnalysisStatus {
11
- QUEUED
12
- RUNNING
13
- COMPLETED
14
- FAILED
15
-
16
- @@schema("public")
17
- }
18
-
19
- enum ProctoringEventType {
20
- GAZE_DISRUPTION
21
- OBJECT_DETECTED
22
- FACE_MISSING
23
- MULTIPLE_FACES
24
- BROWSER_TAB_SWITCH
25
- BROWSER_BLUR
26
- FULLSCREEN_EXIT
27
-
28
- @@schema("public")
29
- }
30
-
31
- enum ProctoringSessionStatus {
32
- NOT_STARTED
33
- CALIBRATING
34
- CALIBRATED
35
- PROCESSING
36
- COMPLETED
37
- FAILED
38
-
39
- @@schema("public")
40
- }
41
-
42
- model ProctoringSession {
43
- id String @id @default(uuid()) @map("id")
44
- interviewId String @unique @map("interview_id")
45
- interview Interview @relation(fields: [interviewId], references: [id], onDelete: Cascade)
46
-
47
- candidateId String @map("candidate_id")
48
- candidate User @relation(fields: [candidateId], references: [id], onDelete: Cascade)
49
-
50
- // Proctoring Lifecycle & Media
51
- isProctored Boolean @default(true) @map("is_proctored")
52
- status ProctoringSessionStatus @default(NOT_STARTED) @map("status")
53
- calibrationFeatures Json? @map("calibration_features")
54
- fullVideoKey String? @map("full_video_key")
55
- fullVideoUrl String? @map("full_video_url")
56
- chunkCount Int @default(0) @map("chunk_count")
57
- completedChunks Int @default(0) @map("completed_chunks")
58
-
59
- // High-Level Aggregated Metrics for Downstream AI Evaluation
60
- overallRisk RiskLevel @default(LOW) @map("overall_risk")
61
- integrityScore Float @default(100.0) @map("integrity_score")
62
-
63
- totalDurationSec Float @default(0.0) @map("total_duration_sec")
64
- faceDetectedPct Float @default(100.0) @map("face_detected_pct")
65
- onScreenGazePct Float @default(100.0) @map("on_screen_gaze_pct")
66
-
67
- // Event Counters
68
- totalGazeEvents Int @default(0) @map("total_gaze_events")
69
- totalObjectEvents Int @default(0) @map("total_object_events")
70
- totalFaceEvents Int @default(0) @map("total_face_events")
71
- totalBrowserEvents Int @default(0) @map("total_browser_events")
72
-
73
- createdAt DateTime @default(now()) @map("created_at")
74
- updatedAt DateTime @updatedAt @map("updated_at")
75
-
76
- analyses ProctoringAnalysis[]
77
- events ProctoringEvent[]
78
-
79
- @@index([candidateId])
80
- @@map("proctoring_sessions")
81
- @@schema("public")
82
- }
83
-
84
- model ProctoringAnalysis {
85
- id String @id @default(uuid()) @map("id")
86
- sessionId String @map("session_id")
87
- session ProctoringSession @relation(fields: [sessionId], references: [id], onDelete: Cascade)
88
-
89
- status AnalysisStatus @default(QUEUED)
90
-
91
- chunkIndex Int @default(0) @map("chunk_index")
92
- totalChunks Int @default(1) @map("total_chunks")
93
- startTimeSec Float @default(0.0) @map("start_time_sec")
94
- endTimeSec Float @default(0.0) @map("end_time_sec")
95
-
96
- videoKey String? @map("video_key")
97
- annotatedKey String? @map("annotated_key")
98
-
99
- error String?
100
- createdAt DateTime @default(now()) @map("created_at")
101
- updatedAt DateTime @updatedAt @map("updated_at")
102
-
103
- @@index([sessionId, chunkIndex])
104
- @@map("proctoring_analyses")
105
- @@schema("public")
106
- }
107
-
108
- model ProctoringEvent {
109
- id String @id @default(uuid()) @map("id")
110
- sessionId String @map("session_id")
111
- session ProctoringSession @relation(fields: [sessionId], references: [id], onDelete: Cascade)
112
-
113
- eventType ProctoringEventType @map("event_type")
114
- timestampSec Float @map("timestamp_sec")
115
- timestampStr String @map("timestamp_str")
116
-
117
- risk RiskLevel @default(LOW)
118
- metadata Json?
119
-
120
- createdAt DateTime @default(now()) @map("created_at")
121
-
122
- @@index([sessionId, timestampSec])
123
- @@index([sessionId, eventType])
124
- @@map("proctoring_events")
125
- @@schema("public")
126
- }