ProfileService
Component Detail
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.
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-297Contact detail, edit, and peer mentor profile screens - Activity wizard (multi-step: contact ā date ā time ā duration ā summary) - Event wizard - Settings and preferences
-
docs/source/likeperson.md Ā· line 310Organization labels system - per-org terminology overrides fetched from backend and cached offline (currently: `contacts`, `my_contacts`, `peer_mentors`; extensible to singular forms
-
docs/source/likeperson.md · line 3252 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