Organization Service
Component Detail
Service Layer
medium complexity
mobile
1
Dependencies
2
Dependents
2
Entities
0
Integrations
Description
Business logic layer responsible for fetching, caching, and managing the active organization context throughout the app session. Loads the organization list from the REST API, caches it locally, and exposes the selected organization's ID, labels, and settings to the rest of the application via Riverpod global state. Injects the organization context into all subsequent API calls via request interceptors.
organization-service
Responsibilities
- Fetch the list of available organizations from /api/v1/organizations and cache the result
- Persist the user's selected organization ID to local preferences
- Expose the active organization context (ID, labels, settings) via Riverpod providers
- Determine whether the current user requires the onboarding flow or can skip it
- Clear or refresh the organization context on logout or organization switch
Interfaces
fetchOrganizations()
selectOrganization(orgId)
getActiveOrganization()
getOrganizationLabels(orgId)
isOnboardingRequired(userId)
markOnboardingComplete(userId)
clearOrganizationContext()
refreshOrganizationData()
Relationships
Dependents (2)
Components that depend on this component
Related Data Entities (2)
Data entities managed by this component