Service Layer low complexity frontendmobile
0
Dependencies
1
Dependents
2
Entities
0
Integrations

Description

Riverpod/BLoC state management for the currently selected chapter context when a user belongs to multiple chapters. Persists selection to local storage, exposes the active unit ID to all widgets, and broadcasts change events when the user switches chapters via the chapter switcher.

Feature: Organizational Hierarchy & Structure Management

active-chapter-state

Responsibilities

  • Hold and expose the active organization unit ID for the session
  • Persist selection to local secure storage
  • Notify all listeners on chapter switch
  • Reset state on logout

Interfaces

getActiveUnitId()
setActiveUnit(unitId)
watchActiveUnit()
clearActiveUnit()
loadPersistedUnit(userId)

Relationships

Dependents (1)

Components that depend on this component

Related Data Entities (2)

Data entities managed by this component

API Contract

View full contract →
REST /api/v1/active-unit 5 endpoints
GET /api/v1/active-unit Get the currently active unit for the authenticated user
GET /api/v1/active-unit/current Get active unit detail for current session
POST /api/v1/active-unit Set the active unit for the current user session
PUT /api/v1/active-unit/current Switch active unit (replaces previous selection)
DELETE /api/v1/active-unit/current Clear the active unit selection for the current user