Service Layer medium complexity mobilebackend
1
Dependencies
1
Dependents
2
Entities
0
Integrations

Description

Manages reading and writing user notification preferences against both the local Drift cache and the backend REST API. Queries mandatory notification flags from the server before allowing preference changes, ensures quiet hours are stored as UTC offsets, and enqueues mutations in the outbox for offline-first sync.

Feature: Notification Settings

notification-settings-service

Responsibilities

  • Load notification preferences from local Drift database on startup
  • Write preference changes optimistically to Drift and enqueue in the mutation outbox
  • Fetch mandatory scenario flags from the backend and block disabling mandatory categories
  • Sync preferences to the backend when connectivity is restored
  • Expose Riverpod providers for reactive, observable preference state

Interfaces

getSettings(userId) → NotificationSettings
updateCategoryPreference(userId, categoryId, channel, enabled) → Future<void>
updateQuietHours(userId, quietHoursRange) → Future<void>
isMandatory(categoryId) → bool
syncSettings() → Future<SyncResult>

Relationships

Dependencies (1)

Components this component depends on

Dependents (1)

Components that depend on this component

Related Data Entities (2)

Data entities managed by this component