mirror of
https://github.com/Since-3/Kuma.git
synced 2026-10-12 21:41:17 +00:00
added pwa infrastructure and push notifcation
This commit is contained in:
parent
b6e1ddc265
commit
163ae46468
25 changed files with 1916 additions and 205 deletions
|
|
@ -266,6 +266,25 @@ model Notification {
|
|||
@@index([recipientId, createdAt])
|
||||
}
|
||||
|
||||
// Web-Push-Subscriptions (ein Datensatz pro Browser/Gerät). recipientId ist
|
||||
// polymorph wie bei Notification (Manager-, Employee- oder User-ID) - Push ist
|
||||
// ein zweiter Zustellkanal für createNotification(), kein eigenes System.
|
||||
// endpoint ist pro Push-Dienst (FCM/Mozilla/...) global eindeutig und dient
|
||||
// als natürlicher Unique-Key, um dasselbe Gerät bei erneutem Subscribe zu
|
||||
// aktualisieren statt zu duplizieren.
|
||||
model PushSubscription {
|
||||
id String @id @default(uuid())
|
||||
recipientId String
|
||||
endpoint String @unique
|
||||
p256dh String // Public Key des Browsers für die Payload-Verschlüsselung
|
||||
auth String // Auth-Secret des Browsers für die Payload-Verschlüsselung
|
||||
userAgent String? // Nur zur Anzeige in einer künftigen "Geräte verwalten"-UI
|
||||
createdAt DateTime @default(now())
|
||||
lastSeenAt DateTime @default(now()) // Bei jedem erneuten Subscribe aktualisiert
|
||||
|
||||
@@index([recipientId])
|
||||
}
|
||||
|
||||
// Rabattcode eines Business. scope = "specific_courses" schränkt die Gültigkeit
|
||||
// über courseIds ein (Array statt Join-Tabelle, analog Course.trainers/sport —
|
||||
// hier reicht eine Handvoll IDs pro Code, kein eigenes Modell nötig).
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue