feat(maintenance): reminders CLI + systemd timer drop-in
Phase 3-4 of maintenance reminders. scripts/maintenance-reminders.ts: thin CLI that opens the same pg pool as the app and calls runRemindersOnce. Flags: --soon-days N (default 7), --company <id> (default all), --dry-run (count without firing), --backfill (mark all currently due as already-sent, mutually exclusive with --dry-run). Prints a single-line JSON summary so journald/jq handles it cleanly. package.json: + reminders:check script. DEPLOYMENT.md: documents the systemd .service + .timer pair for 06:00 daily, with Persistent=true so a missed run during host downtime still fires on next boot. Includes the first-deploy protocol (--dry-run to scope, then either let day-one alert or --backfill for a clean slate). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -16,6 +16,7 @@
|
||||
"db:studio": "drizzle-kit studio",
|
||||
"db:seed": "tsx scripts/seed/system-asset-types.ts",
|
||||
"create-user": "tsx scripts/create-user.ts",
|
||||
"reminders:check": "tsx scripts/maintenance-reminders.ts",
|
||||
"prepare": "husky || true"
|
||||
},
|
||||
"dependencies": {
|
||||
|
||||
Reference in New Issue
Block a user