Chapter Scope Resolver
Component Detail
Description
Service that determines the set of chapter IDs a coordinator is authorized to query. Handles NHF's multi-chapter membership (up to 5 chapters per coordinator) by loading chapter associations from the user profile and building the scope filter for downstream queries. Used by both stats and bulk registration flows.
chapter-scope-resolver
Summaries
The Chapter Scope Resolver is a critical access control service that ensures coordinators can only view and manage data within their authorized chapters, directly protecting NHF's data privacy obligations and reducing compliance risk. By accurately enforcing multi-chapter membership rules — supporting up to five chapters per coordinator — this service prevents unauthorized data access, which could otherwise expose the organization to regulatory liability and erode member trust. Its session-level caching means coordinators experience fast, seamless access to their permitted data without repeated delays, directly improving user satisfaction and operational efficiency across both reporting and registration workflows.
The Chapter Scope Resolver is a shared service consumed by both the statistics and bulk registration flows, meaning its delivery is on the critical path for at least two major feature areas. Development complexity is medium — the core logic is straightforward, but thorough testing is required to cover multi-chapter edge cases, cache invalidation scenarios, and consistent behavior for single-chapter coordinators. Any delays or defects here will cascade into blocked downstream work on dashboards and registration pipelines. Testing should include unit coverage for scope resolution logic and integration tests against real user profile data.
The caching layer should be validated for session boundary correctness to avoid stale authorization data.
The Chapter Scope Resolver is a mobile-execution service that loads chapter associations from the user profile and exposes them as a filtered list of authorized chapter IDs. It implements session-level caching via `invalidateCache(String coordinatorId)` to avoid redundant profile reads within a session. The `getChapterIds` and `isInScope` methods are the primary integration points consumed by stats queries and bulk registration flows. `getChapterLabels` supports display-layer formatting.
No external service dependencies are declared, so it depends on a locally available user profile store. The component must handle both single and multi-chapter coordinators uniformly, requiring defensive handling of empty or null chapter lists. Cache invalidation should be called on session transitions or profile updates to prevent stale scope data.
Responsibilities
- Load coordinator's chapter associations from user profile
- Return list of authorized chapter IDs for scope filtering
- Support single and multi-chapter coordinators uniformly
- Cache chapter scope for the session to avoid repeated lookups
Interfaces
getChapterIds(String coordinatorId) Future<List<String>>
isInScope(String chapterId, String coordinatorId) Future<bool>
invalidateCache(String coordinatorId)
getChapterLabels(List<String> chapterIds) Future<Map<String, String>>
Relationships
Dependents (2)
Components that depend on this component
Related Data Entities (4)
Data entities managed by this component