@adaptware/eagles-db 0.6.17 → 0.6.19

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 (62) hide show
  1. package/client/edge.js +14 -123
  2. package/client/index-browser.js +7 -117
  3. package/client/index.d.ts +440 -10685
  4. package/client/index.js +14 -123
  5. package/client/libquery_engine-darwin.dylib.node +0 -0
  6. package/client/libquery_engine-debian-openssl-3.0.x.so.node +0 -0
  7. package/client/package.json +1 -1
  8. package/client/query_engine-windows.dll.node +0 -0
  9. package/client/schema.prisma +5 -214
  10. package/client/wasm.js +14 -123
  11. package/package.json +1 -1
  12. package/prisma/schema/evaluationPlan.prisma +4 -0
  13. package/prisma/schema/migrations/20260522120000_ongoing_evaluation_record_kind/migration.sql +25 -0
  14. package/prisma/schema/migrations/20260523120000_replace_record_kind_with_is_committed/migration.sql +24 -0
  15. package/prisma/schema/migrations/20260528120000_drop_job_description_recommendation_config/migration.sql +2 -0
  16. package/prisma/schema/migrations/20260710120000_add_resume_rendered_export_fields/migration.sql +9 -0
  17. package/prisma/schema/migrations/20260714120000_add_job_description_display_html_document/migration.sql +8 -0
  18. package/prisma/schema/migrations/20260716120000_add_offer_letters/migration.sql +183 -0
  19. package/prisma/schema/migrations/20260716140000_offer_schema_refinements/migration.sql +13 -0
  20. package/prisma/schema/migrations/20260716160000_offer_schema_hardening/migration.sql +95 -0
  21. package/prisma/schema/migrations/20260716180000_offer_letter_template_config/migration.sql +2 -0
  22. package/prisma/schema/migrations/20260716190000_add_evaluation_focus_areas/migration.sql +6 -0
  23. package/prisma/schema/migrations/20260717120000_offer_workflow_approval/migration.sql +30 -0
  24. package/prisma/schema/migrations/20260720120000_offer_letter_template_is_draft/migration.sql +5 -0
  25. package/prisma/schema/migrations/20260720140000_offer_status_split/migration.sql +51 -0
  26. package/prisma/schema/migrations/20260720140001_offer_status_split_backfill/migration.sql +37 -0
  27. package/prisma/schema/migrations/20260722120000_offer_draft_edited_html/migration.sql +13 -0
  28. package/prisma/schema/migrations/20260723150000_offer_withdraw_actor_no_show_reason/migration.sql +10 -0
  29. package/prisma/schema/migrations/20260724120000_open_job_offer_accepted_declined_counts/migration.sql +7 -0
  30. package/prisma/schema/migrations/20260811120000_add_integration_provider_razorpay/migration.sql +6 -0
  31. package/prisma/schema/migrations/20260812120000_add_billing_transactions/migration.sql +49 -0
  32. package/prisma/schema/migrations/20260812130000_drop_billing_transaction_gst_snapshots/migration.sql +3 -0
  33. package/prisma/schema/migrations/20260812180000_billing_transaction_invoice_number/migration.sql +5 -0
  34. package/prisma/schema/migrations/20260813120000_payment_webhooks_gst_refunds/migration.sql +79 -0
  35. package/prisma/schema/migrations/20260813140000_platform_gst_profiles/migration.sql +49 -0
  36. package/prisma/schema/migrations/20260813150000_rename_gst_profiles/migration.sql +53 -0
  37. package/prisma/schema/migrations/20260813160000_remove_gst_billing/migration.sql +16 -0
  38. package/prisma/schema/migrations/20260813170000_billing_licensing_unrecoverable/migration.sql +2 -0
  39. package/prisma/schema/migrations/20260813180000_billing_transaction_payment_method/migration.sql +2 -0
  40. package/prisma/schema/migrations/20260814090000_billing_transaction_purchaser_email/migration.sql +2 -0
  41. package/prisma/schema/migrations/20260816100000_billing_product_organisations/migration.sql +35 -0
  42. package/prisma/schema/migrations/20260816120000_merge_billing_product_organisations/migration.sql +25 -0
  43. package/prisma/schema/migrations/20260817120000_billing_payment_mismatch/migration.sql +7 -0
  44. package/prisma/schema/migrations/20260819120000_billing_product_prices/migration.sql +62 -0
  45. package/prisma/schema/migrations/20260819140000_billing_exchange_rates/migration.sql +25 -0
  46. package/prisma/schema/migrations/20260820120000_billing_transaction_failure_category/migration.sql +31 -0
  47. package/prisma/schema/migrations/20260820130000_backfill_billing_transaction_failure_details/migration.sql +23 -0
  48. package/prisma/schema/migrations/20260820140000_drop_billing_product_price_overrides/migration.sql +2 -0
  49. package/prisma/schema/migrations/20260821120000_drop_billing_product_and_mock_licensing/migration.sql +38 -0
  50. package/prisma/schema/migrations/20260824120000_billing_transaction_purchase_display_name/migration.sql +2 -0
  51. package/prisma/schema/migrations/20260831120000_user_communication_email/migration.sql +6 -0
  52. package/prisma/schema/migrations/20260901143000_assessment_question_bank_state/migration.sql +15 -0
  53. package/prisma/schema/migrations/20260902120000_question_category_two_values/migration.sql +16 -0
  54. package/prisma/schema/migrations/20260902143000_question_bank_item_key/migration.sql +17 -0
  55. package/prisma/schema/migrations/20260903120000_split_round_type_assessment/migration.sql +9 -0
  56. package/prisma/schema/migrations/20260904110000_restore_round_type_assessment_enum/migration.sql +5 -0
  57. package/prisma/schema/migrations/20260904120000_revert_wrong_split_assessment_round_types/migration.sql +42 -0
  58. package/prisma/schema/migrations/20260909140000_profile_interview_session/migration.sql +99 -0
  59. package/prisma/schema/migrations/20260911120000_unify_profile_interview_into_interview/migration.sql +139 -0
  60. package/prisma/schema/migrations/20260929120000_add_evaluation_type_in_person/migration.sql +2 -0
  61. package/prisma/schema/migrations/20261015130000_interview_whiteboard_scene/migration.sql +2 -0
  62. package/prisma/schema/ongoingEvaluation.prisma +49 -49
