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

Description

Local data access layer that wraps the user_profiles and user_preferences tables for the mobile app. Provides typed read and write operations and caches the current user's profile for fast UI rendering.

Feature: Profile Data & Settings

user-profile-store

Sources & reasoning

Profile Data & Settings is the canonical 'my account' surface; the source explicitly lists Settings and preferences as an MVP screen and Subprocessors.md mandates application-level encryption for profile name/phone. Placed in MVP because every role-aware feature depends on accurate profile data from day one.

  • docs/source/likeperson.md · line 223-224
    Settings and preferences
  • docs/source/likeperson.md · line 190-190
    Peer Mentor (Likeperson): Creates and tracks activities and follow-ups. Logs in to the Mobile App only. Beginner-level digital skills assumed.
  • Brukerprofiler, e-post, bcrypt-passordhasher... Navn og telefonnummer krypteres pĂĄ applikasjonsnivĂĄ (AES-256-GCM) før lagring.

Responsibilities

  • Execute CRUD operations against user_profiles and user_preferences tables
  • Cache the current user's profile and preferences in memory for fast access
  • Synchronize local changes with the backend when connectivity is available
  • Expose change subscriptions so the Profile Service can react to external updates
  • Map raw table rows to typed UserProfile and UserPreferences objects

Interfaces

findProfileByUserId(userId): Promise<UserProfile | null>
upsertProfile(profile): Promise<UserProfile>
findPreferencesByUserId(userId): Promise<UserPreferences | null>
upsertPreferences(prefs): Promise<UserPreferences>
subscribe(userId, listener): Unsubscribe