Compare Current Period Data Against Previous Submission
From the Bufdir preview or history screen, coordinators should be able to trigger a period diff view that displays key metrics for the current draft alongside the previously submitted period. Differences above a configurable threshold (e.g., more than 20% change in participant count) should be highlighted with a visual warning. This helps coordinators catch data entry errors or missing activity registrations before the final submission is made.
User Story
Acceptance Criteria
- Given the coordinator opens the period diff view, when it loads, then the current period's metrics are shown alongside the previous period's submitted metrics in a two-column layout
- Given a metric has changed by more than 20% compared to the prior period, when the diff view is displayed, then that metric row is highlighted with an amber warning indicator and the percentage change is shown
- Given the coordinator is viewing the diff, when they tap on a highlighted metric, then a contextual explanation is shown suggesting possible causes (e.g., 'Participant count dropped 35% — check if all activity registrations for the period have been saved')
- Given there is no previous submission to compare against, when the coordinator opens the diff view, then a clear message explains this is the first report for this organization and no comparison is available
- Given the diff view is shown, when the coordinator decides to proceed despite warnings, then they can dismiss warnings individually and the dismissal is recorded in the audit log
Business Value
A significant source of Bufdir reporting errors is undetected anomalies — for example, a coordinator submitting a period where half the activities were accidentally not registered. Period comparison catches these issues before submission, protecting organizations from having to submit corrective reports and from potential questions about data reliability from Bufdir.
Components
- Period Comparison Diff View ui
- Bufdir Preview Service service
- Bufdir Report Structure Mapper service
- Bufdir Field Validation Service service
- Report History Service service
- Report History Repository data
- Bufdir Metrics Repository data
- Export Audit Log Service service