AdminUserService
Component Detail
Service Layer
medium complexity
backend
0
Dependencies
0
Dependents
11
Entities
0
Integrations
Description
Orchestrates all administrative user lifecycle operations including invitation, profile updates, deactivation, and deletion. Enforces multi-tenant isolation by scoping every operation to the calling administrator's tenant. Acts as the authoritative business logic layer between the UI and the data repository.
admin-user-service
Sources & reasoning
Lines 325-328 explicitly place Brukeradministrasjon (invite, deactivate, role assignment) in the Admin Web Portal MVP scope. Without user CRUD the organization cannot onboard any peer mentors or coordinators, making the platform non-functional. It is the prerequisite for all other admin portal capabilities and directly referenced in the Phase 1 MVP deliverables.
-
docs/source/likeperson.md · line 325-328- Brukeradministrasjon (invitere, deaktivere, rolletildeling)
Responsibilities
- Validate tenant membership and admin authorization before any mutation
- Coordinate user invitation flow including token generation and email dispatch
- Apply and persist profile updates with field-level validation
- Enforce deactivation rules (e.g. cannot deactivate the last active admin)
- Execute permanent deletion and cascade cleanup of related records
Interfaces
listUsers(tenantId, query): UserPage
getUser(tenantId, userId): User
inviteUser(tenantId, email, role): InviteResult
updateUser(tenantId, userId, changes): User
deactivateUser(tenantId, userId): void
deleteUser(tenantId, userId): void
Related Data Entities (11)
Data entities managed by this component
Activity Type
15 fields
configuration
Geographic Location
13 fields
core
Local Association
13 fields
core
Member Association
12 fields
core
Organization
21 fields
core
Organization Hierarchy
12 fields
configuration
Peer Mentor Certificate
16 fields
core
Peer Mentor Status
12 fields
core
User
24 fields
core
User Organization Membership
16 fields
core
User Role
12 fields
core