Expense Repository
Component Detail
Data Layer
medium complexity
mobile
2
Dependencies
1
Dependents
1
Entities
0
Integrations
Description
Data access layer that mediates between Expense Service and the REST API for all expense CRUD operations. Handles local caching for offline resilience and syncs pending submissions when connectivity is restored.
expense-repository
Responsibilities
- Persist submitted expense records to local cache for offline access
- Queue failed submissions for retry when network is unavailable
- Retrieve expense list for a given activity from API or cache
- Map raw API response DTOs to typed Expense domain objects
Interfaces
save(expense: Expense): Future<void>
findByActivity(activityId: String): Future<List<Expense>>
findById(expenseId: String): Future<Expense?>
getPendingSubmissions(): Future<List<Expense>>
markSynced(expenseId: String): Future<void>
Relationships
Dependencies (2)
Components this component depends on