@adaptware/eagles-db 0.4.35 → 0.4.36

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 +11 -869
  2. package/client/index-browser.js +42 -901
  3. package/client/index.d.ts +27423 -80978
  4. package/client/index.js +11 -869
  5. package/client/package.json +1 -1
  6. package/client/schema.prisma +128 -1594
  7. package/client/wasm.js +11 -869
  8. package/package.json +1 -1
  9. package/prisma/schema/CandidateQuestionResponse.prisma +0 -1
  10. package/prisma/schema/UserRole.prisma +0 -1
  11. package/prisma/schema/action.prisma +0 -5
  12. package/prisma/schema/activityLog.prisma +0 -3
  13. package/prisma/schema/applications.prisma +2 -12
  14. package/prisma/schema/approval.prisma +0 -2
  15. package/prisma/schema/assessment.prisma +0 -1
  16. package/prisma/schema/assessmentLibrary.prisma +0 -1
  17. package/prisma/schema/assessmentQuestion.prisma +0 -1
  18. package/prisma/schema/assignment.prisma +0 -3
  19. package/prisma/schema/assignmentLibrary.prisma +0 -1
  20. package/prisma/schema/authModule.prisma +0 -3
  21. package/prisma/schema/budget.prisma +0 -6
  22. package/prisma/schema/calendly.prisma +0 -2
  23. package/prisma/schema/candidateProfile.prisma +0 -2
  24. package/prisma/schema/communication.prisma +0 -11
  25. package/prisma/schema/contactUs.prisma +0 -2
  26. package/prisma/schema/document.prisma +1 -4
  27. package/prisma/schema/evaluationPlan.prisma +10 -35
  28. package/prisma/schema/feedback.prisma +0 -1
  29. package/prisma/schema/fitCheck.prisma +0 -3
  30. package/prisma/schema/google.prisma +0 -2
  31. package/prisma/schema/integration.prisma +0 -13
  32. package/prisma/schema/interview.prisma +0 -9
  33. package/prisma/schema/interviewNotes.prisma +0 -1
  34. package/prisma/schema/jobApplicationFields.prisma +0 -3
  35. package/prisma/schema/jobApplicationResponse.prisma +0 -1
  36. package/prisma/schema/jobApplicationTemplate.prisma +0 -3
  37. package/prisma/schema/jobDescription.prisma +35 -43
  38. package/prisma/schema/jobDescriptionData.prisma +0 -1
  39. package/prisma/schema/jobProfile.prisma +0 -3
  40. package/prisma/schema/liveAnalysis.prisma +0 -1
  41. package/prisma/schema/message.prisma +0 -2
  42. package/prisma/schema/migrations/20260522120000_ongoing_evaluation_record_kind/migration.sql +25 -0
  43. package/prisma/schema/migrations/20260523120000_replace_record_kind_with_is_committed/migration.sql +24 -0
  44. package/prisma/schema/migrations/20260528120000_drop_job_description_recommendation_config/migration.sql +2 -0
  45. package/prisma/schema/migrations/{20260706120000_add_resume_rendered_export → 20260710120000_add_resume_rendered_export_fields}/migration.sql +2 -5
  46. package/prisma/schema/notes.prisma +0 -1
  47. package/prisma/schema/ongoingEvaluation.prisma +0 -7
  48. package/prisma/schema/organisation.prisma +31 -39
  49. package/prisma/schema/organisationConfig.prisma +0 -1
  50. package/prisma/schema/permission.prisma +0 -1
  51. package/prisma/schema/promise.prisma +0 -3
  52. package/prisma/schema/questions.prisma +0 -4
  53. package/prisma/schema/refreshToken.prisma +0 -2
  54. package/prisma/schema/resume.prisma +4 -5
  55. package/prisma/schema/resumeData.prisma +0 -1
  56. package/prisma/schema/schema.prisma +0 -2
  57. package/prisma/schema/suggestion.prisma +0 -1
  58. package/prisma/schema/transcript.prisma +0 -1
  59. package/prisma/schema/user.prisma +0 -10
  60. package/prisma/schema/userProfile.prisma +0 -2
  61. package/prisma/schema/zoomMeeting.prisma +0 -5
  62. package/client/libquery_engine-darwin.dylib.node +0 -0
  63. package/prisma/.DS_Store +0 -0
  64. package/prisma/migrations/20260519120000_migrate_shortlisted_to_selected/migration.sql +0 -2
  65. package/prisma/schema/.DS_Store +0 -0
  66. package/prisma/schema/activityEvent.prisma +0 -138
  67. package/prisma/schema/applicationAnalytics.prisma +0 -87
  68. package/prisma/schema/assessmentRoundAnalytics.prisma +0 -119
  69. package/prisma/schema/assignmentRoundAnalytics.prisma +0 -109
  70. package/prisma/schema/interviewRoundAnalytics.prisma +0 -140
  71. package/prisma/schema/interviewerAnalytics.prisma +0 -129
  72. package/prisma/schema/jobRoundAnalytics.prisma +0 -101
  73. package/prisma/schema/migrations/20260519120000_add_analytics_schema/migration.sql +0 -84
  74. package/prisma/schema/migrations/20260625120000_add_interviewer_analytics/migration.sql +0 -26
  75. package/prisma/schema/migrations/20260629120000_add_user_lifecycle_activity_events/migration.sql +0 -13
  76. package/prisma/schema/migrations/20260629140000_drop_organisation_org_code/migration.sql +0 -2
  77. package/prisma/schema/migrations/20260629160000_employee_codes_dual_interviewer_analytics/migration.sql +0 -87
  78. package/prisma/schema/migrations/20260630120000_add_application_sources/migration.sql +0 -38
  79. package/prisma/schema/migrations/20260701120000_add_source_effectiveness_analytics/migration.sql +0 -40
  80. package/prisma/schema/migrations/20260702120000_add_analytics_daily_tables/migration.sql +0 -232
  81. package/prisma/schema/openJobAnalytics.prisma +0 -85
  82. package/prisma/schema/pipelineDistributionAnalytics.prisma +0 -64
  83. package/prisma/schema/reportingOverviewJobAnalytics.prisma +0 -49
  84. package/prisma/schema/roundAnalytics.prisma +0 -145
  85. package/prisma/schema/source.prisma +0 -36
  86. package/prisma/schema/sourceEffectivenessAnalytics.prisma +0 -79
