Files
vac-optimizer/.scratch/plan-statistics/issues/04-count-public-holidays-connected-to-a-weekend.md
T
2026-10-07 00:28:29 +02:00

2.8 KiB

04 — Count public holidays connected to a weekend

What to build: The statistics popup counts weekday public holidays joined to a weekend by the calculated plan's time-off periods, including connections through leave and adjacent holidays beyond the horizon.

Blocked by:

Status: ready-for-agent

GitLab: #68

Source: the agreed Plan Statistics Popup spec for #3 and #29, including #9. Follow the domain glossary and ADRs 0004, 0006, and 0007.

  • Show the number of distinct Monday-to-Friday French public-holiday dates in planned time-off periods containing at least one Saturday or Sunday. Each qualifying period contains at least one leave placement or declared non-working day.
  • Count direct Monday/Friday connections and connections through leave, such as a Tuesday holiday joined to a weekend by Monday off. Declared non-working days can provide the same connection without consuming a balance.
  • Exclude Saturday and Sunday public holidays, naturally long weekends without placed or declared leave, and weekday-only time-off periods that do not reach a weekend. A declaration never becomes a public holiday.
  • Include a qualifying holiday immediately outside the submitted horizon when it belongs to the period's full contiguous span. Friday leave followed by a weekend and a Monday holiday outside the horizon includes that Monday holiday.
  • Each holiday date contributes once. This is a date count, independent of the weighted public-holiday week value used in optimization; a qualifying Wednesday holiday contributes 1, not 3.
  • A valid plan with no qualifying dates displays 0. Complete and retained partial plans use their own producing outcomes and calendar facts, independently of trace delivery or pending input edits.
  • Behavior tests verify direct and bridged connections, declaration-only connections, weekend-holiday exclusion, natural long weekends, breaks reaching no weekend, adjacent out-of-horizon holidays, and duplicate dates. Assert the visible count, direct/worker consistency, and retained-plan behavior; run the repository's existing tests, lint, formatting, type checks, and production build.

This slice uses the canonical periods supplied by #62 and can proceed independently of ticket 02's descriptive length statistics. It does not change optimization weights or placement decisions.