Aggregation Summary Widget
Component Detail
Description
Displays a real-time summary of aggregated Bufdir metrics for the current reporting period, including participant counts, activity hours, and geographic breakdown. Provides coordinators a read-only preview of what will be included in the Bufdir report before export.
aggregation-summary-widget
Summaries
This mobile UI component gives coordinators immediate, actionable visibility into their organization's Bufdir reporting data before submitting an export — preventing errors, omissions, and the need to resubmit reports. By displaying participant counts, activity hours, and geographic breakdowns in a clear, real-time summary, it builds coordinator confidence in the accuracy of the data being reported to Bufdir, reducing the risk of compliance issues or rejected submissions. The organization isolation badge ensures coordinators never accidentally view or submit data belonging to a different organization, which is critical for data governance and trust. This self-service visibility reduces coordinator dependence on support requests to verify data, lowering operational overhead and improving the overall user experience of the reporting workflow.
This medium-complexity mobile UI component depends on both the Bufdir aggregation service and the reporting period service, meaning those backend services must be stable and returning correct data before this widget can be meaningfully tested. Coordinate with the backend team on the exact metric shape returned by the aggregation service to ensure the widget's rendering logic matches the data contract. UI testing should cover empty states (no data for period), partial data (some regions missing), and full data scenarios. The geographic breakdown render path may require specific test fixtures covering all Norwegian regions.
Accessibility review is recommended given the data-dense card layout. Integration testing requires the aggregation RPC functions to be deployed to a test environment. Plan for a design review cycle since this is a coordinator-facing decision surface that directly precedes export submission.
This Flutter widget is a read-only display component that composes multiple sub-sections: `renderParticipantCountSection()`, `renderActivityTypeDistribution()`, `renderHoursDeliveredSummary()`, and `renderGeographicBreakdown()`. It is driven by data from the `BufdirAggregationService` (injected via provider or passed as a parameter) and the `ReportingPeriodService` for period context. The top-level `buildAggregationSummaryCard()` orchestrates the layout. The organization isolation badge rendered via `showOrganizationIsolationBadge(orgId)` should pull from the authenticated session's org context rather than trusting a passed parameter.
Data is bound to the current reporting period from `ReportingPeriodService` — period changes must trigger a reactive rebuild. Uses activity, event, and contact data models indirectly through the aggregation service's computed metrics. Widget state should be managed with a dedicated ViewModel or Cubit to keep rendering logic separate from data fetching. All metric fields should handle null gracefully with placeholder text.
Responsibilities
- Render aggregated metric cards (participants, hours, activity types)
- Display geographic distribution by region and local chapter
- Indicate data completeness and reporting period coverage
Interfaces
buildAggregationSummaryCard(metrics)
renderParticipantCountSection(count, breakdown)
renderActivityTypeDistribution(types)
renderGeographicBreakdown(regions)
renderHoursDeliveredSummary(hours)
showAggregationLastUpdated(timestamp)
showOrganizationIsolationBadge(orgId)
Relationships
Dependencies (2)
Components this component depends on