Hierarchy Cache
Component Detail
Data Layer
low complexity
shared
0
Dependencies
0
Dependents
1
Entities
0
Integrations
Description
In-memory and optional local-storage cache for the full organizational hierarchy tree. Prevents repeated Supabase fetches for a structure that changes infrequently. Exposes invalidation hooks consumed by the hierarchy service when nodes are created, updated, or deleted.
hierarchy-cache
Responsibilities
- Cache full hierarchy tree per organization in memory
- Serve cached tree to hierarchy service on read
- Invalidate on any write operation to organization_units
- Persist flat unit list to local storage for offline access
Interfaces
get(organizationId)
set(organizationId, tree)
invalidate(organizationId)
invalidateNode(unitId)
isPersisted(organizationId)