Show work-sequence and time-off-period lengths #66

Closed
opened 2026-10-07 00:23:53 +02:00 by nessar · 5 comments
nessar commented 2026-10-07 00:23:53 +02:00 (Migrated from 172.24.0.1:8928)

Blocked by: #65, #62

Parent

What to build

The statistics popup shows average and longest working stretches, average and longest complete breaks, and non-working-day gain, using the calculated plan's shared calendar semantics.

Source: the agreed Plan Statistics Popup spec for #3 and #29, including #7. The existing longest work-sequence metric from #28 is reused. Follow the domain glossary and ADRs 0004, 0006, and 0007.

Acceptance criteria

  • Add five labelled metrics: non-working-day gain, average work-sequence length, longest work-sequence length, average time-off period length, and longest time-off period length. Work lengths use working days; break lengths use calendar days.
  • The work-sequence average includes every non-empty sequence inside the submitted horizon, including both edges. Weekends and French public holidays neither count nor split a sequence; leave placements and declared non-working days interrupt it. Consecutive days off introduce no zero-length samples.
  • Sequences of 10, 5, and 15 working days produce an average of 10 and a longest length of 15. Fractional averages remain representable and calculations do not prematurely round the underlying values.
  • Break statistics use full canonical time-off periods, including merged declarations and placements and contiguous non-working dates immediately outside the horizon. Friday and Monday off around a holiday-free weekend produce one 4-calendar-day period. A declared Friday with no new placements produces a 3-day Friday–Sunday period.
  • Non-working-day gain counts distinct weekend and public-holiday dates in these periods. A weekend public holiday contributes once; a declared day does not itself become additional weekend or holiday gain.
  • Saved declarations outside the horizon do not inflate in-horizon work counts or create isolated out-of-horizon periods. Adjacent declarations may extend a period anchored inside the horizon under the shared calendar contract.
  • Empty samples remain distinguishable from measured zero. A valid plan without work sequences retains a longest work-sequence length of 0; missing average samples and a missing longest time-off period retain an explicit empty data state.
  • All five figures inherit the popup's snapshot, trace independence, and partial-plan behavior. Any new outcome facts survive direct planning, worker transport, and retained-plan checkpoints and describe the actual displayed plan.
  • Behavior tests cover fractional means, both horizon edges, contiguous days off, intervening weekends and holidays, declarations without new placements, merged periods, adjacent context dates, and empty samples. Check rendered units and values, complete and retained partial outcomes, and the repository's existing tests, lint, formatting, type checks, and production build.

Reuse #62's calendar and period definitions rather than adding a conflicting calendar model. These descriptive metrics do not change the planning objective order.

Proposed presentation default, not explicitly confirmed: show "—" for an average without samples and for the longest time-off period when none exists. Decimal precision follows existing presentation conventions; it does not change the underlying metric.

Blocked by