@@ -0,0 +1,99 @@
1
+ -- CreateEnum (idempotent: enum may already exist from a prior partial apply)
2
+ DO $$ BEGIN
3
+ CREATE TYPE "public"."ProfileInterviewSessionStatus" AS ENUM (
4
+ 'SCHEDULED',
5
+ 'IN_PROGRESS',
6
+ 'COMPLETED',
7
+ 'CANCELLED'
8
+ );
9
+ EXCEPTION
10
+ WHEN duplicate_object THEN NULL;
11
+ END $$;
12
+
13
+ -- CreateTable
14
+ CREATE TABLE IF NOT EXISTS "public"."ProfileInterviewSession" (
15
+ "id" TEXT NOT NULL,
16
+ "candidate_id" TEXT NOT NULL,
17
+ "organisation_id" TEXT,
18
+ "resume_id" TEXT NOT NULL,
19
+ "job_description_id" TEXT,
20
+ "purpose" TEXT NOT NULL,
21
+ "focus_areas" JSONB NOT NULL,
22
+ "duration_minutes" INTEGER NOT NULL,
23
+ "room_name" TEXT NOT NULL,
24
+ "status" "public"."ProfileInterviewSessionStatus" NOT NULL DEFAULT 'SCHEDULED',
25
+ "actual_start_time" TIMESTAMP(3),
26
+ "actual_end_time" TIMESTAMP(3),
27
+ "evidence_result" JSONB,
28
+ "created_at" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
29
+ "updated_at" TIMESTAMP(3) NOT NULL,
30
+ "created_by" TEXT NOT NULL,
31
+ "updated_by" TEXT NOT NULL,
32
+ "is_active" BOOLEAN NOT NULL DEFAULT true,
33
+
34
+ CONSTRAINT "ProfileInterviewSession_pkey" PRIMARY KEY ("id")
35
+ );
36
+
37
+ -- AlterTable
38
+ ALTER TABLE "public"."Transcript"
39
+ ADD COLUMN IF NOT EXISTS "profile_interview_session_id" TEXT;
40
+
41
+ -- CreateIndex
42
+ CREATE INDEX IF NOT EXISTS "ProfileInterviewSession_candidate_id_idx"
43
+ ON "public"."ProfileInterviewSession"("candidate_id");
44
+
45
+ CREATE INDEX IF NOT EXISTS "ProfileInterviewSession_candidate_id_status_idx"
46
+ ON "public"."ProfileInterviewSession"("candidate_id", "status");
47
+
48
+ CREATE INDEX IF NOT EXISTS "Transcript_profile_interview_session_id_idx"
49
+ ON "public"."Transcript"("profile_interview_session_id");
50
+
51
+ CREATE UNIQUE INDEX IF NOT EXISTS "Transcript_profile_interview_session_id_order_no_key"
52
+ ON "public"."Transcript"("profile_interview_session_id", "order_no");
53
+
54
+ -- AddForeignKey (idempotent)
55
+ DO $$ BEGIN
56
+ ALTER TABLE "public"."ProfileInterviewSession"
57
+ ADD CONSTRAINT "ProfileInterviewSession_candidate_id_fkey"
58
+ FOREIGN KEY ("candidate_id") REFERENCES "public"."User"("id")
59
+ ON DELETE CASCADE ON UPDATE CASCADE;
60
+ EXCEPTION
61
+ WHEN duplicate_object THEN NULL;
62
+ END $$;
63
+
64
+ DO $$ BEGIN
65
+ ALTER TABLE "public"."ProfileInterviewSession"
66
+ ADD CONSTRAINT "ProfileInterviewSession_organisation_id_fkey"
67
+ FOREIGN KEY ("organisation_id") REFERENCES "public"."Organisation"("id")
68
+ ON DELETE SET NULL ON UPDATE CASCADE;
69
+ EXCEPTION
70
+ WHEN duplicate_object THEN NULL;
71
+ END $$;
72
+
73
+ DO $$ BEGIN
74
+ ALTER TABLE "public"."ProfileInterviewSession"
75
+ ADD CONSTRAINT "ProfileInterviewSession_resume_id_fkey"
76
+ FOREIGN KEY ("resume_id") REFERENCES "public"."Resume"("id")
77
+ ON DELETE CASCADE ON UPDATE CASCADE;
78
+ EXCEPTION
79
+ WHEN duplicate_object THEN NULL;
80
+ END $$;
81
+
82
+ DO $$ BEGIN
83
+ ALTER TABLE "public"."ProfileInterviewSession"
84
+ ADD CONSTRAINT "ProfileInterviewSession_job_description_id_fkey"
85
+ FOREIGN KEY ("job_description_id") REFERENCES "public"."JobDescription"("id")
86
+ ON DELETE SET NULL ON UPDATE CASCADE;
87
+ EXCEPTION
88
+ WHEN duplicate_object THEN NULL;
89
+ END $$;
90
+
91
+ DO $$ BEGIN
92
+ ALTER TABLE "public"."Transcript"
93
+ ADD CONSTRAINT "Transcript_profile_interview_session_id_fkey"
94
+ FOREIGN KEY ("profile_interview_session_id")
95
+ REFERENCES "public"."ProfileInterviewSession"("id")
96
+ ON DELETE SET NULL ON UPDATE SET NULL;
97
+ EXCEPTION
98
+ WHEN duplicate_object THEN NULL;
99
+ END $$;
@@ -0,0 +1,139 @@
1
+ -- AlterTable: candidate-initiated profile AI on Interview
2
+ ALTER TABLE "public"."Interview" ADD COLUMN "candidate_initiated" BOOLEAN NOT NULL DEFAULT false;
3
+ ALTER TABLE "public"."Interview" ADD COLUMN "candidate_interview_metadata" JSONB;
4
+
5
+ -- Relax FK columns for profile rows
6
+ ALTER TABLE "public"."Interview" ALTER COLUMN "organisation_id" DROP NOT NULL;
7
+ ALTER TABLE "public"."Interview" ALTER COLUMN "job_description_id" DROP NOT NULL;
8
+ ALTER TABLE "public"."Interview" ALTER COLUMN "evaluation_plan_id" DROP NOT NULL;
9
+
10
+ -- Drop old composite unique (replaced by partial index below)
11
+ DROP INDEX IF EXISTS "public"."Interview_interviewer_id_candidate_id_evaluation_plan_id_key";
12
+
13
+ -- Backfill ProfileInterviewSession -> Interview (preserve ids for URLs)
14
+ INSERT INTO "public"."Interview" (
15
+ "id",
16
+ "organisation_id",
17
+ "candidate_id",
18
+ "interviewer_id",
19
+ "evaluation_plan_id",
20
+ "application_id",
21
+ "resume_id",
22
+ "job_description_id",
23
+ "candidate_initiated",
24
+ "candidate_interview_metadata",
25
+ "room_name",
26
+ "duration",
27
+ "actual_start_time",
28
+ "actual_end_time",
29
+ "evaluation_type",
30
+ "interview_status",
31
+ "interview_platform",
32
+ "ai_feedback",
33
+ "ai_feedback_generated_at",
34
+ "created_at",
35
+ "updated_at",
36
+ "created_by",
37
+ "updated_by",
38
+ "is_active",
39
+ "interview_summary",
40
+ "section_feedback",
41
+ "beta_section_feedback",
42
+ "reschedule_count",
43
+ "awaiting_recruiter_action"
44
+ )
45
+ SELECT
46
+ pis."id",
47
+ pis."organisation_id",
48
+ pis."candidate_id",
49
+ NULL,
50
+ NULL,
51
+ NULL,
52
+ pis."resume_id",
53
+ pis."job_description_id",
54
+ true,
55
+ jsonb_build_object(
56
+ 'purpose', pis."purpose",
57
+ 'focusAreas', pis."focus_areas"
58
+ ),
59
+ pis."room_name",
60
+ pis."duration_minutes",
61
+ pis."actual_start_time",
62
+ pis."actual_end_time",
63
+ 'TREADSPACE_FULL_AI'::"public"."EvaluationType",
64
+ CASE pis."status"
65
+ WHEN 'SCHEDULED' THEN 'SCHEDULED'::"public"."InterviewStatus"
66
+ WHEN 'IN_PROGRESS' THEN 'IN_PROGRESS'::"public"."InterviewStatus"
67
+ WHEN 'CANCELLED' THEN 'CANCELLED'::"public"."InterviewStatus"
68
+ WHEN 'COMPLETED' THEN
69
+ CASE
70
+ WHEN pis."evidence_result" IS NOT NULL THEN 'EVALUATED'::"public"."InterviewStatus"
71
+ ELSE 'EVALUATION_PENDING'::"public"."InterviewStatus"
72
+ END
73
+ ELSE 'SCHEDULED'::"public"."InterviewStatus"
74
+ END,
75
+ 'TREADSPACE'::"public"."InterviewPlatform",
76
+ pis."evidence_result",
77
+ CASE WHEN pis."evidence_result" IS NOT NULL THEN pis."updated_at" ELSE NULL END,
78
+ pis."created_at",
79
+ pis."updated_at",
80
+ pis."created_by",
81
+ pis."updated_by",
82
+ pis."is_active",
83
+ ARRAY[]::TEXT[],
84
+ ARRAY[]::JSONB[],
85
+ ARRAY[]::JSONB[],
86
+ 0,
87
+ false
88
+ FROM "public"."ProfileInterviewSession" pis
89
+ ON CONFLICT ("id") DO NOTHING;
90
+
91
+ -- Point transcripts at Interview rows
92
+ UPDATE "public"."Transcript" t
93
+ SET "interview_id" = t."profile_interview_session_id"
94
+ WHERE t."profile_interview_session_id" IS NOT NULL
95
+ AND t."interview_id" IS NULL;
96
+
97
+ -- Transcript: drop profile session FK
98
+ ALTER TABLE "public"."Transcript" DROP CONSTRAINT IF EXISTS "Transcript_profile_interview_session_id_fkey";
99
+ DROP INDEX IF EXISTS "public"."Transcript_profile_interview_session_id_order_no_key";
100
+ DROP INDEX IF EXISTS "public"."Transcript_profile_interview_session_id_idx";
101
+ ALTER TABLE "public"."Transcript" DROP COLUMN IF EXISTS "profile_interview_session_id";
102
+
103
+ -- Drop profile session table
104
+ DROP TABLE IF EXISTS "public"."ProfileInterviewSession";
105
+ DROP TYPE IF EXISTS "public"."ProfileInterviewSessionStatus";
106
+
107
+ -- Interview FK: organisation / job_description ON DELETE SET NULL
108
+ ALTER TABLE "public"."Interview" DROP CONSTRAINT IF EXISTS "Interview_organisation_id_fkey";
109
+ ALTER TABLE "public"."Interview" ADD CONSTRAINT "Interview_organisation_id_fkey"
110
+ FOREIGN KEY ("organisation_id") REFERENCES "public"."Organisation"("id")
111
+ ON DELETE SET NULL ON UPDATE CASCADE;
112
+
113
+ ALTER TABLE "public"."Interview" DROP CONSTRAINT IF EXISTS "Interview_job_description_id_fkey";
114
+ ALTER TABLE "public"."Interview" ADD CONSTRAINT "Interview_job_description_id_fkey"
115
+ FOREIGN KEY ("job_description_id") REFERENCES "public"."JobDescription"("id")
116
+ ON DELETE SET NULL ON UPDATE CASCADE;
117
+
118
+ -- Hiring row invariants
119
+ ALTER TABLE "public"."Interview" ADD CONSTRAINT "interview_hiring_required_fks"
120
+ CHECK (
121
+ "candidate_initiated" = true
122
+ OR (
123
+ "organisation_id" IS NOT NULL
124
+ AND "job_description_id" IS NOT NULL
125
+ AND "evaluation_plan_id" IS NOT NULL
126
+ )
127
+ );
128
+
129
+ -- Partial unique for hiring triple only
130
+ CREATE UNIQUE INDEX "interview_hiring_triple_uidx"
131
+ ON "public"."Interview" ("interviewer_id", "candidate_id", "evaluation_plan_id")
132
+ WHERE "candidate_initiated" = false AND "evaluation_plan_id" IS NOT NULL;
133
+
134
+ -- List indexes
135
+ CREATE INDEX IF NOT EXISTS "Interview_candidate_id_candidate_initiated_created_at_idx"
136
+ ON "public"."Interview" ("candidate_id", "candidate_initiated", "created_at");
137
+
138
+ CREATE INDEX IF NOT EXISTS "Interview_candidate_initiated_interview_status_idx"
139
+ ON "public"."Interview" ("candidate_initiated", "interview_status");
@@ -0,0 +1,2 @@
1
+ -- In-person interviews: staff schedules on-site; feedback without a platform session.
2
+ ALTER TYPE "public"."EvaluationType" ADD VALUE IF NOT EXISTS 'IN_PERSON';
@@ -0,0 +1,2 @@
1
+ -- Persisted Excalidraw snapshot when live Redis state is flushed (interview end / backup).
2
+ ALTER TABLE "Interview" ADD COLUMN IF NOT EXISTS "whiteboard_scene" JSONB;
@@ -21,61 +21,61 @@ enum OngoingEvaluationRoundStatus {
21
21
 
22
22
  model OngoingEvaluation {
23
23
  // Primary Key
24
- id String @id @default(uuid())
24
+ id String @id @default(uuid())
25
25
  // Foreign Keys
26
- organisation_id String
27
- application_id String
28
- candidate_id String
29
- resume_id String
30
- job_description_id String
31
- evaluation_plan_id String
32
- interview_id String? @unique
33
- assignment_id String? @unique
34
- assessment_id String? @unique
26
+ organisation_id String
27
+ application_id String
28
+ candidate_id String
29
+ resume_id String
30
+ job_description_id String
31
+ evaluation_plan_id String
32
+ interview_id String? @unique
33
+ assignment_id String? @unique
34
+ assessment_id String? @unique
35
35
  // Data Fields
36
- state OngoingEvaluationState? @default(NOT_STARTED)
37
- round_status OngoingEvaluationRoundStatus? @default(NOT_SCHEDULED)
38
- comments String? @default("")
39
- completed_at DateTime?
40
- assigned_at DateTime?
41
- result_at DateTime?
42
- is_committed Boolean?
36
+ state OngoingEvaluationState? @default(NOT_STARTED)
37
+ round_status OngoingEvaluationRoundStatus? @default(NOT_SCHEDULED)
38
+ comments String? @default("")
39
+ completed_at DateTime?
40
+ assigned_at DateTime?
41
+ result_at DateTime?
42
+ is_committed Boolean?
43
43
  /// Evaluation Plan Fields Filled After Round Started
44
- title String?
45
- description String?
46
- order_no Int?
47
- round_purpose String?
48
- focus_areas String[]
49
- topics String[]
50
- assignee String?
51
- elimination_round Boolean? @default(false)
52
- evaluation_type EvaluationType?
53
- type_of_round RoundType?
54
- duration Int?
55
- deadline Int?
56
- duration_unit DurationUnit?
57
- details Json?
58
- category EvaluationCategory?
44
+ title String?
45
+ description String?
46
+ order_no Int?
47
+ round_purpose String?
48
+ focus_areas String[]
49
+ topics String[]
50
+ assignee String?
51
+ elimination_round Boolean? @default(false)
52
+ evaluation_type EvaluationType?
53
+ type_of_round RoundType?
54
+ duration Int?
55
+ deadline Int?
56
+ duration_unit DurationUnit?
57
+ details Json?
58
+ category EvaluationCategory?
59
59
  /// Round relevance vs JD / application. Unused until a later writer.
60
- relevance_score Float?
61
- relevance_reasoning String?
60
+ relevance_score Float?
61
+ relevance_reasoning String?
62
62
  // Audit Fields
63
- created_at DateTime @default(now())
64
- updated_at DateTime @updatedAt
65
- created_by String
66
- updated_by String
67
- is_active Boolean @default(true)
68
- is_current Boolean @default(false)
63
+ created_at DateTime @default(now())
64
+ updated_at DateTime @updatedAt
65
+ created_by String
66
+ updated_by String
67
+ is_active Boolean @default(true)
68
+ is_current Boolean @default(false)
69
69
  // Relations
70
- jobDescription JobDescription? @relation(fields: [job_description_id], references: [id], onDelete: SetNull)
71
- application Application @relation(fields: [application_id], references: [id], onDelete: Cascade, onUpdate: Cascade)
72
- candidate User? @relation(fields: [candidate_id], references: [id], onDelete: Cascade, onUpdate: Cascade)
73
- resume Resume? @relation(fields: [resume_id], references: [id], onDelete: Cascade, onUpdate: Cascade)
74
- organisation Organisation? @relation(fields: [organisation_id], references: [id], onDelete: Cascade, onUpdate: Cascade)
75
- evaluation_plan EvaluationPlan @relation(fields: [evaluation_plan_id], references: [id], onDelete: Cascade, onUpdate: Cascade)
76
- interview Interview? @relation(fields: [interview_id], references: [id], onDelete: SetNull, onUpdate: Cascade)
77
- assignment Assignment?
78
- assessment Assessment? @relation(fields: [assessment_id], references: [id], onDelete: SetNull)
70
+ jobDescription JobDescription? @relation(fields: [job_description_id], references: [id], onDelete: SetNull)
71
+ application Application @relation(fields: [application_id], references: [id], onDelete: Cascade, onUpdate: Cascade)
72
+ candidate User? @relation(fields: [candidate_id], references: [id], onDelete: Cascade, onUpdate: Cascade)
73
+ resume Resume? @relation(fields: [resume_id], references: [id], onDelete: Cascade, onUpdate: Cascade)
74
+ organisation Organisation? @relation(fields: [organisation_id], references: [id], onDelete: Cascade, onUpdate: Cascade)
75
+ evaluation_plan EvaluationPlan @relation(fields: [evaluation_plan_id], references: [id], onDelete: Cascade, onUpdate: Cascade)
76
+ interview Interview? @relation(fields: [interview_id], references: [id], onDelete: SetNull, onUpdate: Cascade)
77
+ assignment Assignment?
78
+ assessment Assessment? @relation(fields: [assessment_id], references: [id], onDelete: SetNull)
79
79
 
80
80
  @@unique([application_id, evaluation_plan_id])
81
81
  @@index([application_id])