@valentine-efagene/qshelter-common 2.0.146 → 2.0.148
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/dist/generated/client/internal/class.js +2 -2
- package/dist/generated/client/internal/prismaNamespace.d.ts +3 -0
- package/dist/generated/client/internal/prismaNamespace.js +3 -0
- package/dist/generated/client/internal/prismaNamespaceBrowser.d.ts +3 -0
- package/dist/generated/client/internal/prismaNamespaceBrowser.js +3 -0
- package/dist/generated/client/models/PaymentInstallment.d.ts +50 -1
- package/dist/generated/client/models/PaymentMethodPhaseStep.d.ts +6 -1
- package/dist/generated/client/models/PaymentPhase.d.ts +54 -1
- package/dist/generated/client/models/PropertyPaymentMethodPhase.d.ts +6 -1
- package/dist/generated/client/models/PropertyUnit.d.ts +54 -1
- package/dist/src/events/notifications/notification-enums.d.ts +4 -0
- package/dist/src/events/notifications/notification-enums.js +5 -0
- package/package.json +1 -1
- package/prisma/migrations/20260121155057_add_event_execution_and_bank_docs/migration.sql +198 -0
- package/prisma/migrations/20260121161937_add_phase_step_order_unique_constraints/migration.sql +12 -0
- package/prisma/migrations/20260121163910_add_optimistic_locking/migration.sql +14 -0
- package/prisma/schema.prisma +12 -1
package/prisma/schema.prisma
CHANGED
|
@@ -1306,6 +1306,9 @@ model PropertyUnit {
|
|
|
1306
1306
|
// Ownership tracking (once sold)
|
|
1307
1307
|
ownerId String?
|
|
1308
1308
|
|
|
1309
|
+
// Optimistic locking for unit reservation race condition
|
|
1310
|
+
version Int @default(0)
|
|
1311
|
+
|
|
1309
1312
|
createdAt DateTime @default(now())
|
|
1310
1313
|
updatedAt DateTime @updatedAt
|
|
1311
1314
|
|
|
@@ -1721,6 +1724,7 @@ model PropertyPaymentMethodPhase {
|
|
|
1721
1724
|
// Application phases created from this template
|
|
1722
1725
|
applicationPhases ApplicationPhase[]
|
|
1723
1726
|
|
|
1727
|
+
@@unique([paymentMethodId, order]) // Enforce unique, sequential ordering
|
|
1724
1728
|
@@index([tenantId])
|
|
1725
1729
|
@@index([paymentMethodId])
|
|
1726
1730
|
@@index([paymentPlanId])
|
|
@@ -1781,6 +1785,7 @@ model PaymentMethodPhaseStep {
|
|
|
1781
1785
|
// Event attachments - handlers that fire on step transitions
|
|
1782
1786
|
eventAttachments StepEventAttachment[]
|
|
1783
1787
|
|
|
1788
|
+
@@unique([phaseId, order]) // Enforce unique, sequential ordering within phase
|
|
1784
1789
|
@@index([tenantId])
|
|
1785
1790
|
@@index([phaseId])
|
|
1786
1791
|
@@map("payment_method_phase_steps")
|
|
@@ -1971,7 +1976,7 @@ model Application {
|
|
|
1971
1976
|
tenant Tenant @relation(fields: [tenantId], references: [id], onDelete: Cascade)
|
|
1972
1977
|
// Link to specific unit being purchased/rented
|
|
1973
1978
|
propertyUnitId String
|
|
1974
|
-
propertyUnit PropertyUnit @relation(fields: [propertyUnitId], references: [id], onDelete:
|
|
1979
|
+
propertyUnit PropertyUnit @relation(fields: [propertyUnitId], references: [id], onDelete: Restrict)
|
|
1975
1980
|
buyerId String
|
|
1976
1981
|
buyer User @relation("ApplicationBuyer", fields: [buyerId], references: [id], onDelete: Cascade)
|
|
1977
1982
|
sellerId String?
|
|
@@ -2453,6 +2458,9 @@ model PaymentPhase {
|
|
|
2453
2458
|
// Snapshot for audit
|
|
2454
2459
|
paymentPlanSnapshot Json?
|
|
2455
2460
|
|
|
2461
|
+
// Optimistic locking for concurrent payment protection
|
|
2462
|
+
version Int @default(0)
|
|
2463
|
+
|
|
2456
2464
|
createdAt DateTime @default(now())
|
|
2457
2465
|
updatedAt DateTime @updatedAt
|
|
2458
2466
|
|
|
@@ -2585,6 +2593,9 @@ model PaymentInstallment {
|
|
|
2585
2593
|
gracePeriodDays Int @default(0)
|
|
2586
2594
|
gracePeriodEndDate DateTime?
|
|
2587
2595
|
|
|
2596
|
+
// Optimistic locking for concurrent payment protection
|
|
2597
|
+
version Int @default(0)
|
|
2598
|
+
|
|
2588
2599
|
createdAt DateTime @default(now())
|
|
2589
2600
|
updatedAt DateTime @updatedAt
|
|
2590
2601
|
|