-
Notifications
You must be signed in to change notification settings - Fork 10.4k
Open
Labels
enterprisearea: enterprise, audit log, organisation, SAML, SSOarea: enterprise, audit log, organisation, SAML, SSO❗️ migrationscontains migration filescontains migration files
Description
Create a BookingAudit
table in the database to record all booking mutations. The table should be optimized for high write throughput and structured as follows:
model BookingAudit {
id String @id @default(uuid7())
bookingId String
userId String?
type BookingAuditType
action BookingAuditAction?
timestamp DateTime @default(now())
data Json?
}
Notes:
- No secondary indexes (only primary key).
- Use
uuid7()
for time-sortable ID. - Strict
data
typing with Zod
All BookingAudit.data
payloads must be strictly validated using Zod schemas before insertion. This prevents schema drift and allows versioned audit payloads.
Requirements:
- One Zod schema per
BookingAuditAction
- Shared fields:
version
,actor
,internalLog?
- Provide central map of action → schema
Example:
{
version: 1,
type: "rescheduled",
from: "2025-07-23T10:00Z",
to: "2025-07-24T10:00Z",
actor: { type: "attendee" }
}
Metadata
Metadata
Assignees
Labels
enterprisearea: enterprise, audit log, organisation, SAML, SSOarea: enterprise, audit log, organisation, SAML, SSO❗️ migrationscontains migration filescontains migration files