@adaptware/eagles-db 0.5.43 → 0.5.45
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/client/edge.js +98 -22
- package/client/index-browser.js +91 -16
- package/client/index.d.ts +5968 -2561
- package/client/index.js +103 -27
- package/client/package.json +1 -1
- package/client/schema.prisma +176 -61
- package/client/wasm.js +98 -22
- package/package.json +1 -1
- package/prisma/schema/applications.prisma +18 -19
- package/prisma/schema/evaluationPlan.prisma +7 -0
- package/prisma/schema/integration.prisma +1 -0
- package/prisma/schema/interview.prisma +0 -1
- package/prisma/schema/jobApplicationFields.prisma +15 -17
- package/prisma/schema/jobApplicationResponse.prisma +3 -4
- package/prisma/schema/migrations/20260522120000_ongoing_evaluation_record_kind/migration.sql +25 -0
- package/prisma/schema/migrations/20260523120000_replace_record_kind_with_is_committed/migration.sql +24 -0
- package/prisma/schema/migrations/20260528120000_drop_job_description_recommendation_config/migration.sql +2 -0
- package/prisma/schema/migrations/20260710120000_add_resume_rendered_export_fields/migration.sql +9 -0
- package/prisma/schema/migrations/20260714120000_add_job_description_display_html_document/migration.sql +8 -0
- package/prisma/schema/migrations/20260716120000_add_offer_letters/migration.sql +183 -0
- package/prisma/schema/migrations/20260716140000_offer_schema_refinements/migration.sql +13 -0
- package/prisma/schema/migrations/20260716160000_offer_schema_hardening/migration.sql +95 -0
- package/prisma/schema/migrations/20260716180000_offer_letter_template_config/migration.sql +2 -0
- package/prisma/schema/migrations/20260716190000_add_evaluation_focus_areas/migration.sql +6 -0
- package/prisma/schema/migrations/20260717120000_offer_workflow_approval/migration.sql +30 -0
- package/prisma/schema/migrations/20260720120000_offer_letter_template_is_draft/migration.sql +5 -0
- package/prisma/schema/migrations/20260720140000_offer_status_split/migration.sql +51 -0
- package/prisma/schema/migrations/20260720140001_offer_status_split_backfill/migration.sql +37 -0
- package/prisma/schema/migrations/20260722120000_offer_draft_edited_html/migration.sql +13 -0
- package/prisma/schema/migrations/20260723150000_offer_withdraw_actor_no_show_reason/migration.sql +10 -0
- package/prisma/schema/migrations/20260724120000_open_job_offer_accepted_declined_counts/migration.sql +7 -0
- package/prisma/schema/migrations/20260811120000_add_integration_provider_razorpay/migration.sql +6 -0
- package/prisma/schema/migrations/20260812120000_add_billing_transactions/migration.sql +49 -0
- package/prisma/schema/migrations/20260812130000_drop_billing_transaction_gst_snapshots/migration.sql +3 -0
- package/prisma/schema/migrations/20260812180000_billing_transaction_invoice_number/migration.sql +5 -0
- package/prisma/schema/migrations/20260813120000_payment_webhooks_gst_refunds/migration.sql +79 -0
- package/prisma/schema/migrations/20260813140000_platform_gst_profiles/migration.sql +49 -0
- package/prisma/schema/migrations/20260813150000_rename_gst_profiles/migration.sql +53 -0
- package/prisma/schema/migrations/20260813160000_remove_gst_billing/migration.sql +16 -0
- package/prisma/schema/migrations/20260813170000_billing_licensing_unrecoverable/migration.sql +2 -0
- package/prisma/schema/migrations/20260813180000_billing_transaction_payment_method/migration.sql +2 -0
- package/prisma/schema/migrations/20260814090000_billing_transaction_purchaser_email/migration.sql +2 -0
- package/prisma/schema/migrations/20260816100000_billing_product_organisations/migration.sql +35 -0
- package/prisma/schema/migrations/20260816120000_merge_billing_product_organisations/migration.sql +25 -0
- package/prisma/schema/migrations/20260817120000_billing_payment_mismatch/migration.sql +7 -0
- package/prisma/schema/migrations/20260819120000_billing_product_prices/migration.sql +62 -0
- package/prisma/schema/migrations/20260819140000_billing_exchange_rates/migration.sql +25 -0
- package/prisma/schema/migrations/20260820120000_billing_transaction_failure_category/migration.sql +31 -0
- package/prisma/schema/migrations/20260820130000_backfill_billing_transaction_failure_details/migration.sql +23 -0
- package/prisma/schema/migrations/20260820140000_drop_billing_product_price_overrides/migration.sql +2 -0
- package/prisma/schema/migrations/20260821120000_drop_billing_product_and_mock_licensing/migration.sql +38 -0
- package/prisma/schema/migrations/20260824120000_billing_transaction_purchase_display_name/migration.sql +2 -0
- package/prisma/schema/migrations/20260831120000_user_communication_email/migration.sql +6 -0
- package/prisma/schema/migrations/20260901143000_assessment_question_bank_state/migration.sql +15 -0
- package/prisma/schema/migrations/20260902110000_drop_unused_feedback_table/migration.sql +2 -0
- package/prisma/schema/migrations/20260902120000_question_category_two_values/migration.sql +16 -0
- package/prisma/schema/migrations/20260902143000_question_bank_item_key/migration.sql +17 -0
- package/prisma/schema/migrations/20260903120000_split_round_type_assessment/migration.sql +9 -0
- package/prisma/schema/migrations/20260904110000_restore_round_type_assessment_enum/migration.sql +5 -0
- package/prisma/schema/migrations/20260904120000_revert_wrong_split_assessment_round_types/migration.sql +42 -0
- package/prisma/schema/organisation.prisma +2 -0
- package/prisma/schema/payment/billingTransaction.prisma +83 -0
- package/prisma/schema/payment/paymentWebhookEvent.prisma +28 -0
- package/prisma/.DS_Store +0 -0
- package/prisma/schema/.DS_Store +0 -0
- package/prisma/schema/feedback.prisma +0 -19
- package/prisma/schema/migrations/.DS_Store +0 -0
- package/prisma/schema/migrations/20260826160000_add_application_fit_check_report_document/.DS_Store +0 -0
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
-- Collapse QuestionCategory to GENERAL_APTITUDE + DOMAIN_KNOWLEDGE (drop DOMAIN_APTITUDE).
|
|
2
|
+
UPDATE "Question"
|
|
3
|
+
SET category = 'DOMAIN_KNOWLEDGE'
|
|
4
|
+
WHERE category = 'DOMAIN_APTITUDE';
|
|
5
|
+
|
|
6
|
+
CREATE TYPE "QuestionCategory_new" AS ENUM (
|
|
7
|
+
'GENERAL_APTITUDE',
|
|
8
|
+
'DOMAIN_KNOWLEDGE'
|
|
9
|
+
);
|
|
10
|
+
|
|
11
|
+
ALTER TABLE "Question"
|
|
12
|
+
ALTER COLUMN "category" TYPE "QuestionCategory_new"
|
|
13
|
+
USING ("category"::text::"QuestionCategory_new");
|
|
14
|
+
|
|
15
|
+
DROP TYPE "QuestionCategory";
|
|
16
|
+
ALTER TYPE "QuestionCategory_new" RENAME TO "QuestionCategory";
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
-- Replace plan_index on Question with deterministic bank_item_key for idempotent persist.
|
|
2
|
+
|
|
3
|
+
ALTER TABLE "Question" ADD COLUMN IF NOT EXISTS "bank_item_key" TEXT;
|
|
4
|
+
|
|
5
|
+
UPDATE "Question"
|
|
6
|
+
SET "bank_item_key" = 'legacy:' || "assessment_library_id" || ':' || "plan_index"::text
|
|
7
|
+
WHERE "candidate_id" IS NULL
|
|
8
|
+
AND "plan_index" IS NOT NULL
|
|
9
|
+
AND "bank_item_key" IS NULL
|
|
10
|
+
AND "assessment_library_id" IS NOT NULL;
|
|
11
|
+
|
|
12
|
+
DROP INDEX IF EXISTS "Question_assessment_library_id_candidate_id_plan_index_idx";
|
|
13
|
+
|
|
14
|
+
ALTER TABLE "Question" DROP COLUMN IF EXISTS "plan_index";
|
|
15
|
+
|
|
16
|
+
CREATE UNIQUE INDEX IF NOT EXISTS "Question_assessment_library_id_bank_item_key_key"
|
|
17
|
+
ON "Question" ("assessment_library_id", "bank_item_key");
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
-- Add explicit MCQ round types for NEW aptitude / domain knowledge tests.
|
|
2
|
+
--
|
|
3
|
+
-- Keep RoundType.ASSESSMENT for backward compatibility.
|
|
4
|
+
-- Do NOT rewrite EvaluationPlan, OngoingEvaluation, or analytics rows.
|
|
5
|
+
-- Do NOT drop or recreate the enum.
|
|
6
|
+
-- Do NOT touch ActivityEventType.ASSESSMENT_* or ActivityEntityType.ASSESSMENT.
|
|
7
|
+
|
|
8
|
+
ALTER TYPE "RoundType" ADD VALUE IF NOT EXISTS 'GENERAL_APTITUDE_ASSESSMENT';
|
|
9
|
+
ALTER TYPE "RoundType" ADD VALUE IF NOT EXISTS 'DOMAIN_KNOWLEDGE_ASSESSMENT';
|
package/prisma/schema/migrations/20260904110000_restore_round_type_assessment_enum/migration.sql
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
-- Restore legacy RoundType.ASSESSMENT when an older enum swap dropped it.
|
|
2
|
+
-- Must run in its own migration: PostgreSQL requires new enum values to be
|
|
3
|
+
-- committed before they can be assigned to rows (see revert migration next).
|
|
4
|
+
|
|
5
|
+
ALTER TYPE "RoundType" ADD VALUE IF NOT EXISTS 'ASSESSMENT';
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
-- Revert evaluation plans that were incorrectly stored as split MCQ round types
|
|
2
|
+
-- back to legacy ASSESSMENT.
|
|
3
|
+
--
|
|
4
|
+
-- Does NOT change rows already on ASSESSMENT.
|
|
5
|
+
-- Keeps intentional new GENERAL_APTITUDE_ASSESSMENT / DOMAIN_KNOWLEDGE_ASSESSMENT
|
|
6
|
+
-- rounds when title or details show an explicit split-type configuration.
|
|
7
|
+
--
|
|
8
|
+
-- Requires 20260904110000_restore_round_type_assessment_enum to run first so
|
|
9
|
+
-- RoundType.ASSESSMENT exists (some DBs lost it during an earlier bad enum swap).
|
|
10
|
+
|
|
11
|
+
UPDATE "EvaluationPlan"
|
|
12
|
+
SET type_of_round = 'ASSESSMENT'
|
|
13
|
+
WHERE is_active = true
|
|
14
|
+
AND type_of_round IN ('GENERAL_APTITUDE_ASSESSMENT', 'DOMAIN_KNOWLEDGE_ASSESSMENT')
|
|
15
|
+
AND (
|
|
16
|
+
(
|
|
17
|
+
COALESCE((details #>> '{question_category_distribution,GENERAL_APTITUDE}')::int, 0) > 0
|
|
18
|
+
AND COALESCE((details #>> '{question_category_distribution,DOMAIN_KNOWLEDGE}')::int, 0) > 0
|
|
19
|
+
)
|
|
20
|
+
OR (
|
|
21
|
+
upper(COALESCE(details->>'primary_question_category', '')) = 'GENERAL_APTITUDE'
|
|
22
|
+
AND type_of_round = 'DOMAIN_KNOWLEDGE_ASSESSMENT'
|
|
23
|
+
)
|
|
24
|
+
OR (
|
|
25
|
+
upper(COALESCE(details->>'primary_question_category', '')) = 'DOMAIN_KNOWLEDGE'
|
|
26
|
+
AND type_of_round = 'GENERAL_APTITUDE_ASSESSMENT'
|
|
27
|
+
)
|
|
28
|
+
OR (
|
|
29
|
+
type_of_round = 'DOMAIN_KNOWLEDGE_ASSESSMENT'
|
|
30
|
+
AND lower(title) !~* '(domain knowledge|domain test|backend domain|frontend domain|\mdomain\M)'
|
|
31
|
+
AND COALESCE((details #>> '{question_category_distribution,GENERAL_APTITUDE}')::int, 0) = 0
|
|
32
|
+
AND COALESCE((details #>> '{question_category_distribution,DOMAIN_KNOWLEDGE}')::int, 0) = 0
|
|
33
|
+
AND NULLIF(trim(COALESCE(details->>'primary_question_category', '')), '') IS NULL
|
|
34
|
+
)
|
|
35
|
+
OR (
|
|
36
|
+
type_of_round = 'GENERAL_APTITUDE_ASSESSMENT'
|
|
37
|
+
AND lower(title) !~* '(aptitude|general aptitude|numerical|verbal reasoning|logical reasoning)'
|
|
38
|
+
AND COALESCE((details #>> '{question_category_distribution,GENERAL_APTITUDE}')::int, 0) = 0
|
|
39
|
+
AND COALESCE((details #>> '{question_category_distribution,DOMAIN_KNOWLEDGE}')::int, 0) = 0
|
|
40
|
+
AND NULLIF(trim(COALESCE(details->>'primary_question_category', '')), '') IS NULL
|
|
41
|
+
)
|
|
42
|
+
);
|
|
@@ -74,6 +74,8 @@ model Organisation {
|
|
|
74
74
|
licensing_ledger_entries LicensingLedgerEntry[]
|
|
75
75
|
license_package_organisations LicensePackageOrganisation[]
|
|
76
76
|
ai_cost_ledger_entries AiCostLedgerEntry[]
|
|
77
|
+
billing_transactions BillingTransaction[]
|
|
78
|
+
payment_webhook_events PaymentWebhookEvent[]
|
|
77
79
|
|
|
78
80
|
@@index([name])
|
|
79
81
|
@@schema("public")
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
// PAYMENT SERVICE boundary — portable payment microservice owns these enums/columns.
|
|
2
|
+
|
|
3
|
+
enum BillingTransactionStatus {
|
|
4
|
+
INITIATED
|
|
5
|
+
ORDER_CREATED
|
|
6
|
+
PAYMENT_PENDING
|
|
7
|
+
SUCCESS
|
|
8
|
+
FAILED
|
|
9
|
+
CANCELLED
|
|
10
|
+
REFUND_PENDING
|
|
11
|
+
REFUND_FAILED
|
|
12
|
+
REFUNDED
|
|
13
|
+
|
|
14
|
+
@@schema("public")
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
enum BillingTransactionType {
|
|
18
|
+
PURCHASE
|
|
19
|
+
TOP_UP
|
|
20
|
+
REFUND
|
|
21
|
+
|
|
22
|
+
@@schema("public")
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
enum BillingTransactionFailureCategory {
|
|
26
|
+
RAZORPAY_ORDER
|
|
27
|
+
RAZORPAY_PAYMENT
|
|
28
|
+
REFUND
|
|
29
|
+
INTERNAL
|
|
30
|
+
|
|
31
|
+
@@schema("public")
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
/// Payment reconciliation state when Treadspace status is FAILED but Razorpay captured payment.
|
|
35
|
+
enum BillingPaymentMismatchStatus {
|
|
36
|
+
DETECTED
|
|
37
|
+
UNFULFILLED
|
|
38
|
+
|
|
39
|
+
@@schema("public")
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
/// Financial transaction lifecycle for organisation billing purchases.
|
|
43
|
+
model BillingTransaction {
|
|
44
|
+
id String @id @default(uuid())
|
|
45
|
+
organisation_id String
|
|
46
|
+
/// Opaque plan/product identity supplied at checkout. Not a catalog FK.
|
|
47
|
+
purchase_reference String
|
|
48
|
+
/// Human-readable snapshot captured at checkout for invoices and receipts.
|
|
49
|
+
purchase_display_name String?
|
|
50
|
+
transaction_type BillingTransactionType
|
|
51
|
+
status BillingTransactionStatus @default(INITIATED)
|
|
52
|
+
failure_category BillingTransactionFailureCategory?
|
|
53
|
+
/// Human-readable or provider detail (e.g. Razorpay error_description).
|
|
54
|
+
failure_reason String?
|
|
55
|
+
amount Int
|
|
56
|
+
currency String @default("INR")
|
|
57
|
+
razorpay_order_id String?
|
|
58
|
+
razorpay_payment_id String? @unique
|
|
59
|
+
/// Razorpay payment method at capture (card, netbanking, upi, wallet, etc.).
|
|
60
|
+
payment_method String?
|
|
61
|
+
razorpay_subscription_id String?
|
|
62
|
+
razorpay_refund_id String?
|
|
63
|
+
refund_reason String?
|
|
64
|
+
refund_amount Int?
|
|
65
|
+
idempotency_key String @unique
|
|
66
|
+
invoice_number String? @unique
|
|
67
|
+
/// Email of the org Admin who initiated checkout (bill-to).
|
|
68
|
+
purchaser_email String?
|
|
69
|
+
/// Set when FAILED but Razorpay order/payment is captured (reconciliation path).
|
|
70
|
+
payment_mismatch_status BillingPaymentMismatchStatus?
|
|
71
|
+
/// Strict same-intent SUCCESS transaction that fulfilled the purchase (UNFULFILLED only).
|
|
72
|
+
payment_mismatch_fulfilled_by_id String?
|
|
73
|
+
created_at DateTime @default(now())
|
|
74
|
+
updated_at DateTime @updatedAt
|
|
75
|
+
|
|
76
|
+
organisation Organisation @relation(fields: [organisation_id], references: [id])
|
|
77
|
+
|
|
78
|
+
@@index([organisation_id, status])
|
|
79
|
+
@@index([purchase_reference])
|
|
80
|
+
@@index([razorpay_order_id])
|
|
81
|
+
@@map("billing_transactions")
|
|
82
|
+
@@schema("public")
|
|
83
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
enum PaymentWebhookEventStatus {
|
|
2
|
+
RECEIVED
|
|
3
|
+
PROCESSED
|
|
4
|
+
FAILED
|
|
5
|
+
|
|
6
|
+
@@schema("public")
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
/// Idempotent record of payment provider webhook deliveries.
|
|
10
|
+
model PaymentWebhookEvent {
|
|
11
|
+
id String @id @default(uuid())
|
|
12
|
+
organisation_id String?
|
|
13
|
+
provider String
|
|
14
|
+
provider_event_id String
|
|
15
|
+
event_type String
|
|
16
|
+
status PaymentWebhookEventStatus @default(RECEIVED)
|
|
17
|
+
billing_transaction_id String?
|
|
18
|
+
error_message String?
|
|
19
|
+
processed_at DateTime?
|
|
20
|
+
created_at DateTime @default(now())
|
|
21
|
+
|
|
22
|
+
organisation Organisation? @relation(fields: [organisation_id], references: [id])
|
|
23
|
+
|
|
24
|
+
@@unique([provider, provider_event_id])
|
|
25
|
+
@@index([status, created_at])
|
|
26
|
+
@@map("payment_webhook_events")
|
|
27
|
+
@@schema("public")
|
|
28
|
+
}
|
package/prisma/.DS_Store
DELETED
|
Binary file
|
package/prisma/schema/.DS_Store
DELETED
|
Binary file
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
model Feedback {
|
|
2
|
-
id String @id @default(uuid())
|
|
3
|
-
interview_id String
|
|
4
|
-
order_no Int
|
|
5
|
-
|
|
6
|
-
ai_feedback Json?
|
|
7
|
-
human_feedback Json?
|
|
8
|
-
|
|
9
|
-
created_at DateTime @default(now())
|
|
10
|
-
updated_at DateTime @updatedAt
|
|
11
|
-
created_by String
|
|
12
|
-
updated_by String
|
|
13
|
-
is_active Boolean @default(true)
|
|
14
|
-
interview Interview @relation(fields: [interview_id], references: [id], onDelete: Cascade, onUpdate: Cascade)
|
|
15
|
-
|
|
16
|
-
@@unique([interview_id, order_no])
|
|
17
|
-
@@index([interview_id])
|
|
18
|
-
@@schema("public")
|
|
19
|
-
}
|
|
Binary file
|