@adaptware/eagles-db 0.5.34 → 0.5.35
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 +87 -5
- package/client/index-browser.js +84 -2
- package/client/index.d.ts +5652 -228
- package/client/index.js +87 -5
- package/client/package.json +1 -1
- package/client/schema.prisma +145 -23
- package/client/wasm.js +87 -5
- package/package.json +1 -1
- package/prisma/schema/integration.prisma +1 -0
- package/prisma/schema/organisation.prisma +66 -64
- package/prisma/schema/payment/billingTransaction.prisma +83 -0
- package/prisma/schema/payment/paymentWebhookEvent.prisma +28 -0
package/package.json
CHANGED
|
@@ -9,71 +9,73 @@ enum OrganisationSize {
|
|
|
9
9
|
}
|
|
10
10
|
|
|
11
11
|
model Organisation {
|
|
12
|
-
id
|
|
13
|
-
name
|
|
14
|
-
industry
|
|
15
|
-
about
|
|
16
|
-
website
|
|
17
|
-
size
|
|
18
|
-
phone
|
|
19
|
-
address
|
|
20
|
-
company_values
|
|
21
|
-
allowed_email_domains
|
|
22
|
-
send_email
|
|
23
|
-
interviewers
|
|
24
|
-
created_at
|
|
25
|
-
updated_at
|
|
26
|
-
created_by
|
|
27
|
-
updated_by
|
|
28
|
-
is_active
|
|
29
|
-
alias
|
|
30
|
-
logo
|
|
31
|
-
job_sequence
|
|
32
|
-
employee_sequence
|
|
33
|
-
applications
|
|
34
|
-
user_roles
|
|
35
|
-
job_descriptions
|
|
36
|
-
job_profiles
|
|
37
|
-
assessment_library
|
|
38
|
-
assignment_library
|
|
39
|
-
interviews
|
|
40
|
-
assignments
|
|
41
|
-
fit_check
|
|
42
|
-
resumes
|
|
43
|
-
approvals
|
|
44
|
-
suggestions
|
|
45
|
-
ongoing_evaluations
|
|
46
|
-
actions
|
|
47
|
-
integration_credentials
|
|
48
|
-
zoho_sync_mappings
|
|
49
|
-
assessments
|
|
50
|
-
timezone
|
|
12
|
+
id String @id @default(uuid())
|
|
13
|
+
name String @unique
|
|
14
|
+
industry String
|
|
15
|
+
about String
|
|
16
|
+
website String
|
|
17
|
+
size OrganisationSize @default(ONE_TO_TEN)
|
|
18
|
+
phone String
|
|
19
|
+
address String
|
|
20
|
+
company_values Json[]
|
|
21
|
+
allowed_email_domains String[]
|
|
22
|
+
send_email Boolean @default(true)
|
|
23
|
+
interviewers User[]
|
|
24
|
+
created_at DateTime @default(now())
|
|
25
|
+
updated_at DateTime @updatedAt
|
|
26
|
+
created_by String
|
|
27
|
+
updated_by String
|
|
28
|
+
is_active Boolean @default(true)
|
|
29
|
+
alias String? @unique
|
|
30
|
+
logo String?
|
|
31
|
+
job_sequence Int @default(1)
|
|
32
|
+
employee_sequence Int @default(1)
|
|
33
|
+
applications Application[]
|
|
34
|
+
user_roles UserRole[]
|
|
35
|
+
job_descriptions JobDescription[]
|
|
36
|
+
job_profiles JobProfile[]
|
|
37
|
+
assessment_library AssessmentLibrary[]
|
|
38
|
+
assignment_library AssignmentLibrary[]
|
|
39
|
+
interviews Interview[]
|
|
40
|
+
assignments Assignment[]
|
|
41
|
+
fit_check FitCheck[] // one-to-many link
|
|
42
|
+
resumes Resume[] // one-to-many link
|
|
43
|
+
approvals Approval[] // one-to-many link
|
|
44
|
+
suggestions Suggestion[]
|
|
45
|
+
ongoing_evaluations OngoingEvaluation[] // optional one-to-many
|
|
46
|
+
actions Action[]
|
|
47
|
+
integration_credentials IntegrationCredential[]
|
|
48
|
+
zoho_sync_mappings ZohoSyncMapping[]
|
|
49
|
+
assessments Assessment[]
|
|
50
|
+
timezone String @default("Asia/Kolkata")
|
|
51
51
|
/// ISO 3166-1 alpha-2 (e.g. IN).
|
|
52
|
-
country_code
|
|
53
|
-
organisation_configs
|
|
54
|
-
activity_events
|
|
55
|
-
usage_ledger_entries
|
|
56
|
-
usage_aggregates
|
|
57
|
-
channel_provider_configs
|
|
58
|
-
conversations
|
|
59
|
-
communication_messages
|
|
60
|
-
job_application_fields
|
|
61
|
-
documents
|
|
62
|
-
job_application_templates
|
|
63
|
-
offer_letter_templates
|
|
64
|
-
offers
|
|
65
|
-
sources
|
|
66
|
-
evaluation_criteria
|
|
67
|
-
departments
|
|
68
|
-
hiring_plans
|
|
69
|
-
employees
|
|
70
|
-
competency_dictionaries
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
52
|
+
country_code String @default("IN")
|
|
53
|
+
organisation_configs OrganisationConfig[]
|
|
54
|
+
activity_events ActivityEvent[]
|
|
55
|
+
usage_ledger_entries UsageLedgerEntry[]
|
|
56
|
+
usage_aggregates UsageAggregate[]
|
|
57
|
+
channel_provider_configs ChannelProviderConfig[]
|
|
58
|
+
conversations Conversation[]
|
|
59
|
+
communication_messages CommunicationMessage[]
|
|
60
|
+
job_application_fields JobApplicationField[]
|
|
61
|
+
documents Document[]
|
|
62
|
+
job_application_templates JobApplicationTemplate[]
|
|
63
|
+
offer_letter_templates OfferLetterTemplate[]
|
|
64
|
+
offers Offer[]
|
|
65
|
+
sources Source[]
|
|
66
|
+
evaluation_criteria EvaluationCriteria[]
|
|
67
|
+
departments Department[]
|
|
68
|
+
hiring_plans HiringPlan[]
|
|
69
|
+
employees Employee[]
|
|
70
|
+
competency_dictionaries CompetencyDictionary[]
|
|
71
|
+
billing_transactions BillingTransaction[]
|
|
72
|
+
payment_webhook_events PaymentWebhookEvent[]
|
|
73
|
+
purchased_license_packages PurchasedLicensePackage[]
|
|
74
|
+
purchased_hiring_units PurchasedHiringUnit[]
|
|
75
|
+
purchased_top_ups PurchasedTopUp[]
|
|
76
|
+
licensing_ledger_entries LicensingLedgerEntry[]
|
|
77
|
+
license_package_organisations LicensePackageOrganisation[]
|
|
78
|
+
ai_cost_ledger_entries AiCostLedgerEntry[]
|
|
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
|
+
}
|