Reducer for core data
The server maintains the current data for the following core data:
- Crops: the list of crop codes and their names (/api/v0/crops/)
- Languages: the list of language codes and their names (/api/v0/vocabulary/21b10067-ba15-44dd-867f-6a18a117fee8 <-- this UUID is fixed!)
- Countries: list of country ISO-3 codes and their names (*/api/v0/
This information is needed in various filters and forms, but it does not change often.
- SSR should pre-load all crops.
- Language and Country information should be in a map, not the list of everything. Records would be added when needed.
- Need a mechanism to refresh stale data...
Crops, Partners, Languages could use a lookup approach:
state.lookups.crops.get('maize'). But the crops list (as used in filters), needs an ordered list of crops: