@adaptware/eagles-db 0.6.14 → 0.6.16

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 (70) hide show
  1. package/client/edge.js +129 -8
  2. package/client/index-browser.js +122 -2
  3. package/client/index.d.ts +10875 -428
  4. package/client/index.js +129 -8
  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 +200 -0
  10. package/client/wasm.js +129 -8
  11. package/package.json +1 -1
  12. package/prisma/schema/integration.prisma +1 -0
  13. package/prisma/schema/interview.prisma +2 -0
  14. package/prisma/schema/licensing/purchasedLicense.prisma +3 -0
  15. package/prisma/schema/migrations/20260522120000_ongoing_evaluation_record_kind/migration.sql +25 -0
  16. package/prisma/schema/migrations/20260523120000_replace_record_kind_with_is_committed/migration.sql +24 -0
  17. package/prisma/schema/migrations/20260528120000_drop_job_description_recommendation_config/migration.sql +2 -0
  18. package/prisma/schema/migrations/20260710120000_add_resume_rendered_export_fields/migration.sql +9 -0
  19. package/prisma/schema/migrations/20260714120000_add_job_description_display_html_document/migration.sql +8 -0
  20. package/prisma/schema/migrations/20260716120000_add_offer_letters/migration.sql +183 -0
  21. package/prisma/schema/migrations/20260716140000_offer_schema_refinements/migration.sql +13 -0
  22. package/prisma/schema/migrations/20260716160000_offer_schema_hardening/migration.sql +95 -0
  23. package/prisma/schema/migrations/20260716180000_offer_letter_template_config/migration.sql +2 -0
  24. package/prisma/schema/migrations/20260716190000_add_evaluation_focus_areas/migration.sql +6 -0
  25. package/prisma/schema/migrations/20260717120000_offer_workflow_approval/migration.sql +30 -0
  26. package/prisma/schema/migrations/20260720120000_offer_letter_template_is_draft/migration.sql +5 -0
  27. package/prisma/schema/migrations/20260720140000_offer_status_split/migration.sql +51 -0
  28. package/prisma/schema/migrations/20260720140001_offer_status_split_backfill/migration.sql +37 -0
  29. package/prisma/schema/migrations/20260722120000_offer_draft_edited_html/migration.sql +13 -0
  30. package/prisma/schema/migrations/20260723150000_offer_withdraw_actor_no_show_reason/migration.sql +10 -0
  31. package/prisma/schema/migrations/20260724120000_open_job_offer_accepted_declined_counts/migration.sql +7 -0
  32. package/prisma/schema/migrations/20260811120000_add_integration_provider_razorpay/migration.sql +6 -0
  33. package/prisma/schema/migrations/20260812120000_add_billing_transactions/migration.sql +49 -0
  34. package/prisma/schema/migrations/20260812130000_drop_billing_transaction_gst_snapshots/migration.sql +3 -0
  35. package/prisma/schema/migrations/20260812180000_billing_transaction_invoice_number/migration.sql +5 -0
  36. package/prisma/schema/migrations/20260813120000_payment_webhooks_gst_refunds/migration.sql +79 -0
  37. package/prisma/schema/migrations/20260813140000_platform_gst_profiles/migration.sql +49 -0
  38. package/prisma/schema/migrations/20260813150000_rename_gst_profiles/migration.sql +53 -0
  39. package/prisma/schema/migrations/20260813160000_remove_gst_billing/migration.sql +16 -0
  40. package/prisma/schema/migrations/20260813170000_billing_licensing_unrecoverable/migration.sql +2 -0
  41. package/prisma/schema/migrations/20260813180000_billing_transaction_payment_method/migration.sql +2 -0
  42. package/prisma/schema/migrations/20260814090000_billing_transaction_purchaser_email/migration.sql +2 -0
  43. package/prisma/schema/migrations/20260816100000_billing_product_organisations/migration.sql +35 -0
  44. package/prisma/schema/migrations/20260816120000_merge_billing_product_organisations/migration.sql +25 -0
  45. package/prisma/schema/migrations/20260817120000_billing_payment_mismatch/migration.sql +7 -0
  46. package/prisma/schema/migrations/20260819120000_billing_product_prices/migration.sql +62 -0
  47. package/prisma/schema/migrations/20260819140000_billing_exchange_rates/migration.sql +25 -0
  48. package/prisma/schema/migrations/20260820120000_billing_transaction_failure_category/migration.sql +31 -0
  49. package/prisma/schema/migrations/20260820130000_backfill_billing_transaction_failure_details/migration.sql +23 -0
  50. package/prisma/schema/migrations/20260820140000_drop_billing_product_price_overrides/migration.sql +2 -0
  51. package/prisma/schema/migrations/20260821120000_drop_billing_product_and_mock_licensing/migration.sql +38 -0
  52. package/prisma/schema/migrations/20260824120000_billing_transaction_purchase_display_name/migration.sql +2 -0
  53. package/prisma/schema/migrations/20260831120000_user_communication_email/migration.sql +6 -0
  54. package/prisma/schema/migrations/20260901143000_assessment_question_bank_state/migration.sql +15 -0
  55. package/prisma/schema/migrations/20260902120000_question_category_two_values/migration.sql +16 -0
  56. package/prisma/schema/migrations/20260902143000_question_bank_item_key/migration.sql +17 -0
  57. package/prisma/schema/migrations/20260903120000_split_round_type_assessment/migration.sql +9 -0
  58. package/prisma/schema/migrations/20260904110000_restore_round_type_assessment_enum/migration.sql +5 -0
  59. package/prisma/schema/migrations/20260904120000_revert_wrong_split_assessment_round_types/migration.sql +42 -0
  60. package/prisma/schema/migrations/20260909140000_profile_interview_session/migration.sql +99 -0
  61. package/prisma/schema/migrations/20260911120000_unify_profile_interview_into_interview/migration.sql +139 -0
  62. package/prisma/schema/migrations/20260929120000_add_evaluation_type_in_person/migration.sql +2 -0
  63. package/prisma/schema/migrations/20261015130000_interview_whiteboard_scene/migration.sql +2 -0
  64. package/prisma/schema/migrations/20261022120000_billing_failure_category_provider_neutral/migration.sql +28 -0
  65. package/prisma/schema/organisation.prisma +8 -0
  66. package/prisma/schema/payment/billingTransaction.prisma +87 -0
  67. package/prisma/schema/payment/invoice.prisma +68 -0
  68. package/prisma/schema/payment/paymentWebhookEvent.prisma +28 -0
  69. package/prisma/.DS_Store +0 -0
  70. package/prisma/schema/migrations/.DS_Store +0 -0
@@ -1,5 +1,5 @@
1
1
  {
2
- "name": "prisma-client-f22a53a8ea96bee0fd8615ec06949c3122b9c92d15271dd7d580cd9c9e06d04d",
2
+ "name": "prisma-client-cae6b7bb9dff0f97d36dd48dc1e72bf310a22699dfd0845d40f8a3b60f753636",
3
3
  "main": "index.js",
4
4
  "types": "index.d.ts",
5
5
  "browser": "default.js",
@@ -2031,6 +2031,7 @@ enum IntegrationProvider {
2031
2031
  MICROSOFT
2032
2032
  ZOOM
2033
2033
  CALENDLY
2034
+ RAZORPAY
2034
2035
 
2035
2036
  @@schema("public")
2036
2037
  }
@@ -2199,6 +2200,8 @@ model Interview {
2199
2200
  ai_feedback Json?
2200
2201
  human_feedback Json?
2201
2202
  interview_preparation Json?
2203
+ /// Excalidraw snapshot flushed from Redis when the interview ends (`WhiteboardInterviewPersistenceService`).
2204
+ whiteboard_scene Json?
2202
2205
  final_feedback Json?
2203
2206
  interview_analysis_ranges Json?
2204
2207
  interview_flow_summary String?
@@ -3201,9 +3204,12 @@ model PurchasedLicensePackage {
3201
3204
  created_by String
3202
3205
  updated_by String
3203
3206
  is_active Boolean @default(true)
3207
+ /// Tax invoice for a paid or zero-amount purchase. Null = Super Admin grant (no invoice).
3208
+ invoice_id String? @unique
3204
3209
 
3205
3210
  organisation Organisation @relation(fields: [organisation_id], references: [id], onDelete: Restrict, onUpdate: Cascade)
3206
3211
  license_package LicensePackage @relation(fields: [license_package_id], references: [id], onDelete: Restrict, onUpdate: Cascade)
3212
+ invoice Invoice? @relation(fields: [invoice_id], references: [id], onDelete: Restrict)
3207
3213
  hiring_units PurchasedHiringUnit[]
3208
3214
 
3209
3215
  @@index([organisation_id])
@@ -3845,6 +3851,11 @@ model Organisation {
3845
3851
  timezone String @default("Asia/Kolkata")
3846
3852
  /// ISO 3166-1 alpha-2 (e.g. IN).
3847
3853
  country_code String @default("IN")
3854
+ /// Customer GSTIN; first 2 digits give the state for the CGST/SGST vs IGST split.
3855
+ /// Optional: an Indian org without one is still charged GST.
3856
+ gstin String?
3857
+ /// Currency the organisation is billed in (INR or USD). Catalogue and checkout use only packages in this currency.
3858
+ billing_currency String @default("INR")
3848
3859
  /// Who may consume unused hiring units. Does not rewrite unit rows when changed.
3849
3860
  hiring_unit_assignment_scope HiringUnitAssignmentScope @default(DEPARTMENT)
3850
3861
  organisation_configs OrganisationConfig[]
@@ -3872,6 +3883,9 @@ model Organisation {
3872
3883
  license_package_organisations LicensePackageOrganisation[]
3873
3884
  ai_cost_ledger_entries AiCostLedgerEntry[]
3874
3885
  consent_documents ConsentDocument[]
3886
+ billing_transactions BillingTransaction[]
3887
+ payment_webhook_events PaymentWebhookEvent[]
3888
+ invoices Invoice[]
3875
3889
 
3876
3890
  @@index([name])
3877
3891
  @@schema("public")
@@ -3891,6 +3905,192 @@ model OrganisationConfig {
3891
3905
  @@schema("public")
3892
3906
  }
3893
3907
 
3908
+ // PAYMENT SERVICE boundary — portable payment microservice owns these enums/columns.
3909
+
3910
+ enum BillingTransactionStatus {
3911
+ INITIATED
3912
+ ORDER_CREATED
3913
+ PAYMENT_PENDING
3914
+ SUCCESS
3915
+ FAILED
3916
+ CANCELLED
3917
+ REFUND_PENDING
3918
+ REFUND_FAILED
3919
+ REFUNDED
3920
+
3921
+ @@schema("public")
3922
+ }
3923
+
3924
+ enum BillingTransactionType {
3925
+ PURCHASE
3926
+ TOP_UP
3927
+ REFUND
3928
+
3929
+ @@schema("public")
3930
+ }
3931
+
3932
+ /// Provider-neutral failure stage; provider detail goes in failure_reason.
3933
+ enum BillingTransactionFailureCategory {
3934
+ ORDER
3935
+ PAYMENT
3936
+ REFUND
3937
+ INTERNAL
3938
+
3939
+ @@schema("public")
3940
+ }
3941
+
3942
+ /// Payment reconciliation state when Treadspace status is FAILED but Razorpay captured payment.
3943
+ enum BillingPaymentMismatchStatus {
3944
+ DETECTED
3945
+ UNFULFILLED
3946
+
3947
+ @@schema("public")
3948
+ }
3949
+
3950
+ /// Financial transaction lifecycle for organisation billing purchases.
3951
+ model BillingTransaction {
3952
+ id String @id @default(uuid())
3953
+ organisation_id String
3954
+ /// Opaque plan/product identity supplied at checkout. Not a catalog FK.
3955
+ purchase_reference String
3956
+ /// Human-readable snapshot captured at checkout for invoices and receipts.
3957
+ purchase_display_name String?
3958
+ transaction_type BillingTransactionType
3959
+ status BillingTransactionStatus @default(INITIATED)
3960
+ failure_category BillingTransactionFailureCategory?
3961
+ /// Human-readable or provider detail (e.g. Razorpay error_description).
3962
+ failure_reason String?
3963
+ amount Int
3964
+ currency String @default("INR")
3965
+ razorpay_order_id String?
3966
+ razorpay_payment_id String? @unique
3967
+ /// Razorpay payment method at capture (card, netbanking, upi, wallet, etc.).
3968
+ payment_method String?
3969
+ razorpay_subscription_id String?
3970
+ razorpay_refund_id String?
3971
+ refund_reason String?
3972
+ refund_amount Int?
3973
+ idempotency_key String @unique
3974
+ /// Email of the org Admin who initiated checkout (bill-to).
3975
+ purchaser_email String?
3976
+ /// User id of the org Admin who started checkout; actor for fulfilment and the invoice.
3977
+ created_by String?
3978
+ /// Set when FAILED but Razorpay order/payment is captured (reconciliation path).
3979
+ payment_mismatch_status BillingPaymentMismatchStatus?
3980
+ /// Strict same-intent SUCCESS transaction that fulfilled the purchase (UNFULFILLED only).
3981
+ payment_mismatch_fulfilled_by_id String?
3982
+ created_at DateTime @default(now())
3983
+ updated_at DateTime @updatedAt
3984
+
3985
+ organisation Organisation @relation(fields: [organisation_id], references: [id])
3986
+ /// Tax invoice issued for this payment (set once fulfilled).
3987
+ invoice Invoice?
3988
+
3989
+ @@index([organisation_id, status])
3990
+ @@index([purchase_reference])
3991
+ @@index([razorpay_order_id])
3992
+ @@map("billing_transactions")
3993
+ @@schema("public")
3994
+ }
3995
+
3996
+ // Tax invoices issued by Treadspace. Shared by license package purchases and (later) platform subscriptions.
3997
+
3998
+ /// What the invoice was raised for.
3999
+ enum InvoiceKind {
4000
+ PACKAGE
4001
+
4002
+ @@schema("public")
4003
+ }
4004
+
4005
+ /// Tax invoice. Raised only after money is received (or for a zero-amount purchase). Immutable once written.
4006
+ /// All amounts are integer minor units (paise / cents); total = cost + tax + fee + fee_tax (not stored).
4007
+ model Invoice {
4008
+ id String @id @default(uuid())
4009
+ /// Sequential number, e.g. TS/26-27/000001 (at most 16 chars). The financial year is part of the number.
4010
+ invoice_number String @unique
4011
+ kind InvoiceKind
4012
+ organisation_id String
4013
+ /// Payment that funded this invoice. Null for zero-amount purchases.
4014
+ billing_transaction_id String? @unique
4015
+ currency String
4016
+ /// Optional line description snapshot, e.g. "Pro hiring pack (v2)".
4017
+ description String?
4018
+ quantity Int
4019
+ /// Net cost of the goods/service (excludes GST and processing fee).
4020
+ cost_amount Int
4021
+ /// GST on cost. 0 for non-Indian organisations.
4022
+ tax_amount Int
4023
+ /// Payment processing fee.
4024
+ fee_amount Int
4025
+ /// GST on the processing fee. 0 for non-Indian organisations.
4026
+ fee_tax_amount Int
4027
+ /// GST rate in basis points (1800 = 18%) at issue time.
4028
+ tax_rate_bps Int
4029
+ /// Processing fee rate in basis points (200 = 2%) at issue time.
4030
+ fee_rate_bps Int
4031
+ /// Buyer snapshot from the organisation at issue time.
4032
+ buyer_name String
4033
+ buyer_address String
4034
+ /// ISO 3166-1 alpha-2 (e.g. IN).
4035
+ buyer_country_code String
4036
+ buyer_gstin String?
4037
+ /// Seller snapshot at issue time: { name, gstin, address, sac }.
4038
+ seller_snapshot Json
4039
+ issued_at DateTime @default(now())
4040
+ created_at DateTime @default(now())
4041
+ /// User id that triggered the issue (checkout admin), or "system".
4042
+ created_by String
4043
+
4044
+ organisation Organisation @relation(fields: [organisation_id], references: [id], onDelete: Restrict)
4045
+ billing_transaction BillingTransaction? @relation(fields: [billing_transaction_id], references: [id], onDelete: Restrict)
4046
+ purchased_license_package PurchasedLicensePackage?
4047
+
4048
+ @@index([organisation_id, issued_at])
4049
+ @@map("invoices")
4050
+ @@schema("public")
4051
+ }
4052
+
4053
+ /// Invoice number counter: one row per financial year (e.g. "2026-27"); the key only lives here, not on Invoice.
4054
+ /// Incremented inside the invoice-issuing transaction: concurrent issues wait on the row lock (no duplicate
4055
+ /// numbers, no retries) and a rolled-back issue rolls the counter back too (no gaps).
4056
+ model InvoiceSequence {
4057
+ financial_year String @id
4058
+ last_sequence Int @default(0)
4059
+ updated_at DateTime @updatedAt
4060
+
4061
+ @@map("invoice_sequences")
4062
+ @@schema("public")
4063
+ }
4064
+
4065
+ enum PaymentWebhookEventStatus {
4066
+ RECEIVED
4067
+ PROCESSED
4068
+ FAILED
4069
+
4070
+ @@schema("public")
4071
+ }
4072
+
4073
+ /// Idempotent record of payment provider webhook deliveries.
4074
+ model PaymentWebhookEvent {
4075
+ id String @id @default(uuid())
4076
+ organisation_id String?
4077
+ provider String
4078
+ provider_event_id String
4079
+ event_type String
4080
+ status PaymentWebhookEventStatus @default(RECEIVED)
4081
+ billing_transaction_id String?
4082
+ error_message String?
4083
+ processed_at DateTime?
4084
+ created_at DateTime @default(now())
4085
+
4086
+ organisation Organisation? @relation(fields: [organisation_id], references: [id])
4087
+
4088
+ @@unique([provider, provider_event_id])
4089
+ @@index([status, created_at])
4090
+ @@map("payment_webhook_events")
4091
+ @@schema("public")
4092
+ }
4093
+
3894
4094
  model Permission {
3895
4095
  id String @id @default(uuid())
3896
4096
  permissions String[] @default([])