27 lines
3.4 KiB
Markdown
27 lines
3.4 KiB
Markdown
# 05 — Warn about weeks with one workday
|
|
|
|
**What to build:** The statistics popup identifies undesirable full weeks with exactly one day remaining to work, showing both how many such weeks exist and the exact date of each lone workday.
|
|
|
|
**Blocked by:**
|
|
|
|
- 01 — Open plan statistics for calculated leave usage.
|
|
- [#61 — Saisir, sauvegarder et figer les jours déjà posés](https://gitea.nessar.fr/nessar/vac-optimizer/issues/61), which carries fixed declared non-working days with the producing calculation and its outcomes.
|
|
|
|
**Status:** ready-for-agent
|
|
|
|
**Gitea:** [#69](https://gitea.nessar.fr/nessar/vac-optimizer/issues/69)
|
|
|
|
Source: the agreed Plan Statistics Popup spec for [#3](https://gitea.nessar.fr/nessar/vac-optimizer/issues/3) and [#29](https://gitea.nessar.fr/nessar/vac-optimizer/issues/29), including the clarification that working only one day in a full week is undesirable. Follow the domain glossary and ADRs 0004, 0006, and 0007.
|
|
|
|
- [ ] Count Monday-to-Sunday calendar weeks whose five Monday-to-Friday dates all lie inside the submitted half-open horizon and that contain exactly one remaining working day after excluding French public holidays, leave placements, and declared non-working days.
|
|
- [ ] Four weekdays off and one remaining workday qualify. Weeks with zero or two remaining workdays do not qualify, including two-workday weeks containing separate one-day work sequences.
|
|
- [ ] Exclude clipped workweeks at both horizon edges, even if only one workday happens to be visible. A week whose five weekdays are all inside the horizon still qualifies when its Saturday or Sunday lies outside it.
|
|
- [ ] When the count is positive, show a clear warning and one chronological entry per affected week, identifying its Monday-to-Sunday date range and the exact date of its lone workday. Localized dates include enough year context to disambiguate multi-year horizons and weeks spanning year boundaries.
|
|
- [ ] A valid plan with no matching weeks displays a count of 0 and no matching-week warning entries. The warning remains understandable without relying solely on color and is readable with keyboard, assistive technology, and mobile layout.
|
|
- [ ] Declarations alone can create a qualifying week without new placements. Saved declarations outside the horizon do not create extra warnings. Use the shared working-day calendar and the producing plan's fixed declarations rather than its count of short work sequences.
|
|
- [ ] The count and dated entries inherit snapshot stability, replacement and clearing behavior, trace independence, and the partial-plan label. They describe the actual retained plan on cancellation, not a later candidate or a historical or hypothetical view.
|
|
- [ ] The feature only reports the pattern; it does not move leave, change planning objectives, trigger recalculation, or present a valid plan as a planning conflict.
|
|
- [ ] Behavior tests cover one/zero/two workdays, separated one-day sequences, declaration-only weeks, holiday exclusions, clipped horizon edges, all weekdays inside with the weekend outside, month/year boundaries, and complete versus retained partial outcomes. Assert both counts and displayed week/workday dates through existing planning and calendar tests, including worker/cancellation behavior; run the repository's existing tests, lint, formatting, type checks, and production build.
|
|
|
|
This diagnostic depends on fixed declarations from #61, but does not require time-off-period aggregation from #62 or the other statistics tickets.
|