feat: add notification database structure

This commit is contained in:
Methapon Metanipat 2024-10-29 15:11:43 +07:00
parent 456f08b82e
commit 3391a53daf

View file

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