feat: Implement in-app notifications with new database model, enhance Firebase initialization to support service account files, and add message read functionalities.
This commit is contained in:
@@ -132,6 +132,9 @@ model User {
|
||||
conversations Conversation[]
|
||||
messages Message[]
|
||||
|
||||
// Notifications
|
||||
notifications Notification[]
|
||||
|
||||
@@index([email])
|
||||
@@index([role])
|
||||
@@index([status])
|
||||
@@ -500,6 +503,31 @@ model Message {
|
||||
@@map("messages")
|
||||
}
|
||||
|
||||
// ===========================================
|
||||
// IN-APP NOTIFICATIONS
|
||||
// ===========================================
|
||||
|
||||
model Notification {
|
||||
id String @id @default(uuid())
|
||||
userId String
|
||||
type String // 'connection', 'message', 'system', 'update', 'request'
|
||||
title String
|
||||
description String
|
||||
read Boolean @default(false)
|
||||
actionUrl String?
|
||||
data Json? // Extra metadata (conversationId, connectionRequestId, etc.)
|
||||
|
||||
// Timestamps
|
||||
createdAt DateTime @default(now())
|
||||
|
||||
// Relations
|
||||
user User @relation(fields: [userId], references: [id], onDelete: Cascade)
|
||||
|
||||
@@index([userId, read])
|
||||
@@index([userId, createdAt])
|
||||
@@map("notifications")
|
||||
}
|
||||
|
||||
// ===========================================
|
||||
// CMS CONTENT - Dynamic page content management
|
||||
// ===========================================
|
||||
|
||||
Reference in New Issue
Block a user