NotificationPreferenceService
Component Detail
Service Layer
medium complexity
mobilebackend
0
Dependencies
0
Dependents
1
Entities
0
Integrations
Description
Mediates between the settings UI and the repository layer, reading and writing user notification preferences. It validates preference payloads before persistence and propagates changes to the scenario engine so opted-out channels and types are excluded from future notifications. Acts as the single point of truth for preference state during a session.
notification-preference-service
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.
-
docs/source/likeperson.md · line 290Bottom nav with 5 tabs: Home, Contacts, Add (modal launcher for Activity and Event wizards), Work, Notifications
-
docs/source/likeperson.md · line 28Appen SKAL oppfylle WCAG 2.2 nivå AA som minimumskrav for alle skjermer og interaksjoner - fra dag én, for alle organisasjoner.
Responsibilities
- Fetch current preferences from NotificationPreferenceRepository
- Validate and sanitize incoming preference updates before saving
- Persist updated preferences both locally and to the backend
- Notify the scenario engine of preference changes to suppress unwanted notifications
- Expose observable preference state for reactive UI binding
Interfaces
getPreferences(userId: string): Promise<NotificationPreferences>
updatePreferences(userId: string, prefs: Partial<NotificationPreferences>): Promise<void>
subscribeToPreferences(userId: string): Observable<NotificationPreferences>
notifyScenarioEngine(prefs: NotificationPreferences): void