Notifications and scheduled work
Several small scheduled jobs coordinate appointment reminders and prescription notifications.
- A one-minute job calculates due prescription alerts.
- Another one-minute job creates notification records from those alerts.
- A sender delivers queued notifications through Firebase Cloud Messaging and emits live events over Socket.IO.
- A two-hour job expires eligible prescription records.
- Appointment reminders run on a five-minute schedule.
Splitting calculation, creation, delivery, and expiry gives each task a narrow responsibility. The prescription timeline shows the patient side of this flow.