Configure Organisation-Specific Auto-Approval Thresholds
The organisation administrator accesses the reimbursement workflow configuration section in admin settings. They can set the maximum mileage below which a submission qualifies for automatic approval (default: 50 km), and toggle whether the presence of any additional expense items (tolls, parking, receipts) disqualifies a submission from auto-approval. Configuration values are stored in the integration_configs table scoped to the organisation. Changes take effect immediately for all subsequent submissions — existing pending submissions are not retroactively re-evaluated. The Auto-Approval Service reads these thresholds from integration_configs each time it is triggered by a new submission insert.
User Story
Acceptance Criteria
- Given I am authenticated as an organisation administrator, when I navigate to reimbursement workflow settings, then I can view and edit the current auto-approval mileage threshold and expense-item exclusion rule
- Given I update the mileage threshold to a new value and save, when a new submission is created below that threshold with no additional expense items, then it is automatically approved without entering the manual queue
- Given I set the expense-item exclusion rule to enabled, when a submission includes any additional expense item regardless of mileage, then it is routed to pending_attestation even if mileage is below the threshold
- Given I save configuration changes, when existing pending submissions are viewed, then they remain in their current status — threshold changes apply only to new submissions created after the change
- Given I enter an invalid threshold value (e.g., negative number or non-numeric text), when I attempt to save, then an inline validation error is displayed and the save is blocked
Business Value
Configurable thresholds are what make the auto-approval feature applicable across organisations with different financial policies. Without this, a single hardcoded threshold would either be too permissive for some organisations or create unnecessary manual work for others. Supporting per-organisation configuration is essential for the multi-tenant deployment model.
Components
- Auto-Approval Service service
- Supabase Edge Function Runtime infrastructure