From 4931253c4364c8f7eaeffae6b977b1e67eb29945 Mon Sep 17 00:00:00 2001 From: walexjnr Date: Sat, 13 Jun 2026 15:02:02 +0100 Subject: [PATCH] feat: add NotificationPreference and AuditLog entities --- prisma/schema.prisma | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/prisma/schema.prisma b/prisma/schema.prisma index 41fbcd4..45f9f1d 100644 --- a/prisma/schema.prisma +++ b/prisma/schema.prisma @@ -11,5 +11,35 @@ model User { email String @unique createdAt DateTime @default(now()) + notificationPreferences NotificationPreference[] + auditLogs AuditLog[] + @@map("users") +} + +model NotificationPreference { + id String @id @default(cuid()) + userId String + discordEnabled Boolean @default(false) + telegramEnabled Boolean @default(false) + emailEnabled Boolean @default(false) + alertTypes String[] + createdAt DateTime @default(now()) + + user User @relation(fields: [userId], references: [id]) + + @@map("notification_preferences") +} + +model AuditLog { + id String @id @default(cuid()) + userId String + action String + actor String + metadata Json? + createdAt DateTime @default(now()) + + user User @relation(fields: [userId], references: [id]) + + @@map("audit_logs") } \ No newline at end of file