Record Count Confirmation Banner
Component Detail
Description
Displays the number of activity records falling within the selected period and warns the user if the period end date is in the future or if data entry appears incomplete. Prevents accidental submission of partial reports.
record-count-banner
Summaries
The Record Count Confirmation Banner is a critical safeguard that protects the organization from inadvertently submitting incomplete or premature reports to Bufdir. By displaying the exact number of activity records captured within the selected period — and prominently flagging cases where the period end date is still in the future or where data appears incomplete — this component gives report authors the confidence they need before initiating a submission. Preventing even a single incorrect report avoids the administrative cost of correction cycles with the funding authority and preserves the organization's credibility. The business value is a measurable reduction in submission errors and the staff time lost to remediation.
The Record Count Confirmation Banner has a low implementation complexity for the UI layer itself, but it carries a service dependency on period-record-count-service that must be available before integration testing can proceed. This means scheduling this component's integration work after the backend count service is complete and tested. Development of the banner widget itself — rendering count, incomplete flag, and future-date warning — is one to two days. Integration and end-to-end testing adds another day.
Watch for edge cases: what should the banner display while the count is loading, and how should it behave if the service call fails? These states must be handled gracefully and confirmed with UX before sign-off.
Record Count Confirmation Banner is a Flutter UI component that subscribes to count data from period-record-count-service and renders three distinct states: a standard count display, an incomplete-data warning, and a future-end-date alert. It exposes build(BuildContext) for rendering, updateCount(int recordCount) to push a new count value into the widget's state, setIncomplete(bool incomplete) and setFutureEndDate(bool isFuture) to toggle the warning overlays. The component should use a StreamBuilder or ValueNotifier pattern to react to async count updates without blocking the UI thread. The dependency on period-record-count-service means the banner must handle loading and error states explicitly.
The three visual states (normal, incomplete, future) should be implemented as distinct widget subtrees driven by local state flags, ensuring each path is independently testable with widget tests.
Responsibilities
- Show record count for the selected period
- Flag periods where end date is in the future
- Provide visual distinction between complete and incomplete periods
Interfaces
build(BuildContext)
updateCount(int recordCount)
setIncomplete(bool incomplete)
setFutureEndDate(bool isFuture)