CRITICAL story-receipt-capture-and-attachment-coordinator-004 5 pts
5
Story Points
Critical
Priority
Receipt Capture and Attachment
Feature

User Story

As a Coordinator
I want my receipt image to be securely uploaded and stored when I submit my expense claim
So that the receipt is available to the coordinator for review and is retained for audit purposes without me needing to manage file storage manually

Acceptance Criteria

  • Given I submit an expense claim with a receipt attached, When the form is submitted, Then the receipt image is uploaded to Supabase Storage before the claim record is created
  • Given the upload is in progress, When I am on the submission screen, Then an upload progress indicator is shown so I know the operation is ongoing
  • Given the upload completes successfully, When the claim is saved, Then the receipt storage path is linked to the claim record in the database
  • Given the network connection drops during upload, When the upload fails, Then a clear error message is shown with a Retry button, and the claim is not submitted in a partial state
  • Given a claim with a receipt is submitted, When a coordinator views the claim, Then the receipt image is accessible via a signed URL with appropriate access controls
  • Given the claim is approved or rejected, When the receipt record is queried, Then it remains stored and linked to the historical claim for audit trail purposes

Business Value

Secure receipt storage with RLS enforcement is a compliance requirement — expense claims with receipts may contain sensitive financial information. Linking receipts to the claim audit trail satisfies Bufdir reporting requirements for expense documentation. Atomic upload-then-save prevents ghost claims (submitted without receipt) that would be rejected during coordinator review, ensuring the auto-approval pipeline functions correctly for under-threshold claims.