Data Layer medium complexity backend
0
Dependencies
0
Dependents
0
Entities
0
Integrations

Description

Data access layer responsible for persisting notification records, delivery metadata, and acknowledgement state to the database. Provides query methods for inbox retrieval and unread counts consumed by PushNotificationService and NotificationInboxScreen.

Feature: Push Notifications

notification-repository

Sources & reasoning

Notifications is a named bottom-nav tab (line 290), establishing it as a first-class MVP surface. HLF follow-up dissatisfaction data (line 116) confirms urgency. Blueprint marks push-notifications [MVP]. First phase ordinal = MVP.

  • Bottom nav with 5 tabs: Home, Contacts, Add (modal launcher for Activity and Event wizards), Work, Notifications
  • Oppfølging av likepersoner: 40 % var ikke fornøyd med oppfølgingen i spørreundersøkelse. Scenariobaserte push-meldinger og kalendersynkronisering.

Responsibilities

  • Persist new notification records with type, target user, payload, and delivery timestamp
  • Query notifications by user ID with pagination and read/unread filtering
  • Update acknowledgement state and read timestamps
  • Delete or archive dismissed notifications
  • Return aggregate unread counts per user

Interfaces

save(notification: NotificationRecord): Promise<NotificationRecord>
findByUserId(userId: string, options: PaginationOptions): Promise<NotificationRecord[]>
markRead(notificationId: string): Promise<void>
delete(notificationId: string): Promise<void>
countUnread(userId: string): Promise<number>