Considering the application worked on last week design-patterns-backend. Let's add some processing and routines to the system.
Create scheduling jobs in BullMQ for two situations:
-
Add a status attribute that will be an
enumin theTaskobject. -
We should have a scheduling job to search for all open tasks that have not yet been completed and the Due Date is in past. The job should update the task status to
Late. The job should be scheduled for every day at midnight. -
We should have a scheduling job to poll all the tasks that have been completed. The job should update the task status to
Done. The job should also be scheduled to run every day at midnight.
Note: Two different jobs must be created, as they have different responsibilities.
Add a Mailer that should notify all active users about open and completed tasks in order of priority
- The email must contain the
title,descriptionandpriorityof the tasks and these must be in order of priority.
Note:
- The Mailer must be activated in the jobs created in task 1.
- You should add a new attribute to the user, that is the email.
The Job must be triggered when a task is completed, sending an email to the Owner and Collaborators saying that the task has been completed.
- The email must contain the
title,descriptionandcompletedAtof the Task.
- Add tests for the mailer and the job
- Follow the previous studies while maintaining the code abstraction
- Make separate commits