View organisation-specific reimbursement rules before submitting a claim
The Expense Rules Riverpod Provider fetches organisation-specific reimbursement configuration from Supabase and makes it available to all wizard components within the session. Key rule values — per-kilometre rate, auto-approval distance ceiling, receipt requirement amount threshold, and the list of permitted expense types — are surfaced at appropriate points in the wizard UI. For mileage claims, the rate is shown alongside the calculated total. For fixed-amount claims, the receipt threshold is shown as helper text on the amount input. Rules are cached per session to avoid redundant network requests.
User Story
Acceptance Criteria
- Given the user opens the expense registration wizard, when the rules provider initialises, then it fetches the organisation-specific rules from Supabase within 2 seconds
- Given the rules have been fetched, when the user is on the mileage entry step, then the current per-kilometre rate is displayed as helper text below the distance input field
- Given the rules have been fetched, when the user is on a fixed-amount entry step, then the receipt requirement threshold is shown as helper text indicating when a receipt is required
- Given the rules are cached from a previous step, when the user navigates between wizard steps, then no additional network requests are made to re-fetch the same rules
- Given the Supabase rules fetch fails due to a network error, when the wizard initialises, then a fallback message is shown and the user is informed that rules could not be loaded, with an option to retry
Business Value
Surfacing reimbursement rules inline during the registration process eliminates a common reason for incorrect claims — users simply not knowing the current rate or receipt requirements. This reduces the volume of claims requiring coordinator correction and empowers peer mentors to submit accurately on first attempt, accelerating the approval cycle and improving the volunteer experience.