high complexity extracted Organization Management Confidence: 100%
5
Components
39
Shared
0
User Stories
Yes
Analyzed

Description

Multi-Organization Hierarchy enables the platform to represent complex organizational structures where multiple local chapters, regional bodies, or member associations exist within a single parent organization. For NHF, this means supporting 12 national associations, 9 regions, and up to 1,400 local chapters. The hierarchy system allows activity data, reporting, and user memberships to be correctly attributed and aggregated across organizational levels, preventing double-counting and ensuring accurate Bufdir reporting. Administrators at higher levels of the hierarchy can view aggregated data across their sub-organizations while retaining strict data isolation between sibling organizations. The hierarchy is managed through the Hierarchy Management Page in the admin portal.

Analysis

Business Value

NHF's organizational structure with 1,400 local chapters is the most complex onboarding case for the platform, but the hierarchy problem is not unique to NHF - any federation-style organization will require parent-child relationships between organizational units. Without hierarchy support, aggregated reporting is impossible or must be done manually, which defeats the core value proposition of automated Bufdir reporting. The double-counting problem (where a user belonging to multiple local chapters could have their activities counted multiple times) is a compliance risk that could cause organizations to lose Bufdir funding. Solving hierarchy correctly also enables future growth: as Meander onboards more complex organizations, the data model scales without structural changes. The strict data isolation guarantee ensures that even within a hierarchy, sibling organizations cannot access each other's operational data.

Implementation Notes

The organizations table uses a self-referential parent_organization_id column to represent the hierarchy, with depth limited to three levels (national → regional → local) to keep query complexity manageable. Organization membership in the organization_memberships table links users to one or more organizational units, with a primary_organization_id for disambiguation. Aggregation queries for reporting use recursive CTEs in PostgreSQL to traverse the hierarchy upward, always anchored to the requesting admin's organizational scope to enforce isolation. The admin portal hierarchy management page renders the tree using a collapsible tree component with inline add/remove actions. Role-based access control enforces that admins at a given level can only manage their own level and below - a regional admin cannot modify a national-level organization. The mobile app resolves the user's primary organization at login and does not expose hierarchy management surfaces, keeping the coordinator and peer mentor experience simple.

Components (44)

User Interface (1)

Service Layer (2)

Data Layer (1)

Infrastructure (1)

Shared Components

These components are reused across multiple features

User Stories

No user stories have been generated for this feature yet.