Skip to content

feat(back): Restrictions to notifications (#16)

Added two restrictions:

  • The "/send-notifications"-endpoint has a cooldown in days based on a constant
  • Each user can only recieve a maximum amount of emails per unit, also based on a constant.

Can be tested by creating a user and enrolling to a course with units. Then post to the "/send-notifications"-endpoint. Try tweaking the NOTIFICATION_COOLDOWN_DAYS and NOTIFICATION_LIMIT constants and post to the endpoint again.

Also fixed a bug where all units got checked, fixed it so that only the available units are checked. Students who have not reflected on units that hasnt become available yet should not be notified about this.

Closes: #16 (closed)

Edited by Julian Ammouche Ottosen

Merge request reports

Loading