Map Activities to Bufdir Categories Automatically
Bufdir requires activity data to be submitted using its own category schema, which differs from the internal activity types used in the app. A category mapping configuration defines the translation between internal activity type identifiers and Bufdir's official taxonomy. The aggregation service applies this mapping at runtime. If an internal activity type cannot be mapped, the coordinator is alerted so they can resolve the gap before submission.
User Story
Acceptance Criteria
- Given activities are fetched for the selected period, when the aggregation service processes them, then each activity is assigned a Bufdir category according to the active mapping configuration
- Given all activities are successfully mapped, when the aggregation summary is displayed, then activity counts are grouped by Bufdir category
- Given one or more activity types have no mapping defined, when aggregation runs, then a warning lists the unmapped types and the coordinator is blocked from proceeding to export until the gap is resolved
- Given the mapping configuration is updated by an administrator, when the coordinator re-runs aggregation, then the updated mapping is applied without requiring an app update
- Given a Bufdir category receives zero activities, when the summary is shown, then that category is displayed with a count of zero rather than being omitted
Business Value
Bufdir uses its own category schema to aggregate data across all funded organisations nationally. Submissions using incorrect or missing categories are rejected or require manual correction by Bufdir staff, which delays grant disbursement. Automatic mapping reduces the submission rejection rate to near zero and saves significant back-and-forth between coordinators and Bufdir.
Components
- Activity Category Mapping Configuration infrastructure
- Bufdir Aggregation Service service
- Aggregation Query Builder data
- Supabase Aggregation RPC Functions infrastructure
- Bufdir Metrics Repository data
- Aggregation Summary Widget ui