-
Notifications
You must be signed in to change notification settings - Fork 35
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 - email 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 |
@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
* 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
Co-authored-by: donia benharara <donia.benharara@pathtech.fr>
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.
Looks good to me!
One small thing we should address before merging, momentjs is deprecated and we removed it from the app a few months ago. So let's remove the few re-appearances from this PR for consistency :)
Hi @Max-Z80. Two more small inputs from Gabriela:
cc @ericboucher |
const latestAvailableReports = await getLatestAvailableReports(); | ||
|
||
// get the last alert which has been processed for email alert system | ||
const alert = await alertRepository.findOne({ |
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.
Co-authored-by: Maxime Chaillet <maxime.chaillet@pathtech.fr>
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.
Setup - anticipatory action storm alerts
alerting-node
process.docker-compose up
to launch thealerting-node
andalerting-db
processes.psql
console ofalerting-db
and run the following command: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: