Approve a Reimbursement Claim with Optional Comment
From the Reimbursement Detail Screen, the coordinator taps the Approve button. An optional comment field appears (e.g., 'Approved — mileage verified against route planner'). On confirmation, the Attestation Service invokes an authenticated Supabase RPC call that appends an immutable approval record to reimbursement_approvals with status 'approved', the coordinator's ID, timestamp, and comment. BLoC updates local UI state, removes the submission from the pending queue, and the Push Notification Service dispatches a notification to the submitter. The action is irreversible — coordinators cannot un-approve; corrections require a separate workflow.
User Story
Acceptance Criteria
- Given I am on the reimbursement detail screen, when I tap Approve, then an optional comment input field appears before final confirmation
- Given I confirm the approval, when the RPC call completes, then an immutable record is appended to the audit trail with status 'approved', my coordinator ID, the current timestamp, and any comment I entered
- Given approval succeeds, when the record is written, then the submission disappears from my pending queue and the submitter receives a push notification confirming approval
- Given the RPC call fails due to a network error, when the error is returned, then the UI shows a retry prompt and the submission remains in 'pending_attestation' status — no partial records are created
- Given I have approved a submission, when I re-open the detail screen, then the Approve and Reject buttons are replaced by the approved audit record and the action cannot be reversed from this screen
Business Value
Approval is the core action of the workflow. Without an atomic, auditable approve operation backed by an immutable record, the organisation cannot demonstrate compliance with Bufdir grant conditions. The push notification on approval directly improves volunteer experience and trust in the reimbursement process, supporting retention.
Components
- Reimbursement Detail Screen ui
- Attestation Service service
- Approval Repository data
- Supabase Edge Function Runtime infrastructure