Service Layer medium complexity mobilebackend
0
Dependencies
0
Dependents
3
Entities
0
Integrations

Description

Business logic layer responsible for reading and writing notification preferences, coordinating between the UI and the repository. Applies validation rules and syncs confirmed preferences to the backend so the NotificationDispatcher can enforce opt-outs server-side. Acts as the single source of truth for preference state within the feature.

Feature: Notification Settings

notification-preferences-service

Sources & reasoning

Notification settings are a necessary companion to the push and scenario features documented at line 116. HLF's Phase 2 scenario-based notifications imply user control over alert frequency and channel. Blueprint marks this [v1.0], aligning with the Phase 2 placement in the source roadmap (→ v1.0).

  • docs/source/likeperson.md · line 116
    Oppfølging av likepersoner: 40 % var ikke fornøyd med oppfølgingen i spørreundersøkelse. Scenariobaserte push-meldinger og kalendersynkronisering.

Responsibilities

  • Fetch current notification preferences from NotificationPreferencesRepository
  • Validate and persist updated preferences via repository
  • Sync preference changes to the backend API for server-side enforcement
  • Provide preference state to UI components on demand
  • Handle sync failures with retry or offline queuing strategy

Interfaces

getPreferences(userId: string): Promise<NotificationPreferences>
updatePreference(userId: string, category: string, channel: string, enabled: boolean): Promise<void>
syncToBackend(userId: string): Promise<SyncResult>