Integrate static_data endpoint to replace 6 separate lookup API calls

- Added StaticDataResponse model to combine all lookup data
- Added getStaticData() method to LookupsApi
- Updated LookupsRepository to fetch all lookups in single API call
- Added updateAllLookups() method to DataCache for batch updates
- Reduces network requests from 6 to 1 for initial data load
- Improves app startup performance with Redis-cached response

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Trey t
2025-11-12 22:15:29 -06:00
parent 4d05292daa
commit 230eb013dd
7 changed files with 85 additions and 42 deletions

View File

@@ -202,6 +202,15 @@ object DataCache {
_contractorSpecialties.value = specialties
}
fun updateAllLookups(staticData: StaticDataResponse) {
_residenceTypes.value = staticData.residenceTypes
_taskFrequencies.value = staticData.taskFrequencies
_taskPriorities.value = staticData.taskPriorities
_taskStatuses.value = staticData.taskStatuses
_taskCategories.value = staticData.taskCategories
_contractorSpecialties.value = staticData.contractorSpecialties
}
fun markLookupsInitialized() {
_lookupsInitialized.value = true
}