feat(phase3): worker container + event bus + scheduled jobs
apps/worker: - BullMQ nightly scheduler (cron 0 3 * * *) - Redis Streams consumer-group per wired/active project - Persists events to Event model schema: - Event model (streamId unique, project + type indexed)
This commit is contained in:
@@ -79,6 +79,20 @@ model Project {
|
||||
updatedAt DateTime @updatedAt
|
||||
}
|
||||
|
||||
model Event {
|
||||
id String @id @default(cuid())
|
||||
streamId String @unique
|
||||
projectKey String
|
||||
eventType String
|
||||
version Int @default(1)
|
||||
payload Json
|
||||
occurredAt DateTime
|
||||
receivedAt DateTime @default(now())
|
||||
|
||||
@@index([projectKey, occurredAt])
|
||||
@@index([eventType])
|
||||
}
|
||||
|
||||
model AuditLog {
|
||||
id String @id @default(cuid())
|
||||
actorUserId String?
|
||||
|
||||
Reference in New Issue
Block a user