Scope Bufdir Report Across Multi-Chapter Organization
Organizations like NHF have complex hierarchies (12 national associations, 9 regions, 1,400 local chapters). Bufdir reports are submitted at specific organizational levels, and a coordinator at the regional level must report for all chapters in their region, while a national coordinator reports for the entire organization. The export scope selector allows coordinators to choose which organizational unit they are reporting for, and the org hierarchy resolver applies the correct data isolation to include only activities from the selected scope. This is critical for preventing double-counting and ensuring that activities appear in exactly one Bufdir report.
User Story
Acceptance Criteria
- Given I am a regional coordinator, when I open the Bufdir export flow, then the scope selector shows my region and all chapters within it as selectable scopes
- Given I select a specific scope, when the aggregation runs, then only activities attributed to units within the selected scope are included in the report
- Given the same activity could theoretically appear in multiple reports, when I run an export for scope A, then activities already exported in a narrower scope are flagged to prevent double-counting
- Given I am a national-level coordinator, when I view scope options, then I can select the full national scope to include all chapters
- Given a coordinator has access to only one chapter, when they open the scope selector, then it defaults to their chapter with no option to expand scope beyond their authorization
- Given multi-org data isolation is applied, when the aggregation query runs, then Supabase RLS ensures data from other organizations is never included regardless of the scope selection
Business Value
NHF's 1,400-chapter hierarchy and the requirement to support reporting at multiple organizational levels makes scope management one of the most technically complex and business-critical requirements of the Bufdir feature. Incorrect scope leads to either under-reporting (missing chapters) or double-reporting (the same activity submitted by both a chapter and its parent region), either of which could trigger funding disputes or compliance failures with Bufdir.
Components
- Export Scope Selector ui
- Organisation Hierarchy Resolver service
- Multi-Organization Data Isolator data
- Aggregation Query Builder data
- Access Scope Service service
- Hierarchy Aggregation Service service
- Hierarchy Cache data
- Export Data Query Builder data
- Bufdir Export Service service