-
Notifications
You must be signed in to change notification settings - Fork 34
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
aa storm feature / alert logic #1420
base: feature/add-new-AA-storm
Are you sure you want to change the base?
Conversation
Build succeeded and deployed at https://prism-1420.surge.sh |
@@ -0,0 +1,25 @@ | |||
import { isNaN } from 'lodash'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's add a docstring to this file please
@Max-Z80 please describe a bit more what this PR does in the PR body and adapt the name to what it is actually doing. There is no real "logic" here, it is simply initializing the new alert worker. No? |
THere is a logic in the aa-strom-alert-worker.js. I will describe deeper this logic in the PR body |
3b4c109
to
ddd4a08
Compare
alerting/migration/1738249210356-create-latest-aa-storm-reports-table.ts
Outdated
Show resolved
Hide resolved
alerting/migration/1738249210356-create-latest-aa-storm-reports-table.ts
Outdated
Show resolved
Hide resolved
852ba3e
to
4f586c6
Compare
4f586c6
to
4773e5b
Compare
implements MigrationInterface | ||
{ | ||
public async up(queryRunner: QueryRunner): Promise<void> { | ||
await queryRunner.query(`CREATE TABLE "anticipatory_action_alerts" ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@wadhwamatic we decided to store the alerts in a new table since the behavior was quite different.
This will let us control mailing lists and target urls more easily. We made it so that it can be used for other countries in the future
5a9b054
to
5334a29
Compare
5334a29
to
2a6ec4f
Compare
* Update design, add mailto link, update wind types, filter activated district * fix type * add body message * fix type * fix lint * fix lint * add bcc option to email * fix naming
Description
This is the logic for deciding whether to send an email or not.
the cron run hourly
latest reports for each storm are persisted in DB
when a new report is published and has not been processed yet by the alert system then an email payload might be built depending of the report status for example
The email payloads will then be used to create the emails and send it at the end of the process.
Notes
How to test the feature:
Checklist - did you ...
Test your changes with
REACT_APP_COUNTRY=rbd yarn start
REACT_APP_COUNTRY=cambodia yarn start
REACT_APP_COUNTRY=mozambique yarn start
Screenshot/video of feature: