feat(maintenance): reminders CLI + systemd timer drop-in
Deploy to LXC / deploy (push) Successful in 15s
Validate / validate (push) Successful in 35s

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:
2026-04-27 16:15:03 +07:00
parent f5e4743120
commit 09e0fdc9ac
3 changed files with 132 additions and 0 deletions
+1
View File
@@ -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": {