Service Layer medium complexity backend
1
Dependencies
2
Dependents
14
Entities
0
Integrations

Description

Backend service layer handling all user lifecycle operations including invitation-based creation, profile updates, and soft deactivation. Enforces multi-tenant scoping so Org Admins only operate on users within their organization while Global Admins can operate cross-organization. Coordinates with the authentication system for invitation token generation and email dispatch.

Feature: User CRUD

user-service

Responsibilities

  • Orchestrate user invitation flow with time-limited token generation and email dispatch
  • Enforce multi-tenant authorization using JWT organization context
  • Handle user profile updates with validation and audit logging
  • Manage soft deactivation and reactivation preserving audit history
  • Provide paginated, filtered user queries scoped to the caller's tenant

Interfaces

inviteUser(email, organizationId, roleIds, localAssociationIds)
getUserById(userId, tenantContext)
listUsers(filters, pagination, tenantContext)
updateUser(userId, updates, tenantContext)
deactivateUser(userId, tenantContext)
reactivateUser(userId, tenantContext)
resendInvitation(userId, tenantContext)
validateInvitationToken(token)
searchUsers(query, tenantContext)
getUsersByLocalAssociation(associationId, tenantContext)

Relationships

Dependencies (1)

Components this component depends on

Dependents (2)

Components that depend on this component