HIGH story-organisation-admin-portal-organization-admin-003 13 pts
13
Story Points
High
Priority
Organisation Admin Portal
Feature

User Story

As a Organization Administrator
I want to view and edit the hierarchical structure of my organisation — regions, chapters, and sub-units — and assign users to the correct units
So that activity reporting, statistics, and Bufdir exports are correctly attributed to the right organisational unit and data isolation between chapters is enforced

Acceptance Criteria

  • Given I open the hierarchy admin portal, when the tree loads, then I can see all levels (national → regional → local) collapsed by default with expand/collapse controls
  • Given I create a new chapter node, when I assign a coordinator to it, then that coordinator's app immediately scopes all data access to that chapter
  • Given I archive a chapter, when existing users in that chapter log in, then they are shown a no-access screen until reassigned to an active chapter
  • Given I attempt to create a circular hierarchy (child becomes parent of its own ancestor), then the validator rejects the operation with a descriptive error
  • Given I use the chapter switcher as a regional admin, when I switch to a sub-chapter, then all screens (contacts, stats, export) reflect data scoped to the selected chapter
  • Given the hierarchy has 1,400+ nodes, when I search for a chapter by name, then results appear within 500ms using cached hierarchy data

Business Value

Incorrect organisational hierarchy mapping is the root cause of misattributed Bufdir reports, which can lead to funding allocation errors and failed audits. A self-service hierarchy editor allows organisations like NHF with 1,400 local chapters to maintain accurate structure without engineering support, reducing the cost of organisational changes from hours of developer time to minutes of admin work. Correct RLS scoping also ensures GDPR compliance by preventing data leakage between chapters.