c0a8906d6a
A single platform-wide @nestjs/schedule cron (daily 07:00), registered via SchedulerRegistry exactly like TenderSchedulerService — NOT the DkvSchedulerService single-tenant pattern (Pitfall 1). Selects candidate users as distinct userId with an open TenderMatch (notifiedAt IS NULL) via findMany across all tenants, resolves each user's TenderNotificationPref.digestInterval (missing row -> daily default, D-01: daily always due, weekly only on Monday Europe/Berlin, off never), groups their un-notified matches by saved-search profile name into one TenderMailService.sendDigest call per user (D-02), and stamps notifiedAt+channel='digest' ONLY after a successful send — the shared notifiedAt-IS-NULL eligibility gate that guarantees no double-send with instant alerts (D-06). Each candidate user is processed in its own try/catch: a missing SMTP config, a send failure, or an unexpected thrown error for one user/tenant leaves that user's matches notifiedAt=NULL (retried next run) and never aborts the run for the rest (Pitfall 6). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>