Data Layer medium complexity mobile
0
Dependencies
0
Dependents
1
Entities
0
Integrations

Description

Handles persistence of user notification preferences, storing them in local device storage and synchronising with the backend API. It abstracts the dual-write strategy so callers do not need to manage local versus remote storage directly. On read, it returns the locally cached version and triggers a background sync when connectivity is available.

Feature: Notification Settings

notification-preference-repository

Sources & reasoning

User preference control follows from the WCAG cognitive accessibility mandate (line 28) and the need to serve low-digital-skill users. Blueprint marks notification-settings [MVP]. First phase ordinal = MVP. Settings are a standard companion to any notification system.

  • Bottom nav with 5 tabs: Home, Contacts, Add (modal launcher for Activity and Event wizards), Work, Notifications
  • Appen SKAL oppfylle WCAG 2.2 nivå AA som minimumskrav for alle skjermer og interaksjoner - fra dag én, for alle organisasjoner.

Responsibilities

  • Read preferences from local storage with fallback to backend API
  • Write preferences to local storage immediately for offline resilience
  • Synchronise local preferences to backend when network is available
  • Handle conflict resolution when local and remote preferences diverge

Interfaces

findByUserId(userId: string): Promise<NotificationPreferences | null>
save(userId: string, prefs: NotificationPreferences): Promise<void>
syncToBackend(userId: string): Promise<void>
clearLocal(userId: string): Promise<void>

Related Data Entities (1)

Data entities managed by this component