Expense Validation Service
Component Detail
Service Layer
medium complexity
mobile
1
Dependencies
2
Dependents
3
Entities
0
Integrations
Description
Enforces client-side field-level validation that mirrors server-side constraints, including mutual exclusivity checks that make it technically impossible to submit invalid expense type combinations. Loads and caches the full set of mutual exclusivity rules from the API at app start so validation remains available offline.
expense-validation-service
Responsibilities
- Validate selected expense type combinations against mutual exclusivity rules
- Enforce required field constraints per expense type
- Cache validation rules locally for offline-capable validation
- Provide structured validation error messages for display in the form screen
Interfaces
validateExpenseFields(fields)
checkMutualExclusivity(selectedTypes)
getValidationRulesForType(expenseType)
isValidCombination(expenseTypes)
getFieldConstraints(expenseType)
getRequiredFieldsForType(expenseType)
clearValidationCache()
refreshRulesFromApi()
Relationships
Dependents (2)
Components that depend on this component
Related Data Entities (3)
Data entities managed by this component