Include Activity Attachments in Bufdir Export Bundle
NHF identified document attachments to activities as an important feature for Bufdir auditability — specifically invitations and Facebook screenshots that prove an event occurred as reported. The Bufdir export should optionally bundle attached documents alongside the main report file. The attachment bundler must collect all files linked to activities within the export scope and period, compress them if necessary, and include them in the export package as a ZIP archive alongside the main report. The coordinator should be able to toggle attachment inclusion on or off, and see a count of how many attachments are available for the selected period before proceeding.
User Story
Acceptance Criteria
- Given the coordinator is on the export configuration screen, when they see the attachment option, then a toggle is shown with the count of available attachments for the selected period and scope
- Given the coordinator enables attachment bundling, when the export is triggered, then all files attached to in-scope activities are collected and included in a ZIP archive alongside the main report
- Given an activity has no attachments, when the bundle is created, then the missing attachment does not cause an error — the export proceeds with only the files that exist
- Given the attachment bundle exceeds a size threshold, when the coordinator tries to download, then the system offers to generate a secure download link instead of a direct device download
- Given the coordinator disables attachment bundling, when the export is generated, then only the main report file is produced with no change to export processing time
- Given the export package is downloaded, when the coordinator opens it, then the file structure clearly separates the main report from the supporting attachments folder
Business Value
NHF specifically requires documentary evidence attachments for Bufdir auditability. Without this capability, coordinators must manually collect and send attachments separately from the main report, creating coordination overhead and risk of mismatched evidence. Bundling attachments directly in the export ensures the submitted evidence package is complete, consistently structured, and tied to the exact activities in the report — reducing the risk of grant audit failure.
Components
- Document Attachment Bundler service
- Attachment Picker UI ui
- Attachment Thumbnail Grid ui
- Attachment Upload Service service
- Signed URL Service service
- Activity Attachment Repository data
- Supabase Storage Adapter infrastructure
- File Download Handler infrastructure
- Export Storage Bucket infrastructure
- Export File Storage Adapter infrastructure