From fcda9ce4122e8e71df085377388191389372f526 Mon Sep 17 00:00:00 2001 From: jannisvisser Date: Mon, 2 Dec 2024 14:11:46 +0100 Subject: [PATCH] feat: add blantyre only scenario --- .../src/scripts/enum/mock-scenario.enum.ts | 1 + .../mock-data/flash-floods/MWI/scenarios.json | 5 +++ .../upload-alert_threshold-3.json | 34 +++++++++++++++++++ .../upload-damage_estimation-3.json | 34 +++++++++++++++++++ .../upload-nr_affected_buildings-3.json | 34 +++++++++++++++++++ .../upload-nr_affected_clinics-3.json | 34 +++++++++++++++++++ .../upload-nr_affected_roads-3.json | 34 +++++++++++++++++++ .../upload-nr_affected_schools-3.json | 34 +++++++++++++++++++ .../upload-nr_affected_waterpoints-3.json | 34 +++++++++++++++++++ .../upload-population_affected-3.json | 34 +++++++++++++++++++ .../src/scripts/mock.controller.ts | 2 +- 11 files changed, 279 insertions(+), 1 deletion(-) create mode 100644 services/API-service/src/scripts/mock-data/flash-floods/MWI/single-event/Blantyre City/upload-alert_threshold-3.json create mode 100644 services/API-service/src/scripts/mock-data/flash-floods/MWI/single-event/Blantyre City/upload-damage_estimation-3.json create mode 100644 services/API-service/src/scripts/mock-data/flash-floods/MWI/single-event/Blantyre City/upload-nr_affected_buildings-3.json create mode 100644 services/API-service/src/scripts/mock-data/flash-floods/MWI/single-event/Blantyre City/upload-nr_affected_clinics-3.json create mode 100644 services/API-service/src/scripts/mock-data/flash-floods/MWI/single-event/Blantyre City/upload-nr_affected_roads-3.json create mode 100644 services/API-service/src/scripts/mock-data/flash-floods/MWI/single-event/Blantyre City/upload-nr_affected_schools-3.json create mode 100644 services/API-service/src/scripts/mock-data/flash-floods/MWI/single-event/Blantyre City/upload-nr_affected_waterpoints-3.json create mode 100644 services/API-service/src/scripts/mock-data/flash-floods/MWI/single-event/Blantyre City/upload-population_affected-3.json diff --git a/services/API-service/src/scripts/enum/mock-scenario.enum.ts b/services/API-service/src/scripts/enum/mock-scenario.enum.ts index dc4105082..47cdfaeff 100644 --- a/services/API-service/src/scripts/enum/mock-scenario.enum.ts +++ b/services/API-service/src/scripts/enum/mock-scenario.enum.ts @@ -7,6 +7,7 @@ export enum FloodsScenario { export enum FlashFloodsScenario { Trigger = 'trigger', + SingleEvent = 'single-event', NoTrigger = 'no-trigger', } diff --git a/services/API-service/src/scripts/mock-data/flash-floods/MWI/scenarios.json b/services/API-service/src/scripts/mock-data/flash-floods/MWI/scenarios.json index c49a76cbf..d4f882859 100644 --- a/services/API-service/src/scripts/mock-data/flash-floods/MWI/scenarios.json +++ b/services/API-service/src/scripts/mock-data/flash-floods/MWI/scenarios.json @@ -8,6 +8,11 @@ { "eventName": "Blantyre City", "leadTime": "0-hour" } ] }, + { + "scenarioName": "single-event", + "defaultScenario": false, + "events": [{ "eventName": "Blantyre City", "leadTime": "0-hour" }] + }, { "scenarioName": "no-trigger" } diff --git a/services/API-service/src/scripts/mock-data/flash-floods/MWI/single-event/Blantyre City/upload-alert_threshold-3.json b/services/API-service/src/scripts/mock-data/flash-floods/MWI/single-event/Blantyre City/upload-alert_threshold-3.json new file mode 100644 index 000000000..a3cb17b8e --- /dev/null +++ b/services/API-service/src/scripts/mock-data/flash-floods/MWI/single-event/Blantyre City/upload-alert_threshold-3.json @@ -0,0 +1,34 @@ +[ + { + "placeCode": "MW31541", + "amount": 1.0 + }, + { + "placeCode": "MW31548", + "amount": 1.0 + }, + { + "placeCode": "MW31549", + "amount": 1.0 + }, + { + "placeCode": "MW31542", + "amount": 1.0 + }, + { + "placeCode": "MW31536", + "amount": 1.0 + }, + { + "placeCode": "MW31535", + "amount": 1.0 + }, + { + "placeCode": "MW31534", + "amount": 1.0 + }, + { + "placeCode": "MW31547", + "amount": 1.0 + } +] diff --git a/services/API-service/src/scripts/mock-data/flash-floods/MWI/single-event/Blantyre City/upload-damage_estimation-3.json b/services/API-service/src/scripts/mock-data/flash-floods/MWI/single-event/Blantyre City/upload-damage_estimation-3.json new file mode 100644 index 000000000..c78d0b7fb --- /dev/null +++ b/services/API-service/src/scripts/mock-data/flash-floods/MWI/single-event/Blantyre City/upload-damage_estimation-3.json @@ -0,0 +1,34 @@ +[ + { + "placeCode": "MW31541", + "amount": 8.7372205e8 + }, + { + "placeCode": "MW31548", + "amount": 0.0 + }, + { + "placeCode": "MW31549", + "amount": 2.03924992e9 + }, + { + "placeCode": "MW31542", + "amount": 1.37519526e9 + }, + { + "placeCode": "MW31536", + "amount": 9.9143635e8 + }, + { + "placeCode": "MW31535", + "amount": 0.0 + }, + { + "placeCode": "MW31534", + "amount": 1.42163226e9 + }, + { + "placeCode": "MW31547", + "amount": 1.25558096e8 + } +] diff --git a/services/API-service/src/scripts/mock-data/flash-floods/MWI/single-event/Blantyre City/upload-nr_affected_buildings-3.json b/services/API-service/src/scripts/mock-data/flash-floods/MWI/single-event/Blantyre City/upload-nr_affected_buildings-3.json new file mode 100644 index 000000000..5066aeb40 --- /dev/null +++ b/services/API-service/src/scripts/mock-data/flash-floods/MWI/single-event/Blantyre City/upload-nr_affected_buildings-3.json @@ -0,0 +1,34 @@ +[ + { + "placeCode": "MW31541", + "amount": 67.0 + }, + { + "placeCode": "MW31548", + "amount": 318.0 + }, + { + "placeCode": "MW31549", + "amount": 413.0 + }, + { + "placeCode": "MW31542", + "amount": 199.0 + }, + { + "placeCode": "MW31536", + "amount": 158.0 + }, + { + "placeCode": "MW31535", + "amount": 808.0 + }, + { + "placeCode": "MW31534", + "amount": 173.0 + }, + { + "placeCode": "MW31547", + "amount": 4.0 + } +] diff --git a/services/API-service/src/scripts/mock-data/flash-floods/MWI/single-event/Blantyre City/upload-nr_affected_clinics-3.json b/services/API-service/src/scripts/mock-data/flash-floods/MWI/single-event/Blantyre City/upload-nr_affected_clinics-3.json new file mode 100644 index 000000000..71189adf2 --- /dev/null +++ b/services/API-service/src/scripts/mock-data/flash-floods/MWI/single-event/Blantyre City/upload-nr_affected_clinics-3.json @@ -0,0 +1,34 @@ +[ + { + "placeCode": "MW31541", + "amount": 0.0 + }, + { + "placeCode": "MW31548", + "amount": 0.0 + }, + { + "placeCode": "MW31549", + "amount": 0.0 + }, + { + "placeCode": "MW31542", + "amount": 0.0 + }, + { + "placeCode": "MW31536", + "amount": 0.0 + }, + { + "placeCode": "MW31535", + "amount": 0.0 + }, + { + "placeCode": "MW31534", + "amount": 0.0 + }, + { + "placeCode": "MW31547", + "amount": 0.0 + } +] diff --git a/services/API-service/src/scripts/mock-data/flash-floods/MWI/single-event/Blantyre City/upload-nr_affected_roads-3.json b/services/API-service/src/scripts/mock-data/flash-floods/MWI/single-event/Blantyre City/upload-nr_affected_roads-3.json new file mode 100644 index 000000000..23d1784ab --- /dev/null +++ b/services/API-service/src/scripts/mock-data/flash-floods/MWI/single-event/Blantyre City/upload-nr_affected_roads-3.json @@ -0,0 +1,34 @@ +[ + { + "placeCode": "MW31541", + "amount": 28.0 + }, + { + "placeCode": "MW31548", + "amount": 39.0 + }, + { + "placeCode": "MW31549", + "amount": 43.0 + }, + { + "placeCode": "MW31542", + "amount": 29.0 + }, + { + "placeCode": "MW31536", + "amount": 16.0 + }, + { + "placeCode": "MW31535", + "amount": 74.0 + }, + { + "placeCode": "MW31534", + "amount": 49.0 + }, + { + "placeCode": "MW31547", + "amount": 19.0 + } +] diff --git a/services/API-service/src/scripts/mock-data/flash-floods/MWI/single-event/Blantyre City/upload-nr_affected_schools-3.json b/services/API-service/src/scripts/mock-data/flash-floods/MWI/single-event/Blantyre City/upload-nr_affected_schools-3.json new file mode 100644 index 000000000..53488053a --- /dev/null +++ b/services/API-service/src/scripts/mock-data/flash-floods/MWI/single-event/Blantyre City/upload-nr_affected_schools-3.json @@ -0,0 +1,34 @@ +[ + { + "placeCode": "MW31541", + "amount": 0.0 + }, + { + "placeCode": "MW31548", + "amount": 0.0 + }, + { + "placeCode": "MW31549", + "amount": 0.0 + }, + { + "placeCode": "MW31542", + "amount": 0.0 + }, + { + "placeCode": "MW31536", + "amount": 1.0 + }, + { + "placeCode": "MW31535", + "amount": 0.0 + }, + { + "placeCode": "MW31534", + "amount": 0.0 + }, + { + "placeCode": "MW31547", + "amount": 1.0 + } +] diff --git a/services/API-service/src/scripts/mock-data/flash-floods/MWI/single-event/Blantyre City/upload-nr_affected_waterpoints-3.json b/services/API-service/src/scripts/mock-data/flash-floods/MWI/single-event/Blantyre City/upload-nr_affected_waterpoints-3.json new file mode 100644 index 000000000..71189adf2 --- /dev/null +++ b/services/API-service/src/scripts/mock-data/flash-floods/MWI/single-event/Blantyre City/upload-nr_affected_waterpoints-3.json @@ -0,0 +1,34 @@ +[ + { + "placeCode": "MW31541", + "amount": 0.0 + }, + { + "placeCode": "MW31548", + "amount": 0.0 + }, + { + "placeCode": "MW31549", + "amount": 0.0 + }, + { + "placeCode": "MW31542", + "amount": 0.0 + }, + { + "placeCode": "MW31536", + "amount": 0.0 + }, + { + "placeCode": "MW31535", + "amount": 0.0 + }, + { + "placeCode": "MW31534", + "amount": 0.0 + }, + { + "placeCode": "MW31547", + "amount": 0.0 + } +] diff --git a/services/API-service/src/scripts/mock-data/flash-floods/MWI/single-event/Blantyre City/upload-population_affected-3.json b/services/API-service/src/scripts/mock-data/flash-floods/MWI/single-event/Blantyre City/upload-population_affected-3.json new file mode 100644 index 000000000..297e1599e --- /dev/null +++ b/services/API-service/src/scripts/mock-data/flash-floods/MWI/single-event/Blantyre City/upload-population_affected-3.json @@ -0,0 +1,34 @@ +[ + { + "placeCode": "MW31541", + "amount": 174.0 + }, + { + "placeCode": "MW31548", + "amount": 671.0 + }, + { + "placeCode": "MW31549", + "amount": 390.0 + }, + { + "placeCode": "MW31542", + "amount": 209.0 + }, + { + "placeCode": "MW31536", + "amount": 432.0 + }, + { + "placeCode": "MW31535", + "amount": 1953.0 + }, + { + "placeCode": "MW31534", + "amount": 357.0 + }, + { + "placeCode": "MW31547", + "amount": 59.0 + } +] diff --git a/services/API-service/src/scripts/mock.controller.ts b/services/API-service/src/scripts/mock.controller.ts index 158ab5249..fbc0f6170 100644 --- a/services/API-service/src/scripts/mock.controller.ts +++ b/services/API-service/src/scripts/mock.controller.ts @@ -71,7 +71,7 @@ export class MockFloodsScenario extends MockBaseScenario { export class MockFlashFloodsScenario extends MockBaseScenario { @ApiProperty({ example: Object.values(FlashFloodsScenario).join(' | '), - description: 'trigger: trigger + warning event', + description: 'trigger: trigger + warning + ongoing event; single-event: ', }) @IsEnum(FlashFloodsScenario) public readonly scenario: FlashFloodsScenario;