mirror of
https://github.com/GSA/notifications-api.git
synced 2025-12-24 17:31:34 -05:00
We should receive a response file from DVLA by 4pm the next working day (next Monday for letters created on Friday, Saturday or Sunday). Response file triggers a task to update the letters status from 'sending' to either 'failed' or 'delivered', at which point there should be no letter notifications in the 'sending' state for that day. To catch any errors in the process (eg a missing response file from DVLA) we add a scheduled task that checks letter notifications for previous day (or Friday when run on Monday) and raises a Deskpro ticket if it finds any in a 'sending' state. We're checking letter notifications based on the `sent_at` date, which is set when the letter PDF is sent to DVLA (so for letters created after 5:30pm it will be the next day). The task runs at 4:30pm, which should give the response file processing task enough time to finish if the file was uploaded at 4pm.