@valentine-efagene/qshelter-common 2.0.144 → 2.0.145
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/browser.d.ts +0 -23
- package/dist/generated/client/client.d.ts +0 -23
- package/dist/generated/client/commonInputTypes.d.ts +0 -120
- package/dist/generated/client/enums.d.ts +0 -31
- package/dist/generated/client/enums.js +0 -27
- package/dist/generated/client/internal/class.d.ts +0 -44
- package/dist/generated/client/internal/class.js +2 -2
- package/dist/generated/client/internal/prismaNamespace.d.ts +1 -397
- package/dist/generated/client/internal/prismaNamespace.js +0 -104
- package/dist/generated/client/internal/prismaNamespaceBrowser.d.ts +0 -112
- package/dist/generated/client/internal/prismaNamespaceBrowser.js +0 -104
- package/dist/generated/client/models/EventHandler.d.ts +0 -158
- package/dist/generated/client/models/EventType.d.ts +0 -134
- package/dist/generated/client/models/Tenant.d.ts +115 -1852
- package/dist/generated/client/models/index.d.ts +0 -4
- package/dist/generated/client/models/index.js +0 -4
- package/dist/generated/client/models.d.ts +0 -4
- package/dist/src/prisma/tenant.js +0 -2
- package/package.json +1 -1
- package/prisma/schema.prisma +29 -251
|
@@ -25,7 +25,6 @@ export * from './DomainEvent';
|
|
|
25
25
|
export * from './EmailPreference';
|
|
26
26
|
export * from './EventChannel';
|
|
27
27
|
export * from './EventHandler';
|
|
28
|
-
export * from './EventHandlerExecution';
|
|
29
28
|
export * from './EventType';
|
|
30
29
|
export * from './OAuthState';
|
|
31
30
|
export * from './OfferLetter';
|
|
@@ -64,8 +63,6 @@ export * from './RolePermission';
|
|
|
64
63
|
export * from './ScheduledJob';
|
|
65
64
|
export * from './Settings';
|
|
66
65
|
export * from './Social';
|
|
67
|
-
export * from './StateTransitionDefinition';
|
|
68
|
-
export * from './StateTransitionLog';
|
|
69
66
|
export * from './StepEventAttachment';
|
|
70
67
|
export * from './Tenant';
|
|
71
68
|
export * from './TenantMembership';
|
|
@@ -75,4 +72,3 @@ export * from './UserRole';
|
|
|
75
72
|
export * from './UserSuspension';
|
|
76
73
|
export * from './Wallet';
|
|
77
74
|
export * from './WorkflowBlocker';
|
|
78
|
-
export * from './WorkflowEvent';
|
|
@@ -25,7 +25,6 @@ export * from './DomainEvent';
|
|
|
25
25
|
export * from './EmailPreference';
|
|
26
26
|
export * from './EventChannel';
|
|
27
27
|
export * from './EventHandler';
|
|
28
|
-
export * from './EventHandlerExecution';
|
|
29
28
|
export * from './EventType';
|
|
30
29
|
export * from './OAuthState';
|
|
31
30
|
export * from './OfferLetter';
|
|
@@ -64,8 +63,6 @@ export * from './RolePermission';
|
|
|
64
63
|
export * from './ScheduledJob';
|
|
65
64
|
export * from './Settings';
|
|
66
65
|
export * from './Social';
|
|
67
|
-
export * from './StateTransitionDefinition';
|
|
68
|
-
export * from './StateTransitionLog';
|
|
69
66
|
export * from './StepEventAttachment';
|
|
70
67
|
export * from './Tenant';
|
|
71
68
|
export * from './TenantMembership';
|
|
@@ -75,4 +72,3 @@ export * from './UserRole';
|
|
|
75
72
|
export * from './UserSuspension';
|
|
76
73
|
export * from './Wallet';
|
|
77
74
|
export * from './WorkflowBlocker';
|
|
78
|
-
export * from './WorkflowEvent';
|
|
@@ -66,14 +66,10 @@ export type * from './models/DocumentRequirementRule.js';
|
|
|
66
66
|
export type * from './models/EventChannel.js';
|
|
67
67
|
export type * from './models/EventType.js';
|
|
68
68
|
export type * from './models/EventHandler.js';
|
|
69
|
-
export type * from './models/WorkflowEvent.js';
|
|
70
|
-
export type * from './models/EventHandlerExecution.js';
|
|
71
69
|
export type * from './models/DomainEvent.js';
|
|
72
70
|
export type * from './models/PropertyTransferRequest.js';
|
|
73
71
|
export type * from './models/ApprovalRequest.js';
|
|
74
72
|
export type * from './models/WorkflowBlocker.js';
|
|
75
|
-
export type * from './models/StateTransitionDefinition.js';
|
|
76
|
-
export type * from './models/StateTransitionLog.js';
|
|
77
73
|
export type * from './models/ScheduledJob.js';
|
|
78
74
|
export type * from './models/DocumentExpiryWarning.js';
|
|
79
75
|
export type * from './commonInputTypes.js';
|
|
@@ -38,8 +38,6 @@ const OPTIONAL_TENANT_MODELS = [
|
|
|
38
38
|
"role",
|
|
39
39
|
// Permission can be global template or tenant-specific
|
|
40
40
|
"permission",
|
|
41
|
-
// StateTransitionDefinition can be global template or tenant-specific
|
|
42
|
-
"stateTransitionDefinition",
|
|
43
41
|
// ScheduledJob can be system-wide or tenant-specific
|
|
44
42
|
"scheduledJob",
|
|
45
43
|
];
|
package/package.json
CHANGED
package/prisma/schema.prisma
CHANGED
|
@@ -410,33 +410,6 @@ enum EventHandlerType {
|
|
|
410
410
|
LOCK_UNIT // Lock the property unit for the applicant, supersede competing applications
|
|
411
411
|
}
|
|
412
412
|
|
|
413
|
-
/// Actor Type - Who triggered an event
|
|
414
|
-
enum ActorType {
|
|
415
|
-
USER
|
|
416
|
-
API_KEY
|
|
417
|
-
SYSTEM
|
|
418
|
-
WEBHOOK
|
|
419
|
-
}
|
|
420
|
-
|
|
421
|
-
/// Workflow Event Status
|
|
422
|
-
enum WorkflowEventStatus {
|
|
423
|
-
PENDING
|
|
424
|
-
PROCESSING
|
|
425
|
-
COMPLETED
|
|
426
|
-
FAILED
|
|
427
|
-
SKIPPED
|
|
428
|
-
}
|
|
429
|
-
|
|
430
|
-
/// Handler Execution Status
|
|
431
|
-
enum ExecutionStatus {
|
|
432
|
-
PENDING
|
|
433
|
-
RUNNING
|
|
434
|
-
COMPLETED
|
|
435
|
-
FAILED
|
|
436
|
-
RETRYING
|
|
437
|
-
SKIPPED
|
|
438
|
-
}
|
|
439
|
-
|
|
440
413
|
/// Permission effect (Allow/Deny)
|
|
441
414
|
enum PermissionEffect {
|
|
442
415
|
ALLOW
|
|
@@ -848,10 +821,9 @@ model Tenant {
|
|
|
848
821
|
apiKeys ApiKey[]
|
|
849
822
|
|
|
850
823
|
// Event-driven workflow
|
|
851
|
-
eventChannels
|
|
852
|
-
eventTypes
|
|
853
|
-
eventHandlers
|
|
854
|
-
workflowEvents WorkflowEvent[]
|
|
824
|
+
eventChannels EventChannel[]
|
|
825
|
+
eventTypes EventType[]
|
|
826
|
+
eventHandlers EventHandler[]
|
|
855
827
|
|
|
856
828
|
// Property transfer requests
|
|
857
829
|
propertyTransferRequests PropertyTransferRequest[]
|
|
@@ -886,7 +858,6 @@ model Tenant {
|
|
|
886
858
|
propertyVariantMedia PropertyVariantMedia[]
|
|
887
859
|
propertyUnits PropertyUnit[]
|
|
888
860
|
propertyAmenities PropertyAmenity[]
|
|
889
|
-
eventHandlerExecutions EventHandlerExecution[]
|
|
890
861
|
amenities Amenity[]
|
|
891
862
|
socials Social[]
|
|
892
863
|
wallets Wallet[]
|
|
@@ -907,9 +878,6 @@ model Tenant {
|
|
|
907
878
|
// Application organization assignments
|
|
908
879
|
applicationOrganizations ApplicationOrganization[]
|
|
909
880
|
|
|
910
|
-
// State machine audit
|
|
911
|
-
stateTransitionLogs StateTransitionLog[]
|
|
912
|
-
|
|
913
881
|
@@index([subdomain])
|
|
914
882
|
@@map("tenants")
|
|
915
883
|
}
|
|
@@ -2143,16 +2111,16 @@ model ApplicationOrganization {
|
|
|
2143
2111
|
isPrimary Boolean @default(false)
|
|
2144
2112
|
|
|
2145
2113
|
// Organization-specific terms (e.g., bank's offered interest rate)
|
|
2146
|
-
offeredTerms
|
|
2147
|
-
termsOfferedAt
|
|
2148
|
-
termsAcceptedAt
|
|
2149
|
-
termsDeclinedAt
|
|
2150
|
-
declineReason
|
|
2114
|
+
offeredTerms Json? // { interestRate, termMonths, conditions, etc. }
|
|
2115
|
+
termsOfferedAt DateTime?
|
|
2116
|
+
termsAcceptedAt DateTime?
|
|
2117
|
+
termsDeclinedAt DateTime?
|
|
2118
|
+
declineReason String? @db.Text
|
|
2151
2119
|
|
|
2152
2120
|
// Tracking
|
|
2153
|
-
activatedAt
|
|
2154
|
-
completedAt
|
|
2155
|
-
withdrawnAt
|
|
2121
|
+
activatedAt DateTime?
|
|
2122
|
+
completedAt DateTime?
|
|
2123
|
+
withdrawnAt DateTime?
|
|
2156
2124
|
|
|
2157
2125
|
// =========================================================================
|
|
2158
2126
|
// SLA TRACKING - Monitor bank responsiveness
|
|
@@ -2160,19 +2128,19 @@ model ApplicationOrganization {
|
|
|
2160
2128
|
// When documentation is complete, clock starts for bank to respond.
|
|
2161
2129
|
// If they're slow, admin can reassign to another bank.
|
|
2162
2130
|
// =========================================================================
|
|
2163
|
-
slaHours
|
|
2164
|
-
slaStartedAt
|
|
2165
|
-
slaBreachedAt
|
|
2166
|
-
slaBreachNotified
|
|
2167
|
-
|
|
2131
|
+
slaHours Int? // Expected response time (e.g., 48 hours)
|
|
2132
|
+
slaStartedAt DateTime? // When clock started (e.g., when docs were complete)
|
|
2133
|
+
slaBreachedAt DateTime? // When SLA was breached (set by cron job)
|
|
2134
|
+
slaBreachNotified Boolean @default(false) // Was admin notified of breach?
|
|
2135
|
+
|
|
2168
2136
|
// Reminder tracking
|
|
2169
2137
|
reminderCount Int @default(0)
|
|
2170
2138
|
lastReminderSentAt DateTime?
|
|
2171
2139
|
nextReminderAt DateTime?
|
|
2172
|
-
|
|
2140
|
+
|
|
2173
2141
|
// Escalation
|
|
2174
2142
|
escalatedAt DateTime?
|
|
2175
|
-
escalatedToUserId String?
|
|
2143
|
+
escalatedToUserId String? // Admin handling the escalation
|
|
2176
2144
|
escalationNotes String? @db.Text
|
|
2177
2145
|
|
|
2178
2146
|
createdAt DateTime @default(now())
|
|
@@ -2690,7 +2658,7 @@ model ApplicationDocument {
|
|
|
2690
2658
|
// =========================================================================
|
|
2691
2659
|
// expectedUploader is set from DocumentDefinition.uploadedBy at phase creation
|
|
2692
2660
|
// Allows validation that correct party is uploading (e.g., developer uploads sales offer)
|
|
2693
|
-
expectedUploader
|
|
2661
|
+
expectedUploader UploadedBy? // CUSTOMER, LENDER, DEVELOPER, LEGAL, PLATFORM, etc.
|
|
2694
2662
|
// If expectedUploader is LENDER/DEVELOPER, track which org should upload
|
|
2695
2663
|
expectedOrganizationId String?
|
|
2696
2664
|
|
|
@@ -2700,13 +2668,13 @@ model ApplicationDocument {
|
|
|
2700
2668
|
// Documents like bank statements have a shelf life. If application takes too long,
|
|
2701
2669
|
// documents may need to be re-uploaded.
|
|
2702
2670
|
// =========================================================================
|
|
2703
|
-
documentDate
|
|
2704
|
-
expiresAt
|
|
2705
|
-
expiryDays
|
|
2706
|
-
isExpired
|
|
2707
|
-
expiredAt
|
|
2708
|
-
expiryWarningAt
|
|
2709
|
-
revalidatedAt
|
|
2671
|
+
documentDate DateTime? // When the document was issued/created (e.g., bank statement date)
|
|
2672
|
+
expiresAt DateTime? // When this document expires (computed from documentDate + expiryDays)
|
|
2673
|
+
expiryDays Int? // Number of days this document type is valid (copied from DocumentDefinition)
|
|
2674
|
+
isExpired Boolean @default(false) // Denormalized flag, updated by cron job
|
|
2675
|
+
expiredAt DateTime? // When the document was marked expired
|
|
2676
|
+
expiryWarningAt DateTime? // When expiry warning was sent
|
|
2677
|
+
revalidatedAt DateTime? // If document was re-uploaded after expiry
|
|
2710
2678
|
|
|
2711
2679
|
status DocumentStatus @default(PENDING)
|
|
2712
2680
|
|
|
@@ -3265,9 +3233,6 @@ model EventType {
|
|
|
3265
3233
|
/// Handlers subscribed to this event type
|
|
3266
3234
|
handlers EventHandler[]
|
|
3267
3235
|
|
|
3268
|
-
/// Actual event instances of this type
|
|
3269
|
-
events WorkflowEvent[]
|
|
3270
|
-
|
|
3271
3236
|
createdAt DateTime @default(now())
|
|
3272
3237
|
updatedAt DateTime @updatedAt
|
|
3273
3238
|
|
|
@@ -3318,9 +3283,6 @@ model EventHandler {
|
|
|
3318
3283
|
/// e.g., "$.payload.status == 'approved'"
|
|
3319
3284
|
filterCondition String? @db.Text
|
|
3320
3285
|
|
|
3321
|
-
/// Handler execution logs
|
|
3322
|
-
executions EventHandlerExecution[]
|
|
3323
|
-
|
|
3324
3286
|
/// Step attachments - steps that have attached this handler
|
|
3325
3287
|
stepAttachments StepEventAttachment[]
|
|
3326
3288
|
|
|
@@ -3336,100 +3298,6 @@ model EventHandler {
|
|
|
3336
3298
|
@@map("event_handlers")
|
|
3337
3299
|
}
|
|
3338
3300
|
|
|
3339
|
-
/// Workflow Event - An actual event instance that occurred
|
|
3340
|
-
/// This is the audit log of all events in the system
|
|
3341
|
-
model WorkflowEvent {
|
|
3342
|
-
id String @id @default(cuid())
|
|
3343
|
-
tenantId String
|
|
3344
|
-
tenant Tenant @relation(fields: [tenantId], references: [id], onDelete: Cascade)
|
|
3345
|
-
|
|
3346
|
-
/// The type of this event
|
|
3347
|
-
eventTypeId String
|
|
3348
|
-
eventType EventType @relation(fields: [eventTypeId], references: [id], onDelete: Cascade)
|
|
3349
|
-
|
|
3350
|
-
/// The event payload (actual data)
|
|
3351
|
-
payload Json
|
|
3352
|
-
|
|
3353
|
-
/// Optional correlation ID to link related events
|
|
3354
|
-
correlationId String?
|
|
3355
|
-
|
|
3356
|
-
/// Optional causation ID (which event caused this one)
|
|
3357
|
-
causationId String?
|
|
3358
|
-
|
|
3359
|
-
/// Source of the event (service name, user action, etc.)
|
|
3360
|
-
source String
|
|
3361
|
-
|
|
3362
|
-
/// Actor who triggered the event (user ID, API key ID, "system")
|
|
3363
|
-
actorId String?
|
|
3364
|
-
actorType ActorType @default(SYSTEM)
|
|
3365
|
-
|
|
3366
|
-
/// Event status
|
|
3367
|
-
status WorkflowEventStatus @default(PENDING)
|
|
3368
|
-
|
|
3369
|
-
/// Error message if processing failed
|
|
3370
|
-
error String? @db.Text
|
|
3371
|
-
|
|
3372
|
-
/// When the event was processed
|
|
3373
|
-
processedAt DateTime?
|
|
3374
|
-
|
|
3375
|
-
/// Handler executions for this event
|
|
3376
|
-
executions EventHandlerExecution[]
|
|
3377
|
-
|
|
3378
|
-
createdAt DateTime @default(now())
|
|
3379
|
-
|
|
3380
|
-
@@index([tenantId])
|
|
3381
|
-
@@index([eventTypeId])
|
|
3382
|
-
@@index([correlationId])
|
|
3383
|
-
@@index([causationId])
|
|
3384
|
-
@@index([status])
|
|
3385
|
-
@@index([createdAt])
|
|
3386
|
-
@@map("workflow_events")
|
|
3387
|
-
}
|
|
3388
|
-
|
|
3389
|
-
/// Event Handler Execution - Log of a handler processing an event
|
|
3390
|
-
model EventHandlerExecution {
|
|
3391
|
-
id String @id @default(cuid())
|
|
3392
|
-
tenantId String
|
|
3393
|
-
tenant Tenant @relation(fields: [tenantId], references: [id], onDelete: Cascade)
|
|
3394
|
-
|
|
3395
|
-
/// The event being processed
|
|
3396
|
-
eventId String
|
|
3397
|
-
event WorkflowEvent @relation(fields: [eventId], references: [id], onDelete: Cascade)
|
|
3398
|
-
|
|
3399
|
-
/// The handler that processed this event
|
|
3400
|
-
handlerId String
|
|
3401
|
-
handler EventHandler @relation(fields: [handlerId], references: [id], onDelete: Cascade)
|
|
3402
|
-
|
|
3403
|
-
/// Execution status
|
|
3404
|
-
status ExecutionStatus @default(PENDING)
|
|
3405
|
-
|
|
3406
|
-
/// Attempt number (1 for first try, increments on retry)
|
|
3407
|
-
attempt Int @default(1)
|
|
3408
|
-
|
|
3409
|
-
/// Input to the handler (may be transformed payload)
|
|
3410
|
-
input Json?
|
|
3411
|
-
|
|
3412
|
-
/// Output from the handler
|
|
3413
|
-
output Json?
|
|
3414
|
-
|
|
3415
|
-
/// Error details if failed
|
|
3416
|
-
error String? @db.Text
|
|
3417
|
-
errorCode String?
|
|
3418
|
-
|
|
3419
|
-
/// Timing
|
|
3420
|
-
startedAt DateTime?
|
|
3421
|
-
completedAt DateTime?
|
|
3422
|
-
durationMs Int?
|
|
3423
|
-
|
|
3424
|
-
createdAt DateTime @default(now())
|
|
3425
|
-
|
|
3426
|
-
@@index([tenantId])
|
|
3427
|
-
@@index([eventId])
|
|
3428
|
-
@@index([handlerId])
|
|
3429
|
-
@@index([status])
|
|
3430
|
-
@@map("event_handler_executions")
|
|
3431
|
-
}
|
|
3432
|
-
|
|
3433
3301
|
// =============================================================================
|
|
3434
3302
|
// EVENT OUTBOX - For guaranteed event delivery to SQS queues
|
|
3435
3303
|
// =============================================================================
|
|
@@ -3737,96 +3605,6 @@ model WorkflowBlocker {
|
|
|
3737
3605
|
@@map("workflow_blockers")
|
|
3738
3606
|
}
|
|
3739
3607
|
|
|
3740
|
-
// =============================================================================
|
|
3741
|
-
// STATE MACHINE DEFINITION - Explicit state transitions
|
|
3742
|
-
// =============================================================================
|
|
3743
|
-
// Defines valid state transitions for applications and phases.
|
|
3744
|
-
// This makes the state machine configurable and auditable, rather than
|
|
3745
|
-
// being hard-coded in service logic.
|
|
3746
|
-
// =============================================================================
|
|
3747
|
-
|
|
3748
|
-
/// Entity type that has state machine behavior
|
|
3749
|
-
enum StateMachineEntity {
|
|
3750
|
-
APPLICATION
|
|
3751
|
-
APPLICATION_PHASE
|
|
3752
|
-
DOCUMENTATION_STAGE
|
|
3753
|
-
DOCUMENT
|
|
3754
|
-
}
|
|
3755
|
-
|
|
3756
|
-
/// State Machine Transition Definition - Configurable state transitions
|
|
3757
|
-
/// Allows admins to customize workflows without code changes
|
|
3758
|
-
model StateTransitionDefinition {
|
|
3759
|
-
id String @id @default(cuid())
|
|
3760
|
-
tenantId String? // NULL = global template, set = tenant-specific override
|
|
3761
|
-
|
|
3762
|
-
// What entity this transition applies to
|
|
3763
|
-
entityType StateMachineEntity
|
|
3764
|
-
|
|
3765
|
-
// The transition
|
|
3766
|
-
fromState String // e.g., "DRAFT", "PENDING", "IN_PROGRESS"
|
|
3767
|
-
toState String // e.g., "ACTIVE", "COMPLETED"
|
|
3768
|
-
trigger String // e.g., "SUBMIT", "APPROVE", "COMPLETE"
|
|
3769
|
-
|
|
3770
|
-
// Transition constraints
|
|
3771
|
-
isEnabled Boolean @default(true)
|
|
3772
|
-
requiresRole String? // Role required to trigger this transition
|
|
3773
|
-
requiresPhase String? // Phase type required (for APPLICATION transitions)
|
|
3774
|
-
|
|
3775
|
-
// Side effects configuration
|
|
3776
|
-
sideEffects Json? // [{ type: "SEND_EMAIL", config: {...} }, { type: "LOCK_UNIT" }]
|
|
3777
|
-
|
|
3778
|
-
// Audit
|
|
3779
|
-
description String? @db.Text
|
|
3780
|
-
createdAt DateTime @default(now())
|
|
3781
|
-
updatedAt DateTime @updatedAt
|
|
3782
|
-
|
|
3783
|
-
@@unique([tenantId, entityType, fromState, trigger])
|
|
3784
|
-
@@index([entityType])
|
|
3785
|
-
@@index([fromState])
|
|
3786
|
-
@@index([trigger])
|
|
3787
|
-
@@map("state_transition_definitions")
|
|
3788
|
-
}
|
|
3789
|
-
|
|
3790
|
-
/// State Transition Log - Audit trail for all state changes
|
|
3791
|
-
/// Records every state transition for compliance and debugging
|
|
3792
|
-
model StateTransitionLog {
|
|
3793
|
-
id String @id @default(cuid())
|
|
3794
|
-
tenantId String
|
|
3795
|
-
tenant Tenant @relation(fields: [tenantId], references: [id], onDelete: Cascade)
|
|
3796
|
-
|
|
3797
|
-
// What entity changed state
|
|
3798
|
-
entityType StateMachineEntity
|
|
3799
|
-
entityId String // Application ID, Phase ID, Document ID, etc.
|
|
3800
|
-
|
|
3801
|
-
// The transition that occurred
|
|
3802
|
-
fromState String
|
|
3803
|
-
toState String
|
|
3804
|
-
trigger String
|
|
3805
|
-
|
|
3806
|
-
// Who triggered the transition
|
|
3807
|
-
actorId String?
|
|
3808
|
-
actorType EventActorType?
|
|
3809
|
-
|
|
3810
|
-
// Context at time of transition
|
|
3811
|
-
contextSnapshot Json? // Relevant data at time of transition (phase data, payment amounts, etc.)
|
|
3812
|
-
|
|
3813
|
-
// Timing
|
|
3814
|
-
occurredAt DateTime @default(now())
|
|
3815
|
-
durationMs Int? // How long the entity was in fromState
|
|
3816
|
-
|
|
3817
|
-
// Validation
|
|
3818
|
-
wasValid Boolean @default(true) // Was this a valid transition per state machine?
|
|
3819
|
-
errorMessage String? @db.Text // If invalid, why?
|
|
3820
|
-
|
|
3821
|
-
@@index([tenantId])
|
|
3822
|
-
@@index([entityType, entityId])
|
|
3823
|
-
@@index([entityType, fromState])
|
|
3824
|
-
@@index([entityType, toState])
|
|
3825
|
-
@@index([occurredAt])
|
|
3826
|
-
@@index([actorId])
|
|
3827
|
-
@@map("state_transition_logs")
|
|
3828
|
-
}
|
|
3829
|
-
|
|
3830
3608
|
// =============================================================================
|
|
3831
3609
|
// DOCUMENT EXPIRY JOB - Scheduled job tracking for document expiration checks
|
|
3832
3610
|
// =============================================================================
|
|
@@ -3857,7 +3635,7 @@ enum ScheduledJobType {
|
|
|
3857
3635
|
|
|
3858
3636
|
/// Scheduled Job - Tracks execution of background jobs
|
|
3859
3637
|
model ScheduledJob {
|
|
3860
|
-
id String
|
|
3638
|
+
id String @id @default(cuid())
|
|
3861
3639
|
tenantId String? // NULL = system-wide job, set = tenant-specific
|
|
3862
3640
|
|
|
3863
3641
|
jobType ScheduledJobType
|
|
@@ -3902,8 +3680,8 @@ model DocumentExpiryWarning {
|
|
|
3902
3680
|
documentId String
|
|
3903
3681
|
|
|
3904
3682
|
// Warning details
|
|
3905
|
-
expiresAt
|
|
3906
|
-
daysUntil
|
|
3683
|
+
expiresAt DateTime // When document will expire
|
|
3684
|
+
daysUntil Int // Days until expiry at time of warning
|
|
3907
3685
|
warningSent DateTime @default(now())
|
|
3908
3686
|
|
|
3909
3687
|
// Customer notification tracking
|