Skip to content

Maintenance cycle and reminders - #31

Merged
Installation-04 merged 2 commits into
mainfrom
claude/feature-maintenance-cycle
Nov 5, 2026
Merged

Installation-04 merged 2 commits into
mainfrom
claude/feature-maintenance-cycle

Conversation

@Installation-04

Copy link
Copy Markdown
Owner

Summary

  • New equipment.maintenance_interval_months column (schema.js self-healing + init.sql) with API validation (1-120 months).
  • Completing a maintenance work order (auto-generated, or due on the equipment's next_maintenance date) sets last_maintenance to today and moves next_maintenance forward by the interval. Done once per transition to done.
  • Overdue/upcoming (30 d) maintenance and expired/expiring (30 d) EPI alerts: exposed in /api/dashboard/summary, shown on Home ("En retard / À venir" lists, dark-mode classes), turned into admin notifications by the daily job (de-duplicated over 7 days), and added to the admin email digest (only when email is configured).
  • Equipment form has a "Cycle de maintenance" select.
  • Tests in backend/test/maintenance-cycle.test.js; CHANGELOG "Non publié" entry.

Test plan

  • node --test backend/test/*.test.js against real Postgres (175 pass)
  • npm run build in frontend
  • Manual UI check in browser (not done)

Generated by Claude Code

Recurrence on equipment, roll-forward when a maintenance work order is
completed, overdue/upcoming maintenance and EPI expiry alerts on the
dashboard, in notifications and in the daily job.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01StC4huMbM6BRB9r4XFXvXv
…ial update, isolate digest

- rollMaintenanceForward only matches a work order due on the equipment's
  current next_maintenance, so re-opening/re-closing an old one cannot push
  the date forward again.
- PUT equipment keeps the stored cycle when the field is absent.
- Daily jobs: a failing admin digest no longer skips the status write.
- Equipment form keeps a stored cycle that is not in the preset list.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01StC4huMbM6BRB9r4XFXvXv
@Installation-04
Installation-04 marked this pull request as ready for review November 5, 2026 03:06
@Installation-04
Installation-04 merged commit 91c366d into main Nov 5, 2026
6 checks passed
@Installation-04 Installation-04 mentioned this pull request Nov 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants