diff --git a/prisma/schema.prisma b/prisma/schema.prisma index 952ed31..6f93fb6 100644 --- a/prisma/schema.prisma +++ b/prisma/schema.prisma @@ -12,6 +12,22 @@ datasource db { url = env("DATABASE_URL") } +model Notification { + id String @id @default(cuid()) + + title String + detail String + + groupReceiver String + + receiver User? @relation(name: "NotificationReceiver", fields: [receiverId], references: [id], onDelete: Cascade) + receiverId String? + + createdAt DateTime @default(now()) + + readByUser User[] +} + model Menu { id String @id @default(cuid()) @@ -426,6 +442,8 @@ model User { flowUpdated WorkflowTemplate[] @relation("FlowUpdatedByUser") invoiceCreated Invoice[] paymentCreated Payment[] + notificationReceive Notification[] @relation("NotificationReceiver") + notificationRead Notification[] } enum CustomerType {