HIGH story-bufdir-reporting-export-organization-admin-008 8 pts
8
Story Points
High
Priority
Bufdir Reporting & Export
Feature

User Story

As a Organization Administrator
I want to select the organizational scope for a Bufdir report — whether for a single chapter, a region, or the entire national organization — so that the report reflects the correct hierarchical unit I am responsible for reporting
So that I can generate accurate reports that match the exact organizational scope that Bufdir expects from my role, without mixing data from other units

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.