Skip to content

Refactoring relating to API notification handling

Callum Dickinson requested to merge 16-add-a-preventive-alert-type into master

Work done as part of #16, but no longer includes the work on preventives. That will be in a separate MR at a later point in time.

The aim of this work is to reduce the number of places that have to be modified whenever a notification type is added or modified. It also tries to reduce the amount of code duplication in the API module, and includes preparation work for making APIs "stable" (where, the input and output from the APIs don't change once we finalise them), yet easier to adapt to backend database changes.

As of this MR, these are the files that have to be changed to accommodate for changes to notifications:

api/web/v1/notifications/handlers/__init__.py
api/web/v1/notifications/handlers/<notif_type>.py
notifications/<notif_type>.py
notifications/queue/actors.py
tests/notifications/__init__.py
templates/notifications/table.html
templates/notifications/<notif_type>/get_by_id.html
templates/(detail_pages.html|list_pages.html|failed_alerts.html|...) ('deprecated' pager templates, need to be modified if the modification is to alerts)
views.py
Edited by Callum Dickinson

Merge request reports