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.

Feature: In-app Notification Centre

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>

Related Data Entities (1)

Data entities managed by this component

Used Integrations (1)

External integrations and APIs this component relies on

API Contract

View full contract →
REST /api/v1/notifications 7 endpoints
GET /api/v1/notifications
GET /api/v1/notifications/:id
POST /api/v1/notifications
PUT /api/v1/notifications/:id
DELETE /api/v1/notifications/:id
POST /api/v1/notifications/:id/read
+1 more