Notification Repository
Component Detail
Data Layer
medium complexity
mobile
0
Dependencies
3
Dependents
1
Entities
1
Integrations
Description
Data access layer for the Supabase notifications table. Provides typed query methods for fetching, filtering, and mutating notifications. Handles JSONB payload parsing into typed NotificationPayload objects and maps database rows to domain Notification models.
notification-repository
Responsibilities
- Fetch paginated notification list with role-based predicate
- Fetch unread count for a user
- Mark notification as read (set read_at)
- Mark all notifications as read for a user
- Delete/clear all notifications for a user
- Parse JSONB payload into typed domain objects
Interfaces
getNotifications(String userId, NotificationFilter filter, {int limit, int offset})
getUnreadCount(String userId)
markAsRead(String notificationId)
markAllAsRead(String userId)
clearAll(String userId)
parsePayload(Map<String, dynamic> jsonb)
toNotification(Map<String, dynamic> row)
watchUnreadCount(String userId): Stream<int>
Relationships
Dependents (3)
Components that depend on this component
Used Integrations (1)
External integrations and APIs this component relies on