Data Layer low complexity backend
0
Dependencies
0
Dependents
1
Entities
0
Integrations

Description

Manages persistence of notification records in the notifications table, enabling the in-app notification inbox. Stores payload metadata, read status, and contextual routing data (entity type and ID) alongside delivery timestamps.

Feature: Push Notifications

notification-record-repository

Responsibilities

  • Insert notification records after dispatch for inbox display
  • Retrieve paginated notification list for a given userId ordered by created_at
  • Update read_at timestamp on mark-as-read
  • Count unread notifications for badge rendering
  • Bulk-update all unread notifications for a user to read

Interfaces

create(record: NotificationRecord) → Promise<NotificationRecord>
findByUserId(userId: string, page: number, pageSize: number) → Promise<NotificationRecord[]>
markAsRead(notificationId: string) → Promise<void>
markAllAsRead(userId: string) → Promise<void>
countUnread(userId: string) → Promise<number>

Related Data Entities (1)

Data entities managed by this component