ProfileService
Component Detail
Service Layer
medium complexity
mobile
0
Dependencies
0
Dependents
2
Entities
0
Integrations
Description
Business logic layer responsible for fetching and updating user profile data. Coordinates between the UI screens and ProfileRepository, applying any validation rules and access control checks before persisting changes. Handles error normalization so the UI receives consistent, user-friendly feedback.
profile-service
Sources & reasoning
The source doc explicitly lists profile screens in the mobile architecture section (line 294) and places settings behind the hamburger menu (line 290). Fase 1 / MVP scope (line 322) names the two mobile roles, confirming profile management is launch-critical. WCAG requirements (lines 32-35) apply universally from day one, driving the accessibility constraints in this feature.
-
docs/source/likeperson.md · line 290Settings accessible from hamburger menu
-
docs/source/likeperson.md · line 294Contact detail, edit, and peer mentor profile screens
-
docs/source/likeperson.md · line 3222 mobilrolle-profiler: Peer Mentor, Coordinator (Organization Admins logger på som Coordinator i app-konteksten)
-
docs/source/likeperson.md · line 32-35Kognitiv tilgjengelighet: NHF nevner spesifikt slagrammede. Enkel navigasjon, logisk flyt, ikke for mange valg. Tydelige feilmeldinger med forslag til løsning.
Responsibilities
- Retrieve the authenticated user's profile from ProfileRepository
- Validate incoming profile updates against business rules before persistence
- Enforce role-based access control to ensure users can only modify their own profiles
- Normalize errors from the repository layer into user-facing messages
- Propagate language and notification preference changes to the relevant downstream modules
Interfaces
getProfile(userId: string): Promise<UserProfile>
updateProfile(userId: string, updates: ProfileUpdate): Promise<UserProfile>
updatePreferences(userId: string, prefs: UserPreferences): Promise<void>
Related Data Entities (2)
Data entities managed by this component