Report History Screen
Component Detail
Description
Main screen displaying a chronological list of all previously generated Bufdir reports scoped to the organization. Shows period covered, generation date, generating user, and provides actions to re-download or re-export each report.
report-history-screen
Summaries
The Report History Screen gives authorized coordinators and administrators a reliable, auditable record of every Bufdir report ever generated by their organization, including who generated it and when. This audit trail is critical for organizational accountability, internal review processes, and responding to inquiries from Bufdir about previously submitted data. The ability to re-download or re-export any historical report directly from the application eliminates dependence on email archives or shared drives, reducing the operational risk of lost submissions and saving significant administrative time when historical records are needed. Restricting access to coordinator and admin roles ensures sensitive reporting data is protected from unauthorized access.
The Report History Screen has low complexity and depends on `report-history-list-item` (a sub-component for individual row rendering) and `report-history-service` (for data fetching and pagination). Both dependencies must be delivered before this screen can be completed and tested end-to-end. The paginated list implementation requires agreement on page size and scroll behavior (infinite scroll vs. load-more button) before development begins to avoid rework.
Role-based access restriction must be validated in both the UI layer and at the data access layer to prevent privilege escalation. Key QA scenarios include organizations with no report history (empty state), organizations with large report volumes requiring multiple pages, and the behavior of re-download and re-export actions when the underlying file is no longer available in storage. Timeline risk is low given the simple feature scope.
The Report History Screen is a frontend and mobile UI component that renders a paginated, role-restricted list of historical Bufdir report records. It depends on `report-history-list-item` for individual row rendering and delegates all data operations to `report-history-service`. `build(context)` initializes the screen with the current organization scope derived from the auth context. `onLoadMore()` triggers the next page fetch from the service layer and appends results to the existing list.
`onFilterChanged(filter)` resets pagination and re-fetches with updated filter parameters. `onRedownloadTapped(reportId)` and `onReexportTapped(reportId)` delegate to the service layer and should handle loading and error states per action independently so one failing action does not block others. Role enforcement (`coordinator`, `admin` only) should be applied both as a UI guard at navigation time and as a data-layer constraint in the repository query to prevent privilege escalation through direct API calls.
Responsibilities
- Render paginated list of past Bufdir reports
- Display per-report metadata (period, date, user)
- Provide re-download and re-export action buttons
- Restrict view to coordinator and admin roles
Interfaces
build(context)
onReportSelected(reportId)
onRedownloadTapped(reportId)
onReexportTapped(reportId)
onFilterChanged(filter)
onLoadMore()
Relationships
Dependencies (2)
Components this component depends on