-
Notifications
You must be signed in to change notification settings - Fork 15
Add country
jannisvisser edited this page Jan 15, 2025
·
1 revision
Adding a new country, by definition also involves adding at least 1 disaster-type. Adding additional disaster-types beyond this, can therefore be deduced from the same guideline.
The below guide ASSUMES:
- pre-existing
disasterType
- only pre-existing
indicators
andlayers
- Add country to
countries.json
- Add all properties in line with existing examples. Use dummy data first if needed. Collect correct data.
- Add initial disaster-type to
disasterTypes
array, following disaster-type.enum. - Add initial disaster-type to
countryDisasterSettings
- Fill in generic required settings
-
disasterType
: same as above -
adminLevels
: which administrative levels the user can navigate to. -
defaultAdminLevel
: which administrative level to load by default (should be highestadminLevel
) -
activeLeadTimes
: which leadTimes to load. (NOTE: typhoon & drought contain all possible leadtimes here) -
eapLink
: link to EAP/SOP/About trigger doc.
-
- Fill in generic non-required settings
-
isEventBased
(default: false) -
enableEarlyActions
(default: true) -
enableStopTrigger
(default: true)
-
- Fill in disaster-type-specific settings
- drought:
droughtSeasonRegions
,droughtRegions
,droughtEndOfMonthPipeline
,showMonthlyEapActions
- floods:
eapAlertClasses
- drought:
- Fill in generic required settings
- Include administrative boundary data
- You need an admin-boundary file for each adminLevel defined above
- Collect the data from appropriate source and document where/when it was collected.
- Typically the data is simplified using e.g. mapshaper.org to reduce data size.
- Required format:
geojson
.- All
features
should be of typeMultiPolygon
, notPolygon
- All
- Required file name: _adm.json
- Required field names:
ADM<adminLevel>_PCODE
ADM<adminLevel>_EN
-
ADM<adminLevel - 1>_PCODE
(parentPlaceCode)
- Add the files to
API-service/src/scripts/git-lfs/admin-boundaries
- It will be automatically included in seed-script
- Set up dynamic layers
- Dynamic admin-area layers
- In
indicator-metadata.json
, addcountryCodeISO3
for:-
alert_threshold
: this is a required indicator, indicating trigger/warning status per admin-area - Also required is the main exposure indicator, as defined per
disasterType
asactionsUnit
indisasters.json
- Not required, so can be done later:
- any other pre-existing indicators that are relevant for this country
- add any new indicators for this country, in line with existing examples.
- same for pre-existing or new layers in
layer-metadata.json
, in line with existing examples.
-
- Set up dynamic raster layers
- This deals with dynamic raster layers, e.g.
flood_extent
forfloods
- Inlayer-metadata.json
, addcountryCodeISO3
for any pre-existing or new layers with type=wms
. - Set up dynamic point layers
- Currently only example is
typhoon_track
fortyphoon
, which comes with custom modules in code, and is not easily extendable. - NOTE:dynamic
refers here to the location of the points. Static point data (see point 5) can also have dynamically updated properties (e.g. exposure status), but not the location itself. - Create mock data for dynamic layers
- You need to define scenarios
trigger
andno-trigger
. - In scenario
trigger
define at least 1 event. - For this event, create mock data for
- each dynamic admin-area
indicator
andadminLevel
defined above. - each dynamic raster layer defined above
- each dynamic point/lines layer defined above
- each dynamic admin-area
- See specific mock data guide for more details.
- Setup static layers
- Static admin-area layers
- Add any pre-existing or new static admin-area layers in
indicators.json
, in line with other examples. - There are no required static layers for a working portal, but typicallypopulationTotal
per admin-area is added. - Include seed-data for every layer - See specific guide: TO DO - Static raster layers
- Add any pre-existing or new static admin-area layers in
layers.json
withtype=wms
, in line with other examples. - There are no required static layers for a working portal, but typicallypopulation
raster is added. - Include seed-data for every layer - See specific guide: TO DO - Static point layers
- Add any pre-existing or new static point or line layers in 'layers.json' with
type=point
, in line with other examples. - Required layers- For
floods
:glofas_stations
- No other required layers, but typicallyred_cross_branches
is added. - Include seed-data for every layer
- For
- Static line layers
- This currently deals with
roads
andbuildings
inflash-floods
only, and comes with specific custom code modules. - See specific guide: TO DO - Add
Early actions
- Not needed if
enableEarlyActions=false
incountries.json
- Otherwise, add early actions to EAP-actions.json for right
countryCodeISO3
anddisasterType
-
areaOfFocus.id
relates to areas-of-focus.json - If real data not available yet, dummy data can be added.
- Note that the
month
property is only applicable ifshowMonthlyEapActions=true
incountries.json
.
- Set up notifications
- Set up email via Mailchimp
- In Mailchimp
- Add a new tag
<countryCodeISO3> Test
to all developer-users in the audience - Add a new segment
<countryCodeISO3> Test
, referring to this new tag - Get the segment ID by
- Go to https://us18.admin.mailchimp.com/lists/segments?id=144018
- right-click right segment > copy link address
- paste it somewhere and deduce the segmentId from the URL
- Add the tag in .env MC_SEGMENTS as
<countryCodeISO3>_<disasterType>:<segmentId>
on local, ibf-test and ibf-demo - You can immediately create the producion tag+segment also as
PROD - <countryCodeISO3> <disasterType>
- In code - Add country in
notification-info.json
- Add trigger statement
- Add logo
- Paste all country logos from
countries.json
together in one .png - Upload to Mailchimp > Content Studio > My Files > Upload
- Get the URL by selecting the picture > Expand 'View Details' > Copy URL
- Paste it in notification-info.json
- Paste all country logos from
- If applicable: set up WhatsApp or Telegram group, and add the link to join this group via
linkSocialMediaUrl
- Test sending an email by (loading triggered mock data first and) calling the
/api/notification/send
endpoint.
- Add a new tag
- Set up WhatsApp via Twilio - TO DO
- Set up country-specific user
- Add user to users.json
- Set up manuals
- Make video manual: Upload on Youtube + edit link in bit.ly account (see IBF video manuals in Wiki)
- Make PDF manual: Upload to https://510ibfsystem.blob.core.windows.net/manuals/IBF%20Manual--Published.pdf
For adding the new country to production, we cannot use seed-scripts like above. Instead, process all the data changes preferably via migration files, or otherwise manualy.
- Possible to update via API endpoints (manually) or underlying methods (migration files)
- Upload country (paste whole countries.json or just the new country)
- NOTE: watch out that whenever pasting whole countries.json to always remove first any countries/disaster-types that should be/stay deactivated on production
- Update notification-info (paste whole notification-info.json or just the new country)
- Upload admin-boundaries (once per admin-level)
- NOTE: this may fail for the defaultAdminLevel if there has ever been a trigger event already for this country. If so, find a work
- Update indicator-metadata and layer-metadata (paste whole *.json)
- Update static admin-area data (CSV files)
- Update EAP-actions (paste whole json or just the new actions)
- Update any point/lines layers (red cross branches, glofas stations, etc.)
- Create new country user and store password in Bitwarden
- Must currently be updated directly in database (manually) or via raw queries (migration files)
- Add new country to dunant-user:
INSERT INTO "IBF-app".user_countries("user", country) VALUES('dunant@redcross.nl', '<countryCodeISO3>')
- If applicable: add/update
- disaster
- lead-times
- areas-of-focus
- Add static admin-area layers
- Add indicator to indicator-metadata.json
- Add countryCode in country_codes
- If layer should also be shown in middle column: add country to aggregateIndicator as well
- Set dynamic = false
- Set colorBreaks if applicable (check with data-dev for specific classes/breaks)
- Add data to API-service/src/scripts/git-lfs/admin-area-data
- Add section in seed-admin-area-data.ts, in line with existing examples
- If it is a static layer that will be updated (like Hotspot and IPC layers Ethiopia), then
- also add the layer to Add layer to API-service/src/api/admin-area-dynamic-data/enum/dynamic-data-unit.ts
- and test the respective pipeline(s) with data-dev
- Add dynamic admin-area layers