maintenance/backend/src
jtricerolph d9b01a5981 Add lead time to recurring templates — generate before actually due
task_templates.lead_days (default 0): scheduler now spawns the task
when (next_due - lead_days) <= today instead of next_due <= today, but
due_date on the created task is still the real next_due — so overdue
and priority handling are unaffected, the task just becomes visible
earlier for prep/booking. Small jobs (AC filter clean) can stay at 0;
bigger ones needing advance notice (septic tank empty-out, contractor
booking) can set 2-3 days or 30 days as needed.

- db.js: lead_days INT NOT NULL DEFAULT 0 (inline for fresh installs,
  ALTER for existing).
- scheduler.js: WHERE (next_due - lead_days) <= $1 — next_due itself
  and the fixed/floating rollover logic are untouched by this.
- templates.js: accept + validate lead_days (>= 0) on create/update.
- Recurring.tsx: lead time field in the template form with contextual
  hint text, plus a small 'generates Nd early' note on list rows that
  have one set.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-08-26 12:20:50 +00:00
..
lib Add lead time to recurring templates — generate before actually due 2026-08-26 12:20:50 +00:00
routes Add lead time to recurring templates — generate before actually due 2026-08-26 12:20:50 +00:00
auth.js Maintenance log book app — initial scaffold 2026-07-03 21:28:57 +00:00
db.js Add lead time to recurring templates — generate before actually due 2026-08-26 12:20:50 +00:00
index.js Add Web Push notifications for task assignment 2026-07-20 22:59:16 +00:00
ip-check.js Maintenance log book app — initial scaffold 2026-07-03 21:28:57 +00:00