Auto-Approval Rules
Feature Detail
Description
Auto-Approval Rules allow organization administrators to configure threshold-based conditions under which expense claims are automatically approved without manual review. Configurable dimensions include maximum reimbursable distance (e.g. under 50 km), maximum total claim amount, presence or absence of receipts, and expense type. Claims satisfying all active rules are approved instantly on submission. The configuration interface presents rules as structured form inputs - not free-text - preventing ambiguous or contradictory combinations. Administrators can enable, disable, or adjust individual rules without redeploying, and can preview which historical claims would have been auto-approved under the current ruleset before activating changes. Auto-approved claims are flagged distinctly in the approval queue and audit log so approvers retain full visibility and can manually override an auto-approval if needed.
Analysis
HLF explicitly specified automatic approval for claims under 50 km with no additional expenses, reflecting a common pattern where the majority of submissions are routine and low-risk. Manual review of these claims consumes disproportionate coordinator time relative to the financial exposure, creating bottleneck delays that frustrate peer mentors and undermine the reimbursement system's purpose. Auto-approval rules directly reduce coordinator administrative load, accelerate reimbursement turnaround for peer mentors, and improve volunteer retention by removing friction from a core operational workflow. Organizations can calibrate thresholds to their own risk tolerance and accounting requirements, making the feature applicable across all tenant organizations without per-organization code changes. The audit trail and manual override capability ensure that automation does not compromise accountability, satisfying the compliance requirements associated with Bufdir-funded activities and accounting system integrations.
Rule configuration is stored in a dedicated table (or a JSONB configuration column on the organizations table) scoped per tenant. The auto-approval engine runs synchronously during expense claim submission: after validation passes, the engine evaluates the claim against the tenant's active ruleset and sets status to auto_approved if all conditions are met, bypassing the manual queue. Rules are expressed as a structured schema (type: distance_km | total_amount | receipt_required | expense_type_allowlist) with operator and value fields, not arbitrary code, to prevent injection and simplify the admin UI. The preview feature runs a read-only dry-run query against historical claims. The admin UI is a Next.js server component with form validation matching the backend rule schema. The Flutter app has no configuration surface; peer mentors see only the submission outcome. All rule changes are written to the audit log with before/after snapshots.
Components (44)
Shared Components
These components are reused across multiple features
User Interface (9)
Service Layer (15)
Data Layer (8)
Infrastructure (7)
User Stories
No user stories have been generated for this feature yet.