Open liza-veis opened 4 days ago
User Story: As a user, I want to receive notifications when project statistics are not updated for a certain period of time, so I can stay informed about project activity and take necessary actions.
Acceptance Criteria:
@liza-veis, I need to clarify a few moments about backend.
- So I need to create a notifications module and a notifications table for that. Should I omit status and type columns for now?
yes, let's omit unnecessary columns for now.
- Notification table has receiver_user_id column. Does it mean that only one user should receive the notification about failed project activity update? It just seems odd that notifications explicitly connected to users and not to project groups.
Notifications should be connected to users. We need to find all users that have access to the analytics: View All Projects, Manage All Projects (root permissions) or View Project, Edit Project, Manage Project (permissions for this project) and create notification for each of them (there should be an option for bulk creation).
- Since analytics is updated every 3 hours should the notification cron job check for all project updates also every 3 hours and then compare last_activity_date to 3 days, 7 days and so on?
No, no need for this logic, because we won't delete notifications, once they are sent.
No, no need for this logic, because we won't delete notifications, once they are sent.
Now i don't really understand how it should work. So the notification cron job should be global for all projects but run once a day or it should run separately for each project?
Now i don't really understand how it should work. So the notification cron job should be global for all projects but run once a day or it should run separately for each project?
I see the logic like this: We run one cron job every day, and inside it, we fetch all projects where the last activity log is less than the current date by our first threshold. Filter projects where needed number of days passed (either 3, or the number is dividable by 7), then for each of this project we need to find all eligible users and create the same notification for each of those users. And when we will fetch notifications for specific user, we will fetch them by user id
What feature?
last_activity_date
not null. This column is added here #274 .Screenshots