Notification Repository
Component Detail
Data Layer
medium complexity
mobilebackend
0
Dependencies
0
Dependents
2
Entities
0
Integrations
Description
Data access layer for the notifications and push_notification_configs tables in Supabase. Provides CRUD operations for notification records, device token management, and preference storage. Supports real-time subscription for live notification badge updates.
notification-repository
Responsibilities
- Fetch paginated notifications for the current user
- Mark individual or all notifications as read
- Save and retrieve per-user notification preferences
- Upsert device token records
- Subscribe to real-time notification inserts for live badge count
Interfaces
getNotifications(userId, page, limit)
getUnreadCount(userId)
markAsRead(notificationId)
markAllAsRead(userId)
deleteNotification(notificationId)
getNotificationConfig(userId)
upsertNotificationConfig(config)
upsertDeviceToken(userId, token, platform)
removeDeviceToken(userId)
subscribeToNewNotifications(userId, callback)
unsubscribe(subscription)
Related Data Entities (2)
Data entities managed by this component