Files
vitareba/app/api/cron
g-butandClaude Opus 4.7 3e83d32df2 fix(cron/signals): count alerts per patient transition, not per admin recipient
cron/signals incremented `alerts++` inside the per-admin Promise.allSettled
result loop, so 1 patient going critical with 3 admins reported
{ alerts: 3 } in the response body. Made the cron's observability
number meaningless — Manuel checking the day's run could not
distinguish "3 patients went critical" from "1 patient with our 3
admins on the distribution list".

Now the per-admin loop logs failures only; alerts increments once
per critical-transition iff at least one admin send succeeded.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-26 10:27:06 +02:00
..