Document Attachments for Activities
Feature Detail
Description
Allows coordinators to attach supporting documents to activity records — including invitations, Facebook event screenshots, flyers, and other evidence materials. NHF specifically requires this for Bufdir verification, where inspectors may request proof that a registered activity actually took place. Attachments are linked at the activity level and can be uploaded from the device camera roll or file system. The feature must support common formats (PDF, JPEG, PNG) and store files securely in Supabase Storage with appropriate access controls so only coordinators and admins within the same organisation can retrieve them.
Analysis
Enables NHF to meet Bufdir's evidence requirements without maintaining a separate paper archive. Reduces audit risk and administrative burden when grant inspections occur.
Use Supabase Storage with bucket-level RLS tied to org_id. Limit file size to 10 MB per attachment, max 5 attachments per activity. Generate signed URLs for download. Display thumbnails in activity detail view. Include attachment count and download links in Bufdir export.
Components (204)
Shared Components
These components are reused across multiple features
User Interface (59)
Service Layer (52)
Data Layer (33)
Infrastructure (54)
User Stories (12)
As a As a Coordinator
I want to delete an incorrectly uploaded attachment or replace it with the correct file after an activity has been submitted
So that the activity record always contains accurate and relevant documentation without requiring coordinator intervention
- Given I am viewing the thumbnail grid for an activity I submitted, when I long-press a thumbnail, then a context menu appears with a 'Remove Attachment' option
- Given I select 'Remove Attachment', when the confirmation dialog appears, then I can confirm or cancel without accidental deletion
- Given I confirm deletion, when the operation completes, then the thumbnail is removed from the grid and the file is deleted from Supabase Storage
- +3 more
As a As a Coordinator
I want to attach multiple documents (e.g., an invitation flyer, a participant list, and a screenshot) to a single activity in one session
So that I can provide all evidence at once without having to revisit the activity multiple times
- Given the attachment picker is open, when I select multiple files from my photo library, then all selected files appear as thumbnails in a pending upload queue
- Given the pending upload queue has 3 files, when I tap 'Upload', then all three files upload in parallel and I see individual progress indicators for each
- Given all uploads have succeeded, when the upload session ends, then all thumbnails appear in the activity's attachment thumbnail grid
- +3 more
As a As a Coordinator
I want to queue document attachments locally when I have no internet connection and have them automatically uploaded when connectivity is restored
So that I can complete activity registration with attachments in remote or low-connectivity environments without losing my work
- Given I am offline and attach a document to an activity, when I confirm the selection, then the file is stored locally and shown in the thumbnail grid with a 'Pending upload' indicator
- Given there is a pending attachment queue, when the device regains internet connectivity, then all queued files are uploaded automatically in the background
- Given background sync completes successfully, when all queued attachments are uploaded, then the 'Pending upload' indicators are replaced with normal thumbnails and a success notification is shown
- +3 more
As a As a Organization Administrator
I want to delete an incorrectly uploaded attachment or replace it with the correct file after an activity has been submitted
So that the activity record always contains accurate and relevant documentation without requiring coordinator intervention
- Given I am viewing the thumbnail grid for an activity I submitted, when I long-press a thumbnail, then a context menu appears with a 'Remove Attachment' option
- Given I select 'Remove Attachment', when the confirmation dialog appears, then I can confirm or cancel without accidental deletion
- Given I confirm deletion, when the operation completes, then the thumbnail is removed from the grid and the file is deleted from Supabase Storage
- +3 more
As a As a Organization Administrator
I want to attach multiple documents (e.g., an invitation flyer, a participant list, and a screenshot) to a single activity in one session
So that I can provide all evidence at once without having to revisit the activity multiple times
- Given the attachment picker is open, when I select multiple files from my photo library, then all selected files appear as thumbnails in a pending upload queue
- Given the pending upload queue has 3 files, when I tap 'Upload', then all three files upload in parallel and I see individual progress indicators for each
- Given all uploads have succeeded, when the upload session ends, then all thumbnails appear in the activity's attachment thumbnail grid
- +3 more
As a As a Organization Administrator
I want to queue document attachments locally when I have no internet connection and have them automatically uploaded when connectivity is restored
So that I can complete activity registration with attachments in remote or low-connectivity environments without losing my work
- Given I am offline and attach a document to an activity, when I confirm the selection, then the file is stored locally and shown in the thumbnail grid with a 'Pending upload' indicator
- Given there is a pending attachment queue, when the device regains internet connectivity, then all queued files are uploaded automatically in the background
- Given background sync completes successfully, when all queued attachments are uploaded, then the 'Pending upload' indicators are replaced with normal thumbnails and a success notification is shown
- +3 more
As a As a Coordinator
I want to view a thumbnail grid of all documents attached to an activity and open any attachment in full-screen preview
So that I can verify the correct files were uploaded and review them without leaving the app
- Given I open an activity that has attached documents, when the screen renders, then a thumbnail grid shows one thumbnail per attachment with a file-type indicator badge
- Given the thumbnail grid is visible, when I tap a thumbnail, then a full-screen preview modal opens with the document rendered at full resolution
- Given the preview modal is open, when I tap the close button or swipe down, then I return to the activity detail screen with focus restored to the thumbnail I tapped
- +3 more
As a As a Coordinator
I want to receive clear, screen-reader-compatible feedback about the status of document uploads — including success, failure, and progress
So that I can confidently complete activity registration even when using assistive technologies such as VoiceOver or TalkBack
- Given an upload starts, when the upload progress changes to in-progress, then a live region announcement reads 'Uploading [filename], please wait'
- Given an upload completes successfully, when the status changes, then a live region announcement reads 'Attachment [filename] uploaded successfully'
- Given an upload fails, when the error state is reached, then a live region announcement reads a plain-language error message and focus moves to a retry button
- +3 more
As a As a Coordinator
I want to attach documents such as invitations, event flyers, or screenshots when registering an activity
So that the activity record has verifiable supporting evidence for Bufdir auditing and organizational reporting
- Given I am on the activity registration confirmation step, when I tap 'Add Attachment', then the attachment picker UI opens showing camera and file library options
- Given the attachment picker is open, when I select an image or PDF from my device, then a thumbnail preview is shown before confirming
- Given I have selected a file, when I confirm the selection, then the file is uploaded to Supabase Storage and linked to the activity record via the activity attachment repository
- +3 more
As a As a Organization Administrator
I want to view a thumbnail grid of all documents attached to an activity and open any attachment in full-screen preview
So that I can verify the correct files were uploaded and review them without leaving the app
- Given I open an activity that has attached documents, when the screen renders, then a thumbnail grid shows one thumbnail per attachment with a file-type indicator badge
- Given the thumbnail grid is visible, when I tap a thumbnail, then a full-screen preview modal opens with the document rendered at full resolution
- Given the preview modal is open, when I tap the close button or swipe down, then I return to the activity detail screen with focus restored to the thumbnail I tapped
- +3 more
As a As a Organization Administrator
I want to receive clear, screen-reader-compatible feedback about the status of document uploads — including success, failure, and progress
So that I can confidently complete activity registration even when using assistive technologies such as VoiceOver or TalkBack
- Given an upload starts, when the upload progress changes to in-progress, then a live region announcement reads 'Uploading [filename], please wait'
- Given an upload completes successfully, when the status changes, then a live region announcement reads 'Attachment [filename] uploaded successfully'
- Given an upload fails, when the error state is reached, then a live region announcement reads a plain-language error message and focus moves to a retry button
- +3 more
As a As a Organization Administrator
I want to attach documents such as invitations, event flyers, or screenshots when registering an activity
So that the activity record has verifiable supporting evidence for Bufdir auditing and organizational reporting
- Given I am on the activity registration confirmation step, when I tap 'Add Attachment', then the attachment picker UI opens showing camera and file library options
- Given the attachment picker is open, when I select an image or PDF from my device, then a thumbnail preview is shown before confirming
- Given I have selected a file, when I confirm the selection, then the file is uploaded to Supabase Storage and linked to the activity record via the activity attachment repository
- +3 more