Skip to content

MedEvac: email notification scheduler - #1261

Merged
AntoineRelief merged 18 commits into
AB#138853from
medevac/email-scheduler
Sep 28, 2026
Merged

AntoineRelief merged 18 commits into
AB#138853from
medevac/email-scheduler

Conversation

@morgang-adappt

@morgang-adappt morgang-adappt commented Jul 27, 2026 •

Copy link
Copy Markdown
Contributor

Description

Adds back-end cron scheduling for Email Notifications. A Schedule { scheduleEnabled, cronValue } type is added to EmailNotification (Mongoose model, GraphQL type and input), and emailNotificationScheduler.ts registers node-cron jobs at boot, then creates, replaces or removes them on add, edit and soft-delete.

When a job fires it dispatches to the function app by notification id - send-individual-email if any dataset is send-separate, otherwise send-email - and records the outcome to lastExecution / lastExecutionStatus.

Useful links

Type of change

  • New feature (non-breaking change which adds functionality)

How Has This Been Tested?

Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce.

  • Test A
  • Test B

Screenshots

Please include screenshots of this change. If this issue is only back-end related, and does not involve any visual change of the platform, you can skip this part.

Checklist:

( * == Mandatory )

  • * I have set myself as assignee of the pull request
  • * My code follows the style guidelines of this project
  • * Linting does not generate new warnings
  • * I have performed a self-review of my own code
  • * I have put the ticket for review, adding the oort-backend team to the list of reviewers
  • * I have commented my code, particularly in hard-to-understand areas
  • * I have put JSDoc comment in all required places
  • * My changes generate no new warnings
  • * I have included screenshots describing my changes if relevant
  • * I have selected labels in the Pull Request, according to the changes with code brings
  • I have made corresponding changes to the documentation ( if required )
  • I have added tests that prove my fix is effective or that my feature works
  • * New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules

ajithkumaradappt and others added 15 commits July 27, 2026 01:05
(cherry picked from commit 67042d6)
Use consistent string IDs for EN ID in scheduler
Remove scheduled task on EN soft deletion

(cherry picked from commit 3480d4f)
(cherry picked from commit 57d5333)
@AntoineRelief
AntoineRelief changed the base branch from next to AB#138853 September 28, 2026 09:06
@AntoineRelief
AntoineRelief merged commit eda63ab into AB#138853 Sep 28, 2026
1 check passed
@AntoineRelief
AntoineRelief deleted the medevac/email-scheduler branch September 28, 2026 09:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants