go-frontend
go-frontend copied to clipboard
[PROD] Review how cluster and region offices are handled
Issue
Cluster and Region IFRC offices, are stored in the countries table and use the ISO for the country that they're in. This can be confusing because they are not 'countries' and means there are duplicate ISO codes in the countries table, which has caused issues for e.g. #1636.
Expected behaviour
Any changes could be significant and have multiple knock-on effects with existing records being joined (e.g. field reports). Needs more detailed review but possible things to explore with very different effort levels:
- Changing the 'ISO' of these offices to be an IFRC code - so there are no duplicate ISOs.
- Rethinking the whole database structure. Initial thoughts from @GregoryHorvath on this previous issue:
If we want to go with changing the database structure - my initial idea for separating the different types of records (just a quick mockup):
- Create new tables for each
record_type
aCountry
object can have (Region, Cluster, etc)- Copy the separate types into their new respective tables
- Change the relations so Countries would have their Region mapped to the new table's records
- Create new endpoints, serializers, etc for the new tables
- Change the frontend pages, actions, etc to use the new endpoints if needed
- Remove all the hard-coded
enum
s and deprecated fields from theapi_country
table
Related feature
- #1636
Impact
This could be a huge change but just needs the options considering as part of the wider review of geo data
cc @GregoryHorvath @batpad @geohacker
As an intermediary for this - ISO codes are being removed from all non-countries in the country database: regions and clusters. This has been done on staging for testing and assuming no issues, will be done on prod after the upcoming geo release.
Hi there, did this ticket get sorted with the recent Country pages work?