Skip to content

Commit

Permalink
Merge branch 'development' of https://github.com/EyeSeeTea/zebra-dev
Browse files Browse the repository at this point in the history
…into feat/remove-added-option
  • Loading branch information
deeonwuli committed Nov 28, 2024
2 parents c3cf55b + a818e75 commit f4dba9a
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 6 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "zebra",
"description": "Zambia Emergency Bridge for Response Application",
"version": "0.1.0",
"version": "1.0.0",
"license": "GPL-3.0",
"author": "EyeSeeTea team",
"homepage": ".",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import i18n from "@eyeseetea/feedback-component/locales";
import i18n from "../../../utils/i18n";
import { Code, Ref } from "../Ref";
import { Struct } from "../generic/Struct";
import { Either } from "../generic/Either";
Expand Down
21 changes: 17 additions & 4 deletions src/scripts/mapDiseaseOutbreakToAlerts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { command, run } from "cmd-ts";
import path from "path";
import { getD2ApiFromArgs } from "./common";
import {
hazardTypeCodeMap,
RTSL_ZEBRA_ALERTS_DISEASE_TEA_ID,
RTSL_ZEBRA_ALERTS_EVENT_TYPE_TEA_ID,
RTSL_ZEBRA_ALERTS_NATIONAL_DISEASE_OUTBREAK_EVENT_ID_TEA_ID,
Expand All @@ -22,7 +23,10 @@ import {
import { AlertSyncDataStoreRepository } from "../data/repositories/AlertSyncDataStoreRepository";
import { getNotificationOptionsFromTrackedEntity } from "../data/repositories/utils/NotificationMapper";
import { AlertData } from "../domain/entities/alert/AlertData";
import { DataSource } from "../domain/entities/disease-outbreak-event/DiseaseOutbreakEvent";
import {
DataSource,
HazardType,
} from "../domain/entities/disease-outbreak-event/DiseaseOutbreakEvent";
import { D2TrackerTrackedEntity } from "@eyeseetea/d2-api/api/trackerTrackedEntities";
import { FutureData } from "../data/api-futures";
import { Alert } from "../domain/entities/alert/Alert";
Expand Down Expand Up @@ -75,6 +79,15 @@ function main() {
}).run(
({ alertTrackedEntities, appConfig }) => {
const { hazardTypes, suspectedDiseases } = appConfig.eventTrackerConfigurations;
const hazardTypeCodes = hazardTypes.map(hazardType => {
const hazardTypeId = hazardType.id as HazardType;

return {
id: hazardTypeCodeMap[hazardTypeId],
name: hazardType.name,
};
});

const alertsWithNoEventId =
getAlertsWithNoNationalEventId(alertTrackedEntities);

Expand All @@ -98,7 +111,7 @@ function main() {
const outbreakKey = getOutbreakKey({
dataSource: filter.dataSource,
outbreakValue: filter.filterValue,
hazardTypes: hazardTypes,
hazardTypes: hazardTypeCodes,
suspectedDiseases: suspectedDiseases,
});

Expand Down Expand Up @@ -127,7 +140,7 @@ function main() {
const outbreakName = getOutbreakKey({
dataSource: dataSource,
outbreakValue: outbreakData.value,
hazardTypes: hazardTypes,
hazardTypes: hazardTypeCodes,
suspectedDiseases: suspectedDiseases,
});

Expand Down Expand Up @@ -177,7 +190,7 @@ function main() {
saveAlertSyncData({
alertOptions: alertOptions,
alert: alert,
hazardTypes: hazardTypes,
hazardTypes: hazardTypeCodes,
suspectedDiseases:
suspectedDiseases,
}).run(
Expand Down

0 comments on commit f4dba9a

Please sign in to comment.