Dentolize · Daily Notifications Cron Walkthrough
On this pageOverviewWhat shipped, concretelyWho this is forScope notes

Daily Notifications Cron

Overview

This PR (mo/daily_notifications_cron, #402) adds a small, self-contained feature to Dentolize: an end-of-day push notification for clinic staff.

Two new, independently switchable notifications land on a staff member's phone once a day, timed to the clinic's own closing time (23:30 in the clinic's local time zone):

  1. Daily Summary — a one-line financial and operational recap (invoices

billed, amount still owed, patient payments collected, and how many of the day's appointments were completed) sent to owners/managers who have analytics access.

  1. Daily Appointments Summary — a per-doctor recap of what they finished

today and what their first appointment tomorrow looks like, sent to every doctor who had appointments in that window.

Both are opt-out: every user gets them by default, and can turn either one off from their notification preferences, on mobile or on web.

What shipped, concretely

  • Two new toggles in Settings → Account → Main → Show Notifications For

(web) and More → Settings → Notifications (mobile): "Daily Summary" and "Daily Appointments Summary".

  • Two new columns on UserAlertSettingssummaryCron, appointmentsCron

— both defaulting to true.

  • A new hourly cron job, dailyNotificationsCron, that finds every company

whose local clock just hit 23:30 and sends the two message types via Expo push notifications.

  • A small, self-contained translation table (dailyCronTranslations.js)

covering the same 9 languages the app already ships in, used only by this cron (it runs server-side, outside the app's normal react-i18next setup).

  • A side fix: the web settings form had a "Treasury" notification checkbox

that rendered but was silently dropped when the form saved — this PR's changes to the same array of settings keys fix that too. See Notification Settings Toggles for detail.

Who this is for

Every clinic staff member with the mobile app installed and at least one permission group gets one or both notifications, gated by their own toggle and (for the financial summary) by their permissions. There is no new admin-facing configuration — the only "settings" are the per-user toggles described above, plus the existing internal cron-monitoring screen that now lists this job alongside the others.

Scope notes

  • Delivery channel is push notifications only (via Expo), to the mobile

app. There is no email, SMS, or WhatsApp variant of this feature, and no in-browser notification on the web app — the web app only hosts the on/off toggle.

  • This feature is unreleased; the screenshots in this walkthrough were

captured against the PR's own sandbox deployment, not a production environment.