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:
Semih
2026-05-13 11:03:58 +00:00
parent 5ef1597842
commit b9709ed07e
11 changed files with 457 additions and 2 deletions

View File

@@ -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?