Mutual Exclusion Prevents Invalid Expense Combinations
The mutual exclusion rule engine evaluates the currently selected expense types against a set of organisation-defined exclusion rules. When a peer mentor selects an expense type that conflicts with an already-selected type, the conflicting option is immediately disabled (greyed out) with a short explanation tooltip, and the user cannot proceed until the conflict is resolved. The rules are loaded from the expense type configuration and can differ per organisation. For example, HLF prohibits claiming both kilometre reimbursement and public transport tickets for the same trip. The engine operates entirely on the client side for instant feedback, with server-side validation at submission as a safety net.
User Story
Acceptance Criteria
- Given the peer mentor has selected 'mileage' as an expense type, when the expense type picker is still visible, then 'public transport' is visually disabled and labelled with a reason such as 'Cannot be combined with mileage'
- Given a conflicting type is disabled, when the peer mentor taps it, then a tooltip or inline message explains why it cannot be selected without dismissing the picker
- Given the peer mentor deselects 'mileage', when the picker updates, then 'public transport' becomes enabled again
- Given multiple exclusion rules exist in the configuration, when the peer mentor selects any type, then all conflicting types across all rules are disabled simultaneously
- Given the peer mentor submits a claim, when the server receives the payload, then server-side validation confirms no mutual exclusion violations are present and rejects the claim with a specific error if any are found
- Given a screen reader is active, when an expense type is disabled due to mutual exclusion, then the accessibility label announces the type as unavailable and provides the reason
Business Value
Mutual exclusion enforcement directly addresses the core HLF requirement from the workshop: fixed choices that make erroneous combinations technically impossible. Without this, coordinators must manually review and reject duplicate-path claims, creating administrative burden. Automated prevention at the UI layer reduces invalid submissions to near zero, enabling the threshold-based auto-approval pipeline to function reliably and freeing coordinators to focus on exceptions rather than routine error correction.
Components
- Mutual Exclusion Rule Engine service
- Expense Type Picker Widget ui
- Expense Selection BLoC service
- Expense Type Configuration data
- Expense Validation Service service
- Expense Type Accessibility Service service