Blocked by: #65, #62 ## Parent - [#3](https://gitea.nessar.fr/nessar/vac-optimizer/issues/3) - [#29](https://gitea.nessar.fr/nessar/vac-optimizer/issues/29) ## What to build The statistics popup shows average and longest working stretches, average and longest complete breaks, and non-working-day gain, using the calculated plan's shared calendar semantics. 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 [#7](https://gitea.nessar.fr/nessar/vac-optimizer/issues/7). The existing longest work-sequence metric from #28 is reused. Follow the domain glossary and ADRs 0004, 0006, and 0007. ## Acceptance criteria - [ ] Add five labelled metrics: non-working-day gain, average work-sequence length, longest work-sequence length, average time-off period length, and longest time-off period length. Work lengths use working days; break lengths use calendar days. - [ ] The work-sequence average includes every non-empty sequence inside the submitted horizon, including both edges. Weekends and French public holidays neither count nor split a sequence; leave placements and declared non-working days interrupt it. Consecutive days off introduce no zero-length samples. - [ ] Sequences of 10, 5, and 15 working days produce an average of 10 and a longest length of 15. Fractional averages remain representable and calculations do not prematurely round the underlying values. - [ ] Break statistics use full canonical time-off periods, including merged declarations and placements and contiguous non-working dates immediately outside the horizon. Friday and Monday off around a holiday-free weekend produce one 4-calendar-day period. A declared Friday with no new placements produces a 3-day Friday–Sunday period. - [ ] Non-working-day gain counts distinct weekend and public-holiday dates in these periods. A weekend public holiday contributes once; a declared day does not itself become additional weekend or holiday gain. - [ ] Saved declarations outside the horizon do not inflate in-horizon work counts or create isolated out-of-horizon periods. Adjacent declarations may extend a period anchored inside the horizon under the shared calendar contract. - [ ] Empty samples remain distinguishable from measured zero. A valid plan without work sequences retains a longest work-sequence length of 0; missing average samples and a missing longest time-off period retain an explicit empty data state. - [ ] All five figures inherit the popup's snapshot, trace independence, and partial-plan behavior. Any new outcome facts survive direct planning, worker transport, and retained-plan checkpoints and describe the actual displayed plan. - [ ] Behavior tests cover fractional means, both horizon edges, contiguous days off, intervening weekends and holidays, declarations without new placements, merged periods, adjacent context dates, and empty samples. Check rendered units and values, complete and retained partial outcomes, and the repository's existing tests, lint, formatting, type checks, and production build. Reuse #62's calendar and period definitions rather than adding a conflicting calendar model. These descriptive metrics do not change the planning objective order. Proposed presentation default, not explicitly confirmed: show "—" for an average without samples and for the longest time-off period when none exists. Decimal precision follows existing presentation conventions; it does not change the underlying metric. ## Blocked by - [#65 — Open plan statistics for calculated leave usage](https://gitlab.nessar.fr/nessar/vac-optimizer/-/work_items/65). - [#62 — Optimiser les périodes de repos autour des jours déclarés](https://gitea.nessar.fr/nessar/vac-optimizer/issues/62), which establishes time-off periods and work sequences that include declared non-working days.
nessar commented 2026-10-07 00:24:22 +02:00 (Migrated from 172.24.0.1:8928)

mentioned in issue #68

mentioned in issue #68
nessar commented 2026-10-07 00:25:38 +02:00 (Migrated from 172.24.0.1:8928)

mentioned in issue #7

mentioned in issue #7
nessar commented 2026-10-07 00:25:44 +02:00 (Migrated from 172.24.0.1:8928)

mentioned in issue #29

mentioned in issue #29
admin-backup commented 2026-10-07 23:16:32 +02:00 (Migrated from 172.24.0.1:8928)

mentioned in commit 3fbf9c3172

mentioned in commit 3fbf9c317270b72772316761860620fdb1a0f8f8
nessar (Migrated from 172.24.0.1:8928) closed this issue 2026-10-08 21:09:28 +02:00

Preserved GitLab #66 history: source attribution, exact timestamps, discussion grouping and review positions. Historical diff snapshots: 0; visible source notes: 4.

gitlab-35-issue-66.md (SHA-256 a70c51b4bddae9a8ce38f2c1daee57bf9be8f170b071964764100349dac83876)

gitlab-35-issue-66.json (SHA-256 45555123bda2ee8f5abe655b67d5b249bf3aef68df1ef8b3cade9ad8e0f3e10b)

Old CI job execution and reports are omitted. Original source files and rollback backups remain protected.

<!-- gitlab-to-gitea-history:35:Issue:66 --> Preserved GitLab #66 history: source attribution, exact timestamps, discussion grouping and review positions. Historical diff snapshots: 0; visible source notes: 4. [gitlab-35-issue-66.md](https://gitea.nessar.fr/attachments/3f28ce56-57c6-4e06-879c-cad326a5b164) (SHA-256 `a70c51b4bddae9a8ce38f2c1daee57bf9be8f170b071964764100349dac83876`) [gitlab-35-issue-66.json](https://gitea.nessar.fr/attachments/e2bf7009-9454-40a3-a0cc-d3b2c8e8b08a) (SHA-256 `45555123bda2ee8f5abe655b67d5b249bf3aef68df1ef8b3cade9ad8e0f3e10b`) Old CI job execution and reports are omitted. Original source files and rollback backups remain protected.
gitea-emergency added this to the Development project 2026-10-11 22:14:31 +02:00
gitea-emergency moved this to Closed in Development on 2026-10-11 22:14:31 +02:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: nessar/vac-optimizer#66