Create recurring notification architecture for sending notifications about events related to locations followed by users.
This includes:
Establishing the criteria and logic for what constitutes a qualifying event
Ensuring that qualifying events at child locations of a location a user followed (e.g., a county for a user following a state) were also included in notifcations for that user
Determining how to establish the date range for which we were pulling events
Properly batching notifications so that all notifications associated with a single user were sent at once.
Setting up a cache/queue system to prevent redundant notifications in case the system fails partway through
Setting up the system for formatting updates (in html and raw text) and sending them to users via mailgun
Creating the /notifications endpoint for sending notifications to users
Testing
Run tests in the /tests directory
Inspect API to confirm proper appearance of endpoing
Performance
Integration tests developed impose a more substantial performance cost compared to other tests, due to the sheer amount of dependencies which need to be set up (for example, creating a test user, creating a test agency associated with a test location, creating a data source to associate with the agency, modifying the time of the event to ensure it is picked up, etc.)
Calling the /notification endpoint itself will have a performance cost that scales linearly with the number of users who have qualifying events and hence will need data pulled and then sent. This can likely be optimized considerably, but that was considered out of scope for the moment.
Fixes
Description
/notifications
endpoint for sending notifications to usersTesting
/tests
directoryPerformance
/notification
endpoint itself will have a performance cost that scales linearly with the number of users who have qualifying events and hence will need data pulled and then sent. This can likely be optimized considerably, but that was considered out of scope for the moment.Docs
Breaking Changes