feat(backend): Benachrichtigungssystem (Modul 26)
NotificationsModule: Notification-Modell mit Prioritaeten INFO/ HINWEIS/WARNUNG/KRITISCH, GET /notifications (eigene + Broadcast), POST /notifications/:id/read. record() als interne API fuer kuenftige Automatisierungsregeln (Modul 30) vorgesehen.
This commit is contained in:
1 parent
9b078022ff
commit
a57cde1f9a
9 files changed
+299
-1
No files matched your search
@@ -50,6 +50,7 @@ model User {
|
||||
colonyMoves ColonyApiaryHistory[]
|
||||
auditLogs AuditLog[]
|
||||
bottlingBatches BottlingBatch[]
|
||||
notifications Notification[]
|
||||
|
||||
@@index([role])
|
||||
}
|
||||
@@ -698,3 +699,29 @@ model Equipment {
|
||||
|
||||
@@index([condition])
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// Benachrichtigungssystem (Abschnitt 24) – v1.x Modul 26
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
enum NotificationPriority {
|
||||
INFO
|
||||
HINWEIS
|
||||
WARNUNG
|
||||
KRITISCH
|
||||
}
|
||||
|
||||
model Notification {
|
||||
id String @id @default(cuid())
|
||||
userId String?
|
||||
user User? @relation(fields: [userId], references: [id])
|
||||
priority NotificationPriority
|
||||
message String
|
||||
relatedType String?
|
||||
relatedId String?
|
||||
read Boolean @default(false)
|
||||
createdAt DateTime @default(now())
|
||||
|
||||
@@index([userId, read])
|
||||
@@index([priority])
|
||||
}
|
||||
Reference in new issue
Block a user