notification implemented

This commit is contained in:
root
2026-05-25 13:12:06 -04:00
parent 33b6bb55f0
commit c8bde121fc
31 changed files with 1491 additions and 1291 deletions
+24
View File
@@ -377,6 +377,7 @@ enum AdminAction {
}
enum NotificationType {
ACCOUNT_CREATED
NEW_BOOKING
BOOKING_CANCELLED
PAYMENT_RECEIVED
@@ -540,6 +541,7 @@ model BillingAccount {
isPrimary Boolean @default(true)
legalName String
billingEmail String
preferredLanguage String @default("en")
billingAddress Json?
taxId String?
taxExempt Boolean @default(false)
@@ -1218,6 +1220,8 @@ model Notification {
body String
data Json?
channel NotificationChannel
templateKey String?
locale String @default("en")
status NotificationStatus @default(PENDING)
sentAt DateTime?
failReason String?
@@ -1231,6 +1235,26 @@ model Notification {
@@map("notifications")
}
model NotificationTemplate {
id String @id @default(cuid())
templateKey String
category String
channel NotificationChannel
locale String
subject String?
body String
requiredVariables Json?
optionalVariables Json?
version Int @default(1)
isActive Boolean @default(true)
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
@@unique([templateKey, channel, locale, version])
@@index([templateKey, channel, locale, isActive])
@@map("notification_templates")
}
model NotificationPreference {
id String @id @default(cuid())
employeeId String?