Service Layer medium complexity mobile
0
Dependencies
0
Dependents
3
Entities
0
Integrations

Description

The service layer that orchestrates profile reads and updates between the mobile client and the backend API. Handles optimistic local cache updates and rolls back on failure, ensuring offline resilience. Enforces role-based field visibility rules before passing data to the UI layer.

Feature: Profile Data & Settings

profile-service

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

  • Fetch the current user's profile from the backend and update local cache
  • Submit profile update requests to the backend REST endpoint
  • Apply role-based field filtering before returning data to callers
  • Manage optimistic cache updates and rollback on API error
  • Propagate per-organization terminology configuration to consumers

Interfaces

getProfile(userId: string): Promise<UserProfile>
updateProfile(userId: string, payload: ProfileUpdatePayload): Promise<UserProfile>
getVisibleFields(roleId: string): FieldDefinition[]
getTerminologyOverrides(orgId: string): TerminologyMap

Related Data Entities (3)

Data entities managed by this component