Generate and Download Bufdir Export File
After previewing and validating the report, the coordinator selects the desired output format. The export trigger screen presents format options (Excel/CSV for data submission, PDF for archiving and human review). On confirmation, the export orchestrator invokes the appropriate file generator (Excel/CSV or PDF), bundles any required attachments, and uploads the result to the export storage bucket. A download handler then provides a native device download. An audit record is created for every export to support compliance requirements. The export confirmation dialog shows a summary of what will be included before the coordinator commits.
User Story
Acceptance Criteria
- Given I am on the export trigger screen, when I view format options, then I see Excel, CSV, and PDF as selectable formats
- Given I select a format, when I tap Generate Report, then an export confirmation dialog shows the scope, period, record count, and format before I confirm
- Given I confirm the export, when the orchestrator processes the request, then an export progress indicator is displayed and the UI remains responsive
- Given the export completes, when the file is ready, then the file download handler triggers a native device download prompt
- Given the export is an Excel or CSV file, when I open it, then the columns match Bufdir's required schema with correct headers and data formatting
- Given the export is a PDF, when I open it, then it contains all required sections in a human-readable format suitable for archiving
- Given any export is generated, when it completes, then an audit record is written capturing the coordinator, timestamp, period, format, and record count
Business Value
The ultimate deliverable of the Bufdir reporting feature is a file that can be submitted to the government. Supporting multiple formats ensures compatibility with Bufdir's evolving submission requirements, while the audit trail protects organizations in case of disputes about what was submitted and when. This directly fulfills the shared 'one-button Bufdir export' requirement identified across all organizations.
Components
- Bufdir Export Trigger Screen ui
- Bufdir Period Selector Widget ui
- Export Format Selector ui
- Export Confirmation Dialog ui
- Bufdir Export Orchestrator Service service
- Bufdir Activity Query Service service
- Bufdir Column Mapper service
- Document Attachment Bundler service
- Export Audit Log Service service
- Bufdir API Integration Service (Future) service
- Export Audit Log Repository data
- Excel / CSV File Generator infrastructure
- Bufdir PDF Report Generator infrastructure
- Export File Storage Adapter infrastructure
- File Download Handler infrastructure
- Bufdir Format Serializer data
- Bufdir Export Edge Function infrastructure