@adaptware/eagles-db 0.4.36 → 0.4.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.
Files changed (86) hide show
  1. package/client/edge.js +870 -10
  2. package/client/index-browser.js +901 -40
  3. package/client/index.d.ts +81764 -27557
  4. package/client/index.js +870 -10
  5. package/client/libquery_engine-darwin.dylib.node +0 -0
  6. package/client/package.json +1 -1
  7. package/client/schema.prisma +1580 -108
  8. package/client/wasm.js +870 -10
  9. package/package.json +1 -1
  10. package/prisma/.DS_Store +0 -0
  11. package/prisma/migrations/20260519120000_migrate_shortlisted_to_selected/migration.sql +2 -0
  12. package/prisma/schema/.DS_Store +0 -0
  13. package/prisma/schema/CandidateQuestionResponse.prisma +1 -0
  14. package/prisma/schema/UserRole.prisma +1 -0
  15. package/prisma/schema/action.prisma +5 -0
  16. package/prisma/schema/activityEvent.prisma +138 -0
  17. package/prisma/schema/activityLog.prisma +3 -0
  18. package/prisma/schema/applicationAnalytics.prisma +87 -0
  19. package/prisma/schema/applications.prisma +12 -2
  20. package/prisma/schema/approval.prisma +2 -0
  21. package/prisma/schema/assessment.prisma +1 -0
  22. package/prisma/schema/assessmentLibrary.prisma +1 -0
  23. package/prisma/schema/assessmentQuestion.prisma +1 -0
  24. package/prisma/schema/assessmentRoundAnalytics.prisma +119 -0
  25. package/prisma/schema/assignment.prisma +3 -0
  26. package/prisma/schema/assignmentLibrary.prisma +1 -0
  27. package/prisma/schema/assignmentRoundAnalytics.prisma +109 -0
  28. package/prisma/schema/authModule.prisma +3 -0
  29. package/prisma/schema/budget.prisma +6 -0
  30. package/prisma/schema/calendly.prisma +2 -0
  31. package/prisma/schema/candidateProfile.prisma +2 -0
  32. package/prisma/schema/communication.prisma +11 -0
  33. package/prisma/schema/contactUs.prisma +2 -0
  34. package/prisma/schema/document.prisma +5 -4
  35. package/prisma/schema/evaluationPlan.prisma +35 -10
  36. package/prisma/schema/feedback.prisma +1 -0
  37. package/prisma/schema/fitCheck.prisma +3 -0
  38. package/prisma/schema/google.prisma +2 -0
  39. package/prisma/schema/integration.prisma +13 -0
  40. package/prisma/schema/interview.prisma +9 -0
  41. package/prisma/schema/interviewNotes.prisma +1 -0
  42. package/prisma/schema/interviewRoundAnalytics.prisma +140 -0
  43. package/prisma/schema/interviewerAnalytics.prisma +129 -0
  44. package/prisma/schema/jobApplicationFields.prisma +3 -0
  45. package/prisma/schema/jobApplicationResponse.prisma +1 -0
  46. package/prisma/schema/jobApplicationTemplate.prisma +3 -0
  47. package/prisma/schema/jobDescription.prisma +43 -35
  48. package/prisma/schema/jobDescriptionData.prisma +1 -0
  49. package/prisma/schema/jobProfile.prisma +3 -0
  50. package/prisma/schema/jobRoundAnalytics.prisma +101 -0
  51. package/prisma/schema/liveAnalysis.prisma +1 -0
  52. package/prisma/schema/message.prisma +2 -0
  53. package/prisma/schema/migrations/20260519120000_add_analytics_schema/migration.sql +84 -0
  54. package/prisma/schema/migrations/20260625120000_add_interviewer_analytics/migration.sql +26 -0
  55. package/prisma/schema/migrations/20260629120000_add_user_lifecycle_activity_events/migration.sql +13 -0
  56. package/prisma/schema/migrations/20260629140000_drop_organisation_org_code/migration.sql +2 -0
  57. package/prisma/schema/migrations/20260629160000_employee_codes_dual_interviewer_analytics/migration.sql +87 -0
  58. package/prisma/schema/migrations/20260630120000_add_application_sources/migration.sql +38 -0
  59. package/prisma/schema/migrations/20260701120000_add_source_effectiveness_analytics/migration.sql +40 -0
  60. package/prisma/schema/migrations/20260702120000_add_analytics_daily_tables/migration.sql +232 -0
  61. package/prisma/schema/migrations/{20260710120000_add_resume_rendered_export_fields → 20260706120000_add_resume_rendered_export}/migration.sql +5 -2
  62. package/prisma/schema/notes.prisma +1 -0
  63. package/prisma/schema/ongoingEvaluation.prisma +7 -0
  64. package/prisma/schema/openJobAnalytics.prisma +81 -0
  65. package/prisma/schema/organisation.prisma +39 -31
  66. package/prisma/schema/organisationConfig.prisma +1 -0
  67. package/prisma/schema/permission.prisma +1 -0
  68. package/prisma/schema/pipelineDistributionAnalytics.prisma +64 -0
  69. package/prisma/schema/promise.prisma +3 -0
  70. package/prisma/schema/questions.prisma +4 -0
  71. package/prisma/schema/refreshToken.prisma +2 -0
  72. package/prisma/schema/reportingOverviewJobAnalytics.prisma +49 -0
  73. package/prisma/schema/resume.prisma +5 -4
  74. package/prisma/schema/resumeData.prisma +1 -0
  75. package/prisma/schema/roundAnalytics.prisma +145 -0
  76. package/prisma/schema/schema.prisma +2 -0
  77. package/prisma/schema/source.prisma +36 -0
  78. package/prisma/schema/sourceEffectivenessAnalytics.prisma +79 -0
  79. package/prisma/schema/suggestion.prisma +1 -0
  80. package/prisma/schema/transcript.prisma +1 -0
  81. package/prisma/schema/user.prisma +10 -0
  82. package/prisma/schema/userProfile.prisma +2 -0
  83. package/prisma/schema/zoomMeeting.prisma +5 -0
  84. package/prisma/schema/migrations/20260522120000_ongoing_evaluation_record_kind/migration.sql +0 -25
  85. package/prisma/schema/migrations/20260523120000_replace_record_kind_with_is_committed/migration.sql +0 -24
  86. package/prisma/schema/migrations/20260528120000_drop_job_description_recommendation_config/migration.sql +0 -2
@@ -12,4 +12,5 @@ model ResumeData {
12
12
  resume Resume @relation(fields: [resume_id], references: [id], onDelete: Cascade, onUpdate: Cascade)
13
13
 
14
14
  @@index([created_at])
15
+ @@schema("public")
15
16
  }
@@ -0,0 +1,145 @@
1
+ enum RoundResult {
2
+ PASSED
3
+ FAILED
4
+
5
+ @@schema("analytics")
6
+ }
7
+
8
+ model RoundAnalytics {
9
+ id String @id @default(uuid())
10
+
11
+ // Core Dimensions
12
+ organisation_id String
13
+
14
+ application_id String
15
+
16
+ candidate_id String
17
+
18
+ job_description_id String
19
+
20
+ evaluation_plan_id String
21
+
22
+ round_id String @unique
23
+
24
+ // Round Information
25
+ round_name String?
26
+
27
+ evaluation_category EvaluationCategory?
28
+
29
+ round_type RoundType?
30
+
31
+ // Lifecycle Timestamps
32
+ assigned_at DateTime?
33
+
34
+ scheduled_at DateTime?
35
+
36
+ started_at DateTime?
37
+
38
+ completed_at DateTime?
39
+
40
+ evaluated_at DateTime?
41
+
42
+ round_completed_at DateTime?
43
+ round_created_at DateTime?
44
+
45
+ // Decision
46
+ round_result RoundResult?
47
+
48
+ round_result_at DateTime?
49
+
50
+ // Derived Metrics
51
+ scheduling_duration_minutes Int?
52
+
53
+ round_duration_minutes Int?
54
+
55
+ feedback_duration_minutes Int?
56
+
57
+ decision_duration_minutes Int?
58
+
59
+ total_round_duration_minutes Int?
60
+
61
+ is_custom Boolean @default(false)
62
+
63
+ // Audit
64
+ created_at DateTime @default(now())
65
+
66
+ updated_at DateTime @updatedAt
67
+
68
+ @@index([organisation_id])
69
+ @@index([job_description_id])
70
+ @@index([application_id])
71
+ @@index([candidate_id])
72
+ @@index([evaluation_category])
73
+ @@index([round_result])
74
+ @@map("round_analytics")
75
+ @@schema("analytics")
76
+ }
77
+
78
+ model RoundAnalyticsDaily {
79
+ id String @id @default(uuid())
80
+
81
+ snapshot_date DateTime @db.Date
82
+
83
+ // Core Dimensions
84
+ organisation_id String
85
+
86
+ application_id String
87
+
88
+ candidate_id String
89
+
90
+ job_description_id String
91
+
92
+ evaluation_plan_id String
93
+
94
+ round_id String
95
+
96
+ // Round Information
97
+ round_name String?
98
+
99
+ evaluation_category EvaluationCategory?
100
+
101
+ round_type RoundType?
102
+
103
+ // Lifecycle Timestamps
104
+ assigned_at DateTime?
105
+
106
+ scheduled_at DateTime?
107
+
108
+ started_at DateTime?
109
+
110
+ completed_at DateTime?
111
+
112
+ evaluated_at DateTime?
113
+
114
+ round_completed_at DateTime?
115
+ round_created_at DateTime?
116
+
117
+ // Decision
118
+ round_result RoundResult?
119
+
120
+ round_result_at DateTime?
121
+
122
+ // Derived Metrics
123
+ scheduling_duration_minutes Int?
124
+
125
+ round_duration_minutes Int?
126
+
127
+ feedback_duration_minutes Int?
128
+
129
+ decision_duration_minutes Int?
130
+
131
+ total_round_duration_minutes Int?
132
+
133
+ is_custom Boolean @default(false)
134
+
135
+ @@unique([snapshot_date, round_id])
136
+ @@index([snapshot_date], map: "rad_snapshot_date_idx")
137
+ @@index([snapshot_date, organisation_id], map: "rad_snapshot_org_idx")
138
+ @@index([snapshot_date, job_description_id], map: "rad_snapshot_job_idx")
139
+ @@index([snapshot_date, application_id], map: "rad_snapshot_app_idx")
140
+ @@index([snapshot_date, candidate_id], map: "rad_snapshot_candidate_idx")
141
+ @@index([snapshot_date, evaluation_category], map: "rad_snapshot_eval_cat_idx")
142
+ @@index([snapshot_date, round_result], map: "rad_snapshot_round_result_idx")
143
+ @@map("round_analytics_daily")
144
+ @@schema("analytics")
145
+ }
@@ -13,4 +13,6 @@ generator client {
13
13
  datasource db {
14
14
  provider = "postgresql"
15
15
  url = env("DATABASE_URL")
16
+
17
+ schemas = ["public", "analytics"]
16
18
  }
@@ -0,0 +1,36 @@
1
+ enum SourceCategory {
2
+ JOB_BOARD
3
+ REFERRAL
4
+ AGENCY
5
+ SOCIAL_MEDIA
6
+ CAREERS_PAGE
7
+ EVENT
8
+ OTHER
9
+
10
+ @@schema("public")
11
+ }
12
+
13
+ model Source {
14
+ id String @id @default(uuid())
15
+ organisation_id String
16
+ name String
17
+ category SourceCategory?
18
+ parent_source_id String?
19
+ colour String?
20
+ description String?
21
+ is_active Boolean @default(true)
22
+ created_at DateTime @default(now())
23
+ updated_at DateTime @updatedAt
24
+
25
+ organisation Organisation @relation(fields: [organisation_id], references: [id], onDelete: Cascade)
26
+ parent Source? @relation("SourceHierarchy", fields: [parent_source_id], references: [id], onDelete: SetNull)
27
+ children Source[] @relation("SourceHierarchy")
28
+ applications Application[]
29
+
30
+ @@unique([organisation_id, name])
31
+ @@index([organisation_id])
32
+ @@index([organisation_id, category])
33
+ @@index([organisation_id, is_active])
34
+ @@index([parent_source_id])
35
+ @@schema("public")
36
+ }
@@ -0,0 +1,79 @@
1
+ model SourceEffectivenessAnalytics {
2
+ id String @id @default(uuid())
3
+ organisation_id String
4
+ job_description_id String
5
+ source_id String
6
+
7
+ source_name String
8
+ source_category SourceCategory?
9
+ source_colour String?
10
+ job_code String?
11
+ job_number Int?
12
+ role_title String?
13
+ hiring_manager_id String?
14
+
15
+ applications_count Int @default(0)
16
+ screened_count Int @default(0)
17
+ evaluated_count Int @default(0)
18
+ rejected_count Int @default(0)
19
+ shortlisted_count Int @default(0)
20
+ offered_count Int @default(0)
21
+ offer_accepted_count Int @default(0)
22
+ offer_declined_count Int @default(0)
23
+ withdrawn_count Int @default(0)
24
+ hired_count Int @default(0)
25
+
26
+ total_fit_score Float @default(0)
27
+ fit_score_sample_count Int @default(0)
28
+ average_fit_score Float?
29
+
30
+ updated_at DateTime @updatedAt
31
+
32
+ @@unique([organisation_id, job_description_id, source_id])
33
+ @@index([organisation_id])
34
+ @@index([organisation_id, source_id])
35
+ @@index([organisation_id, hiring_manager_id])
36
+ @@index([job_description_id])
37
+ @@map("source_effectiveness_analytics")
38
+ @@schema("analytics")
39
+ }
40
+
41
+ model SourceEffectivenessAnalyticsDaily {
42
+ id String @id @default(uuid())
43
+ snapshot_date DateTime @db.Date
44
+ organisation_id String
45
+ job_description_id String
46
+ source_id String
47
+
48
+ source_name String
49
+ source_category SourceCategory?
50
+ source_colour String?
51
+ job_code String?
52
+ job_number Int?
53
+ role_title String?
54
+ hiring_manager_id String?
55
+
56
+ applications_count Int @default(0)
57
+ screened_count Int @default(0)
58
+ evaluated_count Int @default(0)
59
+ rejected_count Int @default(0)
60
+ shortlisted_count Int @default(0)
61
+ offered_count Int @default(0)
62
+ offer_accepted_count Int @default(0)
63
+ offer_declined_count Int @default(0)
64
+ withdrawn_count Int @default(0)
65
+ hired_count Int @default(0)
66
+
67
+ total_fit_score Float @default(0)
68
+ fit_score_sample_count Int @default(0)
69
+ average_fit_score Float?
70
+
71
+ @@unique([snapshot_date, organisation_id, job_description_id, source_id])
72
+ @@index([snapshot_date], map: "sead_snapshot_date_idx")
73
+ @@index([snapshot_date, organisation_id], map: "sead_snapshot_org_idx")
74
+ @@index([snapshot_date, organisation_id, source_id], map: "sead_snapshot_org_source_idx")
75
+ @@index([snapshot_date, organisation_id, hiring_manager_id], map: "sead_snapshot_org_hm_idx")
76
+ @@index([snapshot_date, job_description_id], map: "sead_snapshot_job_idx")
77
+ @@map("source_effectiveness_analytics_daily")
78
+ @@schema("analytics")
79
+ }
@@ -17,4 +17,5 @@ model Suggestion {
17
17
  organisation Organisation @relation(fields: [organisation_id], references: [id], onDelete: Cascade)
18
18
 
19
19
  @@index([interview_id])
20
+ @@schema("public")
20
21
  }
@@ -22,4 +22,5 @@ model Transcript {
22
22
  @@unique([interview_id, order_no])
23
23
  @@index([interview_id])
24
24
  @@index([job_description_id])
25
+ @@schema("public")
25
26
  }
@@ -1,12 +1,16 @@
1
1
  enum FirstLoginStatus {
2
2
  PENDING
3
3
  COMPLETED
4
+
5
+ @@schema("public")
4
6
  }
5
7
 
6
8
  enum UserInvitationStatus {
7
9
  INVITED
8
10
  ACCEPTED
9
11
  EXPIRED
12
+
13
+ @@schema("public")
10
14
  }
11
15
 
12
16
  model User {
@@ -67,6 +71,7 @@ model User {
67
71
  refresh_token_auth RefreshToken[] @relation("TokenRefresh")
68
72
  zoom_meeting_participants ZoomMeetingParticipant[]
69
73
  notes Notes[]
74
+ recruiter_applications Application[] @relation("ApplicationRecruiter")
70
75
 
71
76
  name String?
72
77
  phone String?
@@ -87,7 +92,12 @@ model User {
87
92
  professional_expertise String?
88
93
  documents Document[]
89
94
 
95
+ employee_number Int?
96
+ employee_code String? @unique
97
+
90
98
  @@index([role_id])
91
99
  @@index([permission_id])
92
100
  @@index([organisation_id])
101
+ @@index([organisation_id, employee_number])
102
+ @@schema("public")
93
103
  }
@@ -12,4 +12,6 @@ model UserProfile {
12
12
  user_id String? @unique
13
13
 
14
14
  work_experience Json?
15
+
16
+ @@schema("public")
15
17
  }
@@ -2,6 +2,8 @@
2
2
  enum ZoomMeetingParticipantRole {
3
3
  CANDIDATE
4
4
  INTERVIEWER
5
+
6
+ @@schema("public")
5
7
  }
6
8
 
7
9
  /// Zoom meeting linked 1:1 to an interview; Zoom REST host is `zoom_host_user_id`.
@@ -40,6 +42,7 @@ model ZoomMeeting {
40
42
  @@index([interview_id])
41
43
  @@index([zoom_meeting_id])
42
44
  @@index([zoom_meeting_uuid])
45
+ @@schema("public")
43
46
  }
44
47
 
45
48
  /// Expected participants for a `ZoomMeeting`: links to `User` (candidate / interviewer). Replaced on each meeting upsert.
@@ -63,6 +66,7 @@ model ZoomMeetingParticipant {
63
66
  @@index([zoom_meeting_row_id])
64
67
  @@index([user_id])
65
68
  @@index([zoom_participant_id])
69
+ @@schema("public")
66
70
  }
67
71
 
68
72
  /// Ledger of processed Zoom webhook deliveries: one row per `dedupe_key` (request id or body hash).
@@ -76,4 +80,5 @@ model ZoomWebhookEvent {
76
80
 
77
81
  @@index([event])
78
82
  @@index([created_at])
83
+ @@schema("public")
79
84
  }
@@ -1,25 +0,0 @@
1
- -- Safe to re-run: adds record_kind without breaking existing ongoing evaluations.
2
-
3
- DO $$ BEGIN
4
- CREATE TYPE "OngoingEvaluationRecordKind" AS ENUM (
5
- 'AI_RECOMMENDED',
6
- 'PLAN_SELECTED',
7
- 'COMMITTED'
8
- );
9
- EXCEPTION
10
- WHEN duplicate_object THEN NULL;
11
- END $$;
12
-
13
- ALTER TABLE "OngoingEvaluation"
14
- ADD COLUMN IF NOT EXISTS "record_kind" "OngoingEvaluationRecordKind";
15
-
16
- ALTER TABLE "OngoingEvaluation"
17
- ALTER COLUMN "evaluation_plan_id" DROP NOT NULL;
18
-
19
- -- All existing rows are real pipeline rounds — not pre-Proceed drafts.
20
- UPDATE "OngoingEvaluation"
21
- SET "record_kind" = 'COMMITTED'
22
- WHERE "record_kind" IS NULL;
23
-
24
- CREATE INDEX IF NOT EXISTS "OngoingEvaluation_application_id_record_kind_idx"
25
- ON "OngoingEvaluation"("application_id", "record_kind");
@@ -1,24 +0,0 @@
1
- -- Replace record_kind enum with is_committed (null = legacy, false = draft, true = committed).
2
-
3
- ALTER TABLE "OngoingEvaluation"
4
- ADD COLUMN IF NOT EXISTS "is_committed" BOOLEAN;
5
-
6
- UPDATE "OngoingEvaluation"
7
- SET "is_committed" = false
8
- WHERE "record_kind" IN ('AI_RECOMMENDED', 'PLAN_SELECTED');
9
-
10
- UPDATE "OngoingEvaluation"
11
- SET "is_committed" = true
12
- WHERE "record_kind" = 'COMMITTED';
13
-
14
- -- Legacy rows without record_kind stay null (treated as committed in app queries).
15
-
16
- DROP INDEX IF EXISTS "OngoingEvaluation_application_id_record_kind_idx";
17
-
18
- ALTER TABLE "OngoingEvaluation"
19
- DROP COLUMN IF EXISTS "record_kind";
20
-
21
- DROP TYPE IF EXISTS "OngoingEvaluationRecordKind";
22
-
23
- CREATE INDEX IF NOT EXISTS "OngoingEvaluation_application_id_is_committed_idx"
24
- ON "OngoingEvaluation"("application_id", "is_committed");
@@ -1,2 +0,0 @@
1
- -- Drop unused per-job AI recommendation threshold storage (defaults live in application code).
2
- ALTER TABLE "JobDescription" DROP COLUMN IF EXISTS "recommendation_config";