[DAILY AGS] Implement daily job
# pseudo-code
Fetch distinct users from user_daily_notifications(date): user_id[]
For every user_id in user_ids:
var notifications[]
Fetch user_daily_notifications(user_id, date): {user_id, date, notification_id}[]
For each notification in user_daily_notifications:
Fetch notification(id)
# Future: Check is not processed yet
Append to notifications
Send to queue {user_id, notifications}
For each notification in user_daily_notifications:
Delete entry from DB after processing
# Only delete after sending to avoid deleting before sending to queue
# Error handling, to avoid duplicates: when we have a db to track notification status, we should verify notification is not processed before before appending to notifications
More info: https://codimd.web.cern.ch/LtipSj4_RDmBvz3hWJed2Q?view#Option-2
Edited by Carina Antunes