NotificationRepository
Component Detail
Data Layer
medium complexity
mobilebackend
0
Dependencies
0
Dependents
1
Entities
0
Integrations
Description
Persistence layer responsible for storing, retrieving, and managing notification records in both the server database and the local Drift database on device. It tracks delivery status, read state, and timestamps, enabling the inbox screen to show accurate history and the service to audit dispatched alerts.
notification-repository
Sources & reasoning
Line 181 lists push notifications as a core always-available Mobile App capability, confirming MVP scope. Line 116 (HLF Phase 2) cites scenario-based push messages, but the base delivery infrastructure is required from launch. Line 298 confirms the inbox screen. Blueprint marks this [MVP].
-
docs/source/likeperson.md · line 181Push notifications and assignment tracking
-
docs/source/likeperson.md · line 116Scenariobaserte push-meldinger og kalendersynkronisering.
-
docs/source/likeperson.md · line 298Notification inbox
Responsibilities
- Save outbound notification records with status, recipient, payload, and timestamp
- Retrieve paginated notification history per user ordered by recency
- Update read state for individual notifications or bulk-mark-all-read operations
- Maintain an offline queue table for notifications pending delivery
- Expose unread count queries for badge surfacing in navigation
Interfaces
saveNotification(notification: NotificationRecord): Promise<string>
getNotifications(userId: string, page: number, pageSize: number): Promise<NotificationPage>
updateReadState(notificationId: string, isRead: boolean): Promise<void>
markAllRead(userId: string): Promise<void>
getUnreadCount(userId: string): Promise<number>
saveToOfflineQueue(notification: NotificationRecord): Promise<void>
getOfflineQueue(): Promise<NotificationRecord[]>
removeFromOfflineQueue(notificationId: string): Promise<void>