@adaptware/eagles-db 0.4.36 → 0.4.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.
Files changed (86) hide show
  1. package/client/edge.js +874 -10
  2. package/client/index-browser.js +905 -40
  3. package/client/index.d.ts +81912 -27565
  4. package/client/index.js +874 -10
  5. package/client/libquery_engine-darwin.dylib.node +0 -0
  6. package/client/package.json +1 -1
  7. package/client/schema.prisma +1584 -108
  8. package/client/wasm.js +874 -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 +85 -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
@@ -4,56 +4,64 @@ enum JobDescriptionStatus {
4
4
  ACTIVE
5
5
  DEACTIVATED
6
6
  CLOSED
7
+
8
+ @@schema("public")
7
9
  }
8
10
 
9
11
  model JobDescription {
10
- id String @id @default(uuid())
12
+ id String @id @default(uuid())
11
13
  organisation_id String
12
14
  hiring_manager_id String?
13
- status JobDescriptionStatus @default(DRAFT)
15
+ status JobDescriptionStatus @default(DRAFT)
14
16
  screeningQuestions String[]
15
17
  recommendedQuestions Json[]
16
18
  /// @deprecated Prefer `source_document_id` + `Document` (type JOB_DESCRIPTION).
17
19
  uploaded_job_description_path String?
18
- source_document_id String? @unique
19
- rendered_jd_document_id String? @unique
20
- rendered_jd_document Document? @relation("RenderedJdDocument", fields: [rendered_jd_document_id], references: [id], onDelete: SetNull)
21
- is_plan_published Boolean @default(false)
22
- is_posted Boolean @default(false)
20
+ source_document_id String? @unique
21
+ rendered_jd_document_id String? @unique
22
+ rendered_jd_document Document? @relation("RenderedJdDocument", fields: [rendered_jd_document_id], references: [id], onDelete: SetNull)
23
+ is_plan_published Boolean @default(false)
24
+ is_posted Boolean @default(false)
23
25
  summary Json?
24
26
  ai_insight Json?
25
27
  job_fit_comparison Json?
28
+ target_closing_date DateTime?
29
+ closing_date DateTime?
30
+
31
+ job_number Int?
32
+ job_code String? @unique
26
33
  // Audit fields
27
- created_at DateTime @default(now())
28
- updated_at DateTime @updatedAt
29
- created_by String
30
- updated_by String
31
- is_active Boolean @default(true)
32
- openings Int @default(1)
33
- job_profile_id String?
34
- job_profile JobProfile? @relation(fields: [job_profile_id], references: [id], onDelete: SetNull, onUpdate: Cascade)
35
- organisation Organisation @relation(fields: [organisation_id], references: [id], onDelete: Cascade, onUpdate: Cascade)
36
- source_document Document? @relation("SourceDocument", fields: [source_document_id], references: [id], onDelete: SetNull, onUpdate: Cascade)
37
- applications Application[]
38
- interviews Interview[]
39
- assignments Assignment[]
40
- fit_check FitCheck[] // one-to-many link
41
- job_description_data JobDescriptionData[] // one-to-many link
42
- evaluationPlan EvaluationPlan[] // relation to evaluation methods
43
- ongoing_evaluations OngoingEvaluation[] // optional one-to-many
44
- assignment_library AssignmentLibrary[]
45
- approvals Approval[] // one-to-many relation
46
- resumes Resume[] // one-to-many link
47
- budget Budget?
48
- hiring_manager User? @relation("HiringManager", fields: [hiring_manager_id], references: [id], onDelete: SetNull, onUpdate: Cascade)
49
- recruiters User[]
50
- transcripts Transcript[]
51
- integration_job_syncs IntegrationJobSync[]
52
- job_application_template JobApplicationTemplate?
53
- conversations Conversation[]
54
- communication_messages CommunicationMessage[]
34
+ created_at DateTime @default(now())
35
+ updated_at DateTime @updatedAt
36
+ created_by String
37
+ updated_by String
38
+ is_active Boolean @default(true)
39
+ openings Int @default(1)
40
+ job_profile_id String?
41
+ job_profile JobProfile? @relation(fields: [job_profile_id], references: [id], onDelete: SetNull, onUpdate: Cascade)
42
+ organisation Organisation @relation(fields: [organisation_id], references: [id], onDelete: Cascade, onUpdate: Cascade)
43
+ source_document Document? @relation("SourceDocument", fields: [source_document_id], references: [id], onDelete: SetNull, onUpdate: Cascade)
44
+ applications Application[]
45
+ interviews Interview[]
46
+ assignments Assignment[]
47
+ fit_check FitCheck[] // one-to-many link
48
+ job_description_data JobDescriptionData[] // one-to-many link
49
+ evaluationPlan EvaluationPlan[] // relation to evaluation methods
50
+ ongoing_evaluations OngoingEvaluation[] // optional one-to-many
51
+ assignment_library AssignmentLibrary[]
52
+ approvals Approval[] // one-to-many relation
53
+ resumes Resume[] // one-to-many link
54
+ budget Budget?
55
+ hiring_manager User? @relation("HiringManager", fields: [hiring_manager_id], references: [id], onDelete: SetNull, onUpdate: Cascade)
56
+ recruiters User[]
57
+ transcripts Transcript[]
58
+ integration_job_syncs IntegrationJobSync[]
59
+ job_application_template JobApplicationTemplate?
60
+ conversations Conversation[]
61
+ communication_messages CommunicationMessage[]
55
62
 
56
63
  @@index([organisation_id])
57
64
  @@index([hiring_manager_id])
58
65
  @@index([job_profile_id])
66
+ @@schema("public")
59
67
  }
@@ -12,4 +12,5 @@ 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
+ @@schema("public")
15
16
  }
@@ -3,6 +3,8 @@ enum JobProfileStatus {
3
3
  INTAKE_SENT
4
4
  INTAKE_IN_PROGRESS
5
5
  COMPLETE
6
+
7
+ @@schema("public")
6
8
  }
7
9
 
8
10
  model JobProfile {
@@ -53,4 +55,5 @@ model JobProfile {
53
55
  @@index([hiring_manager_id])
54
56
  @@index([assigned_to])
55
57
  @@index([created_by])
58
+ @@schema("public")
56
59
  }
@@ -0,0 +1,101 @@
1
+ model JobRoundAnalytics {
2
+ id String @id @default(uuid())
3
+
4
+ organisation_id String
5
+
6
+ job_description_id String
7
+
8
+ evaluation_plan_id String
9
+
10
+ round_name String
11
+
12
+ evaluation_category EvaluationCategory?
13
+
14
+ job_code String?
15
+
16
+ role_title String?
17
+
18
+ hiring_manager_id String?
19
+
20
+ plan_order_no Int?
21
+
22
+ plan_type EvaluationPlanType?
23
+
24
+ is_custom Boolean @default(false)
25
+
26
+ assigned_count Int @default(0)
27
+
28
+ completed_count Int @default(0)
29
+
30
+ passed_count Int @default(0)
31
+
32
+ failed_count Int @default(0)
33
+
34
+ withdrawn_count Int @default(0)
35
+
36
+ no_show_count Int @default(0)
37
+
38
+ total_completion_minutes BigInt @default(0)
39
+
40
+ avg_completion_minutes Float?
41
+
42
+ updated_at DateTime @updatedAt
43
+
44
+ @@unique([job_description_id, evaluation_plan_id])
45
+ @@index([organisation_id])
46
+ @@index([organisation_id, hiring_manager_id])
47
+ @@index([job_description_id])
48
+ @@schema("analytics")
49
+ }
50
+
51
+ model JobRoundAnalyticsDaily {
52
+ id String @id @default(uuid())
53
+
54
+ snapshot_date DateTime @db.Date
55
+
56
+ organisation_id String
57
+
58
+ job_description_id String
59
+
60
+ evaluation_plan_id String
61
+
62
+ round_name String
63
+
64
+ evaluation_category EvaluationCategory?
65
+
66
+ job_code String?
67
+
68
+ role_title String?
69
+
70
+ hiring_manager_id String?
71
+
72
+ plan_order_no Int?
73
+
74
+ plan_type EvaluationPlanType?
75
+
76
+ is_custom Boolean @default(false)
77
+
78
+ assigned_count Int @default(0)
79
+
80
+ completed_count Int @default(0)
81
+
82
+ passed_count Int @default(0)
83
+
84
+ failed_count Int @default(0)
85
+
86
+ withdrawn_count Int @default(0)
87
+
88
+ no_show_count Int @default(0)
89
+
90
+ total_completion_minutes BigInt @default(0)
91
+
92
+ avg_completion_minutes Float?
93
+
94
+ @@unique([snapshot_date, job_description_id, evaluation_plan_id])
95
+ @@index([snapshot_date], map: "jrad_snapshot_date_idx")
96
+ @@index([snapshot_date, organisation_id], map: "jrad_snapshot_org_idx")
97
+ @@index([snapshot_date, organisation_id, hiring_manager_id], map: "jrad_snapshot_org_hm_idx")
98
+ @@index([snapshot_date, job_description_id], map: "jrad_snapshot_job_idx")
99
+ @@map("job_round_analytics_daily")
100
+ @@schema("analytics")
101
+ }
@@ -14,4 +14,5 @@ model LiveAnalysis {
14
14
  interview Interview @relation(fields: [interview_id], references: [id])
15
15
 
16
16
  @@index([interview_id])
17
+ @@schema("public")
17
18
  }
@@ -12,4 +12,6 @@ model Message {
12
12
  created_by String
13
13
  updated_by String
14
14
  is_active Boolean @default(true)
15
+
16
+ @@schema("public")
15
17
  }
@@ -0,0 +1,84 @@
1
+ -- CreateSchema
2
+ CREATE SCHEMA IF NOT EXISTS "analytics";
3
+
4
+ -- CreateEnum
5
+ CREATE TYPE "analytics"."RoundResult" AS ENUM ('PASSED', 'FAILED');
6
+
7
+ -- CreateTable
8
+ CREATE TABLE "analytics"."round_analytics" (
9
+ "id" TEXT NOT NULL,
10
+ "organisation_id" TEXT NOT NULL,
11
+ "application_id" TEXT NOT NULL,
12
+ "candidate_id" TEXT NOT NULL,
13
+ "job_description_id" TEXT NOT NULL,
14
+ "evaluation_plan_id" TEXT NOT NULL,
15
+ "round_id" TEXT NOT NULL,
16
+ "round_name" TEXT,
17
+ "evaluation_category" "EvaluationCategory",
18
+ "round_type" "RoundType",
19
+ "assigned_at" TIMESTAMP(3),
20
+ "interview_created_at" TIMESTAMP(3),
21
+ "interview_scheduled_at" TIMESTAMP(3),
22
+ "interview_started_at" TIMESTAMP(3),
23
+ "interview_completed_at" TIMESTAMP(3),
24
+ "interview_evaluated_at" TIMESTAMP(3),
25
+ "round_completed_at" TIMESTAMP(3),
26
+ "round_result" "analytics"."RoundResult",
27
+ "round_result_at" TIMESTAMP(3),
28
+ "scheduling_duration_minutes" INTEGER,
29
+ "interview_duration_minutes" INTEGER,
30
+ "feedback_duration_minutes" INTEGER,
31
+ "decision_duration_minutes" INTEGER,
32
+ "total_round_duration_minutes" INTEGER,
33
+ "is_custom" BOOLEAN NOT NULL DEFAULT false,
34
+ "created_at" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
35
+ "updated_at" TIMESTAMP(3) NOT NULL,
36
+
37
+ CONSTRAINT "round_analytics_pkey" PRIMARY KEY ("id")
38
+ );
39
+
40
+ -- CreateTable
41
+ CREATE TABLE "analytics"."job_round_analytics" (
42
+ "id" TEXT NOT NULL,
43
+ "organisation_id" TEXT NOT NULL,
44
+ "job_description_id" TEXT NOT NULL,
45
+ "evaluation_plan_id" TEXT NOT NULL,
46
+ "round_name" TEXT NOT NULL,
47
+ "evaluation_category" "EvaluationCategory",
48
+ "is_custom" BOOLEAN NOT NULL DEFAULT false,
49
+ "assigned_count" INTEGER NOT NULL DEFAULT 0,
50
+ "completed_count" INTEGER NOT NULL DEFAULT 0,
51
+ "passed_count" INTEGER NOT NULL DEFAULT 0,
52
+ "failed_count" INTEGER NOT NULL DEFAULT 0,
53
+ "withdrawn_count" INTEGER NOT NULL DEFAULT 0,
54
+ "no_show_count" INTEGER NOT NULL DEFAULT 0,
55
+ "total_completion_minutes" BIGINT NOT NULL DEFAULT 0,
56
+ "avg_completion_minutes" DOUBLE PRECISION,
57
+ "updated_at" TIMESTAMP(3) NOT NULL,
58
+
59
+ CONSTRAINT "job_round_analytics_pkey" PRIMARY KEY ("id")
60
+ );
61
+
62
+ -- CreateIndex
63
+ CREATE UNIQUE INDEX "round_analytics_round_id_key" ON "analytics"."round_analytics"("round_id");
64
+
65
+ -- CreateIndex
66
+ CREATE INDEX "round_analytics_organisation_id_idx" ON "analytics"."round_analytics"("organisation_id");
67
+
68
+ -- CreateIndex
69
+ CREATE INDEX "round_analytics_job_description_id_idx" ON "analytics"."round_analytics"("job_description_id");
70
+
71
+ -- CreateIndex
72
+ CREATE INDEX "round_analytics_application_id_idx" ON "analytics"."round_analytics"("application_id");
73
+
74
+ -- CreateIndex
75
+ CREATE INDEX "round_analytics_candidate_id_idx" ON "analytics"."round_analytics"("candidate_id");
76
+
77
+ -- CreateIndex
78
+ CREATE INDEX "round_analytics_evaluation_category_idx" ON "analytics"."round_analytics"("evaluation_category");
79
+
80
+ -- CreateIndex
81
+ CREATE INDEX "round_analytics_round_result_idx" ON "analytics"."round_analytics"("round_result");
82
+
83
+ -- CreateIndex
84
+ CREATE UNIQUE INDEX "job_round_analytics_job_description_id_evaluation_plan_id_key" ON "analytics"."job_round_analytics"("job_description_id", "evaluation_plan_id");
@@ -0,0 +1,26 @@
1
+ -- CreateTable
2
+ CREATE TABLE "analytics"."interviewer_analytics" (
3
+ "id" TEXT NOT NULL,
4
+ "organisation_id" TEXT NOT NULL,
5
+ "user_id" TEXT NOT NULL,
6
+ "name" TEXT,
7
+ "employee_id" TEXT,
8
+ "interview_count" INTEGER NOT NULL DEFAULT 0,
9
+ "accepted_count" INTEGER NOT NULL DEFAULT 0,
10
+ "rejected_count" INTEGER NOT NULL DEFAULT 0,
11
+ "unsure_count" INTEGER NOT NULL DEFAULT 0,
12
+ "ai_disagreement_count" INTEGER NOT NULL DEFAULT 0,
13
+ "ai_disagreement_percent" DOUBLE PRECISION,
14
+ "avg_difficulty" DOUBLE PRECISION,
15
+ "avg_supportiveness" DOUBLE PRECISION,
16
+ "avg_topics_coverage_percent" DOUBLE PRECISION,
17
+ "updated_at" TIMESTAMP(3) NOT NULL,
18
+
19
+ CONSTRAINT "interviewer_analytics_pkey" PRIMARY KEY ("id")
20
+ );
21
+
22
+ -- CreateIndex
23
+ CREATE UNIQUE INDEX "interviewer_analytics_organisation_id_user_id_key" ON "analytics"."interviewer_analytics"("organisation_id", "user_id");
24
+
25
+ -- CreateIndex
26
+ CREATE INDEX "interviewer_analytics_organisation_id_idx" ON "analytics"."interviewer_analytics"("organisation_id");
@@ -0,0 +1,13 @@
1
+ -- AlterEnum
2
+ ALTER TYPE "public"."ActivityEventType" ADD VALUE 'USER_INVITED';
3
+ ALTER TYPE "public"."ActivityEventType" ADD VALUE 'USER_INVITATION_RESENT';
4
+ ALTER TYPE "public"."ActivityEventType" ADD VALUE 'USER_CREATED';
5
+ ALTER TYPE "public"."ActivityEventType" ADD VALUE 'USER_INVITATION_ACCEPTED';
6
+ ALTER TYPE "public"."ActivityEventType" ADD VALUE 'USER_INVITATION_EXPIRED';
7
+ ALTER TYPE "public"."ActivityEventType" ADD VALUE 'USER_DEACTIVATED';
8
+ ALTER TYPE "public"."ActivityEventType" ADD VALUE 'USER_REACTIVATED';
9
+ ALTER TYPE "public"."ActivityEventType" ADD VALUE 'USER_ROLE_CHANGED';
10
+ ALTER TYPE "public"."ActivityEventType" ADD VALUE 'USER_PROFILE_COMPLETED';
11
+ ALTER TYPE "public"."ActivityEventType" ADD VALUE 'CANDIDATE_REGISTERED';
12
+ ALTER TYPE "public"."ActivityEventType" ADD VALUE 'CANDIDATE_CREATED';
13
+ ALTER TYPE "public"."ActivityEventType" ADD VALUE 'CANDIDATE_PROFILE_COMPLETED';
@@ -0,0 +1,2 @@
1
+ ALTER TABLE "Organisation" DROP COLUMN IF EXISTS "org_code";
2
+ ALTER TABLE "Organisation" ADD COLUMN IF NOT EXISTS "employee_sequence" INTEGER NOT NULL DEFAULT 1;
@@ -0,0 +1,87 @@
1
+ ALTER TABLE "User" ADD COLUMN IF NOT EXISTS "employee_number" INTEGER;
2
+ ALTER TABLE "User" ADD COLUMN IF NOT EXISTS "employee_code" TEXT;
3
+
4
+ CREATE UNIQUE INDEX IF NOT EXISTS "User_employee_code_key" ON "User"("employee_code");
5
+ CREATE INDEX IF NOT EXISTS "User_organisation_id_employee_number_idx" ON "User"("organisation_id", "employee_number");
6
+
7
+ DROP TABLE IF EXISTS "analytics"."interviewer_analytics";
8
+
9
+ CREATE TABLE "analytics"."interviewer_organisation_analytics" (
10
+ "id" TEXT NOT NULL,
11
+ "organisation_id" TEXT NOT NULL,
12
+ "user_id" TEXT NOT NULL,
13
+ "name" TEXT,
14
+ "employee_id" TEXT,
15
+ "interview_count" INTEGER NOT NULL DEFAULT 0,
16
+ "accepted_count" INTEGER NOT NULL DEFAULT 0,
17
+ "rejected_count" INTEGER NOT NULL DEFAULT 0,
18
+ "unsure_count" INTEGER NOT NULL DEFAULT 0,
19
+ "ai_disagreement_count" INTEGER NOT NULL DEFAULT 0,
20
+ "ai_disagreement_percent" DOUBLE PRECISION,
21
+ "avg_difficulty" DOUBLE PRECISION,
22
+ "avg_supportiveness" DOUBLE PRECISION,
23
+ "avg_topics_coverage_percent" DOUBLE PRECISION,
24
+ "updated_at" TIMESTAMP(3) NOT NULL,
25
+
26
+ CONSTRAINT "interviewer_organisation_analytics_pkey" PRIMARY KEY ("id")
27
+ );
28
+
29
+ CREATE UNIQUE INDEX "interviewer_organisation_analytics_organisation_id_user_id_key"
30
+ ON "analytics"."interviewer_organisation_analytics"("organisation_id", "user_id");
31
+ CREATE INDEX "interviewer_organisation_analytics_organisation_id_idx"
32
+ ON "analytics"."interviewer_organisation_analytics"("organisation_id");
33
+ CREATE INDEX "interviewer_organisation_analytics_organisation_id_user_id_idx"
34
+ ON "analytics"."interviewer_organisation_analytics"("organisation_id", "user_id");
35
+
36
+ CREATE TABLE "analytics"."interviewer_job_analytics" (
37
+ "id" TEXT NOT NULL,
38
+ "organisation_id" TEXT NOT NULL,
39
+ "user_id" TEXT NOT NULL,
40
+ "job_description_id" TEXT NOT NULL,
41
+ "hiring_manager_id" TEXT,
42
+ "department" TEXT,
43
+ "location" TEXT,
44
+ "role_title" TEXT,
45
+ "job_code" TEXT,
46
+ "opened_at" TIMESTAMP(3),
47
+ "name" TEXT,
48
+ "employee_id" TEXT,
49
+ "interview_count" INTEGER NOT NULL DEFAULT 0,
50
+ "accepted_count" INTEGER NOT NULL DEFAULT 0,
51
+ "rejected_count" INTEGER NOT NULL DEFAULT 0,
52
+ "unsure_count" INTEGER NOT NULL DEFAULT 0,
53
+ "ai_disagreement_count" INTEGER NOT NULL DEFAULT 0,
54
+ "ai_disagreement_percent" DOUBLE PRECISION,
55
+ "avg_difficulty" DOUBLE PRECISION,
56
+ "avg_supportiveness" DOUBLE PRECISION,
57
+ "avg_topics_coverage_percent" DOUBLE PRECISION,
58
+ "updated_at" TIMESTAMP(3) NOT NULL,
59
+
60
+ CONSTRAINT "interviewer_job_analytics_pkey" PRIMARY KEY ("id")
61
+ );
62
+
63
+ CREATE UNIQUE INDEX "interviewer_job_analytics_organisation_id_user_id_job_descri_key"
64
+ ON "analytics"."interviewer_job_analytics"("organisation_id", "user_id", "job_description_id");
65
+ CREATE INDEX "interviewer_job_analytics_organisation_id_job_description_id_idx"
66
+ ON "analytics"."interviewer_job_analytics"("organisation_id", "job_description_id");
67
+ CREATE INDEX "interviewer_job_analytics_organisation_id_hiring_manager_id_idx"
68
+ ON "analytics"."interviewer_job_analytics"("organisation_id", "hiring_manager_id");
69
+ CREATE INDEX "interviewer_job_analytics_organisation_id_department_idx"
70
+ ON "analytics"."interviewer_job_analytics"("organisation_id", "department");
71
+ CREATE INDEX "interviewer_job_analytics_organisation_id_location_idx"
72
+ ON "analytics"."interviewer_job_analytics"("organisation_id", "location");
73
+ CREATE INDEX "interviewer_job_analytics_organisation_id_user_id_idx"
74
+ ON "analytics"."interviewer_job_analytics"("organisation_id", "user_id");
75
+
76
+ CREATE INDEX IF NOT EXISTS "job_round_analytics_organisation_id_idx"
77
+ ON "analytics"."job_round_analytics"("organisation_id");
78
+ CREATE INDEX IF NOT EXISTS "job_round_analytics_organisation_id_hiring_manager_id_idx"
79
+ ON "analytics"."job_round_analytics"("organisation_id", "hiring_manager_id");
80
+ CREATE INDEX IF NOT EXISTS "job_round_analytics_job_description_id_idx"
81
+ ON "analytics"."job_round_analytics"("job_description_id");
82
+
83
+ CREATE INDEX IF NOT EXISTS "pipeline_distribution_analytics_job_description_id_idx"
84
+ ON "analytics"."pipeline_distribution_analytics"("job_description_id");
85
+
86
+ CREATE INDEX IF NOT EXISTS "open_job_analytics_job_description_id_idx"
87
+ ON "analytics"."open_job_analytics"("job_description_id");
@@ -0,0 +1,38 @@
1
+ -- CreateEnum
2
+ CREATE TYPE "public"."SourceCategory" AS ENUM ('JOB_BOARD', 'REFERRAL', 'AGENCY', 'SOCIAL_MEDIA', 'CAREERS_PAGE', 'EVENT', 'OTHER');
3
+
4
+ -- CreateTable
5
+ CREATE TABLE "public"."Source" (
6
+ "id" TEXT NOT NULL,
7
+ "organisation_id" TEXT NOT NULL,
8
+ "name" TEXT NOT NULL,
9
+ "category" "public"."SourceCategory",
10
+ "parent_source_id" TEXT,
11
+ "colour" TEXT,
12
+ "description" TEXT,
13
+ "is_active" BOOLEAN NOT NULL DEFAULT true,
14
+ "created_at" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
15
+ "updated_at" TIMESTAMP(3) NOT NULL,
16
+
17
+ CONSTRAINT "Source_pkey" PRIMARY KEY ("id")
18
+ );
19
+
20
+ -- CreateIndex
21
+ CREATE UNIQUE INDEX "Source_organisation_id_name_key" ON "public"."Source"("organisation_id", "name");
22
+ CREATE INDEX "Source_organisation_id_idx" ON "public"."Source"("organisation_id");
23
+ CREATE INDEX "Source_organisation_id_category_idx" ON "public"."Source"("organisation_id", "category");
24
+ CREATE INDEX "Source_organisation_id_is_active_idx" ON "public"."Source"("organisation_id", "is_active");
25
+ CREATE INDEX "Source_parent_source_id_idx" ON "public"."Source"("parent_source_id");
26
+
27
+ -- AddForeignKey
28
+ ALTER TABLE "public"."Source" ADD CONSTRAINT "Source_organisation_id_fkey" FOREIGN KEY ("organisation_id") REFERENCES "public"."Organisation"("id") ON DELETE CASCADE ON UPDATE CASCADE;
29
+ ALTER TABLE "public"."Source" ADD CONSTRAINT "Source_parent_source_id_fkey" FOREIGN KEY ("parent_source_id") REFERENCES "public"."Source"("id") ON DELETE SET NULL ON UPDATE CASCADE;
30
+
31
+ -- AlterTable
32
+ ALTER TABLE "public"."Application" ADD COLUMN "source_id" TEXT;
33
+
34
+ -- CreateIndex
35
+ CREATE INDEX "Application_source_id_idx" ON "public"."Application"("source_id");
36
+
37
+ -- AddForeignKey
38
+ ALTER TABLE "public"."Application" ADD CONSTRAINT "Application_source_id_fkey" FOREIGN KEY ("source_id") REFERENCES "public"."Source"("id") ON DELETE SET NULL ON UPDATE CASCADE;
@@ -0,0 +1,40 @@
1
+ CREATE TABLE "analytics"."source_effectiveness_analytics" (
2
+ "id" TEXT NOT NULL,
3
+ "organisation_id" TEXT NOT NULL,
4
+ "job_description_id" TEXT NOT NULL,
5
+ "source_id" TEXT NOT NULL,
6
+ "source_name" TEXT NOT NULL,
7
+ "source_category" "public"."SourceCategory",
8
+ "source_colour" TEXT,
9
+ "job_code" TEXT,
10
+ "job_number" INTEGER,
11
+ "role_title" TEXT,
12
+ "hiring_manager_id" TEXT,
13
+ "applications_count" INTEGER NOT NULL DEFAULT 0,
14
+ "screened_count" INTEGER NOT NULL DEFAULT 0,
15
+ "evaluated_count" INTEGER NOT NULL DEFAULT 0,
16
+ "rejected_count" INTEGER NOT NULL DEFAULT 0,
17
+ "shortlisted_count" INTEGER NOT NULL DEFAULT 0,
18
+ "offered_count" INTEGER NOT NULL DEFAULT 0,
19
+ "offer_accepted_count" INTEGER NOT NULL DEFAULT 0,
20
+ "offer_declined_count" INTEGER NOT NULL DEFAULT 0,
21
+ "withdrawn_count" INTEGER NOT NULL DEFAULT 0,
22
+ "hired_count" INTEGER NOT NULL DEFAULT 0,
23
+ "total_fit_score" DOUBLE PRECISION NOT NULL DEFAULT 0,
24
+ "fit_score_sample_count" INTEGER NOT NULL DEFAULT 0,
25
+ "average_fit_score" DOUBLE PRECISION,
26
+ "updated_at" TIMESTAMP(3) NOT NULL,
27
+
28
+ CONSTRAINT "source_effectiveness_analytics_pkey" PRIMARY KEY ("id")
29
+ );
30
+
31
+ CREATE UNIQUE INDEX "source_effectiveness_analytics_organisation_id_job_descripti_key"
32
+ ON "analytics"."source_effectiveness_analytics"("organisation_id", "job_description_id", "source_id");
33
+ CREATE INDEX "source_effectiveness_analytics_organisation_id_idx"
34
+ ON "analytics"."source_effectiveness_analytics"("organisation_id");
35
+ CREATE INDEX "source_effectiveness_analytics_organisation_id_source_id_idx"
36
+ ON "analytics"."source_effectiveness_analytics"("organisation_id", "source_id");
37
+ CREATE INDEX "source_effectiveness_analytics_organisation_id_hiring_manag_idx"
38
+ ON "analytics"."source_effectiveness_analytics"("organisation_id", "hiring_manager_id");
39
+ CREATE INDEX "source_effectiveness_analytics_job_description_id_idx"
40
+ ON "analytics"."source_effectiveness_analytics"("job_description_id");