MEDIUM story-document-attachment-peer-mentor-005 2 pts
2
Story Points
Medium
Priority
Document Attachment to Activities
Feature

User Story

As a user
I want to remove an incorrectly attached document from an activity
So that So that I can correct mistakes and ensure only relevant and accurate documentary evidence is associated with the activity record

Acceptance Criteria

  • Given the user is viewing the document attach widget, when they tap the remove control on a document thumbnail, then a confirmation dialog appears asking them to confirm deletion
  • Given the user confirms deletion, when the delete operation completes, then the document thumbnail is removed from the attach widget and the metadata record is deleted from the activity_documents table
  • Given the document is deleted from the database, when the deletion propagates, then the corresponding file and thumbnail are also removed from the Supabase Storage bucket
  • Given the user cancels the confirmation dialog, when they cancel, then the document remains attached and no changes are made
  • Given a peer mentor attempts to remove a document attached by a coordinator, when permissions are checked, then only the owning user or a coordinator can successfully delete the document

Business Value

Allowing document removal prevents incorrect or irrelevant evidence from polluting activity records. Clean, accurate evidence chains are essential for Bufdir audit credibility — a single misattached document could undermine the legitimacy of a report.