Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: remove enableStopTrigger AB#32660 #1936

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 28 additions & 0 deletions services/API-service/migration/1737374068839-RemoveStopTrigger.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import { MigrationInterface, QueryRunner } from 'typeorm';

export class RemoveStopTrigger1737374068839 implements MigrationInterface {
name = 'RemoveStopTrigger1737374068839';

public async up(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(
`ALTER TABLE "IBF-app"."country-disaster-settings" DROP COLUMN "enableStopTrigger"`,
);

// Empty stop-trigger columns, as we are removing the functionality, just keeping the columns to repurpose them later
await queryRunner.query(
`UPDATE "IBF-app"."event-place-code" SET "stopped" = false`,
);
await queryRunner.query(
`UPDATE "IBF-app"."event-place-code" SET "manualStoppedDate" = null`,
);
await queryRunner.query(
`UPDATE "IBF-app"."event-place-code" SET "userUserId" = null`,
);
}

public async down(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(
`ALTER TABLE "IBF-app"."country-disaster-settings" ADD "enableStopTrigger" boolean NOT NULL DEFAULT true`,
);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -104,10 +104,6 @@ export class CountryDisasterSettingsEntity {
@Column({ default: true })
public enableEarlyActions: boolean;

@ApiProperty()
@Column({ default: true })
public enableStopTrigger: boolean;

@ApiProperty()
@Column({ default: false })
public isEventBased: boolean;
Expand Down
2 changes: 0 additions & 2 deletions services/API-service/src/api/country/country.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -185,8 +185,6 @@ export class CountryService {
disaster.showMonthlyEapActions;
countryDisasterSettingsEntity.enableEarlyActions =
disaster.enableEarlyActions;
countryDisasterSettingsEntity.enableStopTrigger =
disaster.enableStopTrigger;
countryDisasterSettingsEntity.monthlyForecastInfo =
disaster.monthlyForecastInfo
? JSON.parse(JSON.stringify(disaster.monthlyForecastInfo))
Expand Down
3 changes: 0 additions & 3 deletions services/API-service/src/api/country/dto/add-countries.dto.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,9 +75,6 @@ export class CountryDisasterSettingsDto {
@ApiProperty({ example: true })
public enableEarlyActions?: boolean;

@ApiProperty({ example: true })
public enableStopTrigger?: boolean;

@ApiProperty({ example: {} })
public monthlyForecastInfo?: object;

Expand Down
2 changes: 0 additions & 2 deletions services/API-service/src/api/event/event.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -491,8 +491,6 @@ export class EventService {
'area."placeCode" AS "placeCode"',
'area.name AS name',
'event."startDate"',
'event.stopped as stopped',
'case when event.stopped = true then event."manualStoppedDate" end as "stopDate"',
'event.closed as closed',
'case when event.closed = true then event."endDate" end as "endDate"',
'disaster."actionsUnit" as "exposureIndicator"',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ export interface CountryDisasterSettings {
eapAlertClasses?: EapAlertClasses;
monthlyForecastInfo?: Record<string, string | string[]>;
enableEarlyActions?: boolean;
enableStopTrigger?: boolean;
}

export interface NotificationInfo {
Expand Down
1 change: 0 additions & 1 deletion services/API-service/src/scripts/json/countries.json
Original file line number Diff line number Diff line change
Expand Up @@ -440,7 +440,6 @@
],
"eapLink": "https://510ibfsystem.blob.core.windows.net/about-trigger/MWI-flashfloods-about.pdf",
"enableEarlyActions": false,
"enableStopTrigger": false,
"isEventBased": true
}
],
Expand Down
Loading