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

Description

The data access layer responsible for persisting and retrieving profile records both locally (SQLite/AsyncStorage cache) and remotely via the backend API. Abstracts storage details from the service layer and provides a consistent interface regardless of connectivity state. Handles cache invalidation and conflict resolution when syncing with the server.

Feature: Profile Data & Settings

profile-repository

Sources & reasoning

Profile Data & Settings is MVP per the blueprint [MVP] marker. The source doc lists peer mentor profile screens and settings as explicit Mobile App screen inventory items (lines 294, 297), and the Fase 1 MVP scope requires two mobile role profiles (line 325). The org labels system (line 310) means the profile UI must dynamically reflect per-org terminology, making this a foundational integration surface from launch.

  • docs/source/likeperson.md Ā· line 294-297
    Contact detail, edit, and peer mentor profile screens - Activity wizard (multi-step: contact → date → time → duration → summary) - Event wizard - Settings and preferences
  • Organization labels system - per-org terminology overrides fetched from backend and cached offline (currently: `contacts`, `my_contacts`, `peer_mentors`; extensible to singular forms
  • 2 mobilrolle-profiler: Peer Mentor, Coordinator (Organization Admins logger pĆ„ som Coordinator i app-konteksten)

Responsibilities

  • Persist profile data to local device cache for offline access
  • Retrieve cached profile records and return stale data when offline
  • Sync local changes to the backend and handle conflict resolution
  • Invalidate and refresh cache entries after a successful remote update
  • Map raw API response payloads to typed UserProfile domain objects

Interfaces

findById(userId: string): Promise<UserProfile | null>
save(profile: UserProfile): Promise<void>
syncToRemote(userId: string): Promise<SyncResult>
invalidateCache(userId: string): void

Related Data Entities (1)

Data entities managed by this component