@@ -1,129 +0,0 @@
1
- model InterviewerOrganisationAnalytics {
2
- id String @id @default(uuid())
3
- organisation_id String
4
- user_id String
5
-
6
- name String?
7
- employee_id String?
8
-
9
- interview_count Int @default(0)
10
- accepted_count Int @default(0)
11
- rejected_count Int @default(0)
12
- unsure_count Int @default(0)
13
- ai_disagreement_count Int @default(0)
14
- ai_disagreement_percent Float?
15
- avg_difficulty Float?
16
- avg_supportiveness Float?
17
- avg_topics_coverage_percent Float?
18
-
19
- updated_at DateTime @updatedAt
20
-
21
- @@unique([organisation_id, user_id])
22
- @@index([organisation_id])
23
- @@index([organisation_id, user_id])
24
- @@map("interviewer_organisation_analytics")
25
- @@schema("analytics")
26
- }
27
-
28
- model InterviewerJobAnalytics {
29
- id String @id @default(uuid())
30
- organisation_id String
31
- user_id String
32
- job_description_id String
33
-
34
- hiring_manager_id String?
35
- department String?
36
- location String?
37
- role_title String?
38
- job_code String?
39
- opened_at DateTime?
40
-
41
- name String?
42
- employee_id String?
43
-
44
- interview_count Int @default(0)
45
- accepted_count Int @default(0)
46
- rejected_count Int @default(0)
47
- unsure_count Int @default(0)
48
- ai_disagreement_count Int @default(0)
49
- ai_disagreement_percent Float?
50
- avg_difficulty Float?
51
- avg_supportiveness Float?
52
- avg_topics_coverage_percent Float?
53
-
54
- updated_at DateTime @updatedAt
55
-
56
- @@unique([organisation_id, user_id, job_description_id])
57
- @@index([organisation_id, job_description_id])
58
- @@index([organisation_id, hiring_manager_id])
59
- @@index([organisation_id, department])
60
- @@index([organisation_id, location])
61
- @@index([organisation_id, user_id])
62
- @@map("interviewer_job_analytics")
63
- @@schema("analytics")
64
- }
65
-
66
- model InterviewerOrganisationAnalyticsDaily {
67
- id String @id @default(uuid())
68
- snapshot_date DateTime @db.Date
69
- organisation_id String
70
- user_id String
71
-
72
- name String?
73
- employee_id String?
74
-
75
- interview_count Int @default(0)
76
- accepted_count Int @default(0)
77
- rejected_count Int @default(0)
78
- unsure_count Int @default(0)
79
- ai_disagreement_count Int @default(0)
80
- ai_disagreement_percent Float?
81
- avg_difficulty Float?
82
- avg_supportiveness Float?
83
- avg_topics_coverage_percent Float?
84
-
85
- @@unique([snapshot_date, organisation_id, user_id])
86
- @@index([snapshot_date], map: "ioad_snapshot_date_idx")
87
- @@index([snapshot_date, organisation_id], map: "ioad_snapshot_org_idx")
88
- @@index([snapshot_date, organisation_id, user_id], map: "ioad_snapshot_org_user_idx")
89
- @@map("interviewer_organisation_analytics_daily")
90
- @@schema("analytics")
91
- }
92
-
93
- model InterviewerJobAnalyticsDaily {
94
- id String @id @default(uuid())
95
- snapshot_date DateTime @db.Date
96
- organisation_id String
97
- user_id String
98
- job_description_id String
99
-
100
- hiring_manager_id String?
101
- department String?
102
- location String?
103
- role_title String?
104
- job_code String?
105
- opened_at DateTime?
106
-
107
- name String?
108
- employee_id String?
109
-
110
- interview_count Int @default(0)
111
- accepted_count Int @default(0)
112
- rejected_count Int @default(0)
113
- unsure_count Int @default(0)
114
- ai_disagreement_count Int @default(0)
115
- ai_disagreement_percent Float?
116
- avg_difficulty Float?
117
- avg_supportiveness Float?
118
- avg_topics_coverage_percent Float?
119
-
120
- @@unique([snapshot_date, organisation_id, user_id, job_description_id])
121
- @@index([snapshot_date], map: "ijad_snapshot_date_idx")
122
- @@index([snapshot_date, organisation_id, job_description_id], map: "ijad_snapshot_org_job_idx")
123
- @@index([snapshot_date, organisation_id, hiring_manager_id], map: "ijad_snapshot_org_hm_idx")
124
- @@index([snapshot_date, organisation_id, department], map: "ijad_snapshot_org_dept_idx")
125
- @@index([snapshot_date, organisation_id, location], map: "ijad_snapshot_org_loc_idx")
126
- @@index([snapshot_date, organisation_id, user_id], map: "ijad_snapshot_org_user_idx")
127
- @@map("interviewer_job_analytics_daily")
128
- @@schema("analytics")
129
- }
@@ -1,101 +0,0 @@
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
- }
@@ -1,84 +0,0 @@
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");
@@ -1,26 +0,0 @@
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");
@@ -1,13 +0,0 @@
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';
@@ -1,2 +0,0 @@
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;
@@ -1,87 +0,0 @@
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");
@@ -1,38 +0,0 @@
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;
@@ -1,40 +0,0 @@
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");