Validate Receipt Attachment for Claims Above Receipt Threshold
HLF requires receipts for any expense above 100 NOK. The system should enforce this rule at submission time so that incomplete claims never enter the coordinator review queue. If a peer mentor attempts to submit a qualifying expense without a receipt, the submission is blocked with a clear explanation and guidance on how to attach a receipt. For claims that arrive in the queue, coordinators should have confidence that all receipt-required claims include valid receipt attachments. This validation is enforced both client-side and via an edge function to prevent bypass.
User Story
Acceptance Criteria
- Given a peer mentor submits an expense with an amount above the receipt threshold and no receipt attached, when they tap submit, then the submission is blocked with a message explaining the receipt requirement and linking to the receipt capture flow
- Given a peer mentor attaches a receipt image to an expense above the threshold, when they submit, then the claim proceeds to the coordinator review queue with the receipt accessible
- Given a coordinator views a claim in the review queue that required a receipt, when the detail view loads, then the receipt attachment is present and viewable
- Given a claim is submitted without a receipt that is required by the threshold rule, when the edge function validates it server-side, then the claim is rejected with a validation error even if client-side validation was bypassed
- Given an expense is below the receipt threshold, when it is submitted without a receipt, then no receipt validation error is shown and the claim proceeds normally (subject to amount-based auto-approval)
Business Value
Enforcing receipt requirements at submission time rather than during coordinator review eliminates a significant source of back-and-forth communication between coordinators and peer mentors. It ensures the audit trail needed for accounting exports and Bufdir compliance is always complete, and reduces the risk of non-compliant reimbursements that could create issues during financial audits or grant reporting.
Components
- Receipt Threshold Validator service
- Receipt Attachment Service service
- Receipt Camera Sheet ui
- Receipt Thumbnail Preview Widget ui
- Receipt Attachment Indicator ui
- Receipt Storage Repository data
- Claim Receipt Repository data
- Threshold Validation Supabase Edge Function infrastructure
- Expense Validation Service service
- Expense Threshold Configuration infrastructure
Dependencies
- Review Pending Expense Claims Queue critical