express-api/src/services/notifications/notificationServices.ts
Avoid deeply nested control flow statements. Open
Open
if (!notifExists) {
//If there is no notification like this already pending, we send one.
const sendOn = new Date(mostRecentStatusChangeDate.getTime());
sendOn.setDate(mostRecentStatusChangeDate.getDate() + statusNotif.DelayDays);
//We set the delay by the most recent status change date plus the number of delay days. This should make these new emails