3.7 KiB
3.7 KiB
03 — Show gross earned leave by generating rule
What to build: The statistics popup shows all leave earned by the calculated plan before consumption, with a breakdown by the rules that generated it, including entitlements that were fully used.
Blocked by:
- 01 — Open plan statistics for calculated leave usage.
- #64 — Appliquer les motifs IF_THEN et les droits acquis aux jours déclarés, which establishes finalized earned entitlements and the fixed Europe/Paris calculation-date cutoff.
Status: ready-for-agent
GitLab: #67
Source: the agreed Plan Statistics Popup spec for #3 and #29, including #8. Follow the domain glossary and ADRs 0004, 0006, and 0007.
- Display gross earned leave from every applicable generating rule, including Samedi Malin, with a per-rule breakdown whose quantities sum to the total.
- A plan earning 3 days and consuming 2 reports 3 earned days. Fully consumed earned entitlements remain included even when absent from remaining balances; generating a future entitlement does not require consuming it inside the horizon.
- Repeated satisfied occurrences contribute their generated quantities once per generating rule and occurrence. Distinct rules retain separate attribution even when their names match or they share contributing dates. Occurrences satisfied by declarations, placements, or both use the finalized entitlement semantics from #64.
- Include only entitlements becoming available strictly after the producing calculation's captured Europe/Paris calendar date. Availability before or on that date is excluded; availability after the planning horizon is included. Use the finalized availability after the complete generating time-off period, including later period extensions.
- Only entitlements generated by the final or retained valid plan contribute. Rejected candidates, abandoned branches, provisional earnings, and hypothetical alternatives cannot inflate the total.
- Rule labels come from the producing calculation's immutable rule names and attribution. Renaming or deleting pending rules, changing balances, or crossing a calendar-date boundary after calculation does not change this result.
- Carry reliable gross quantities and generating-rule attribution with complete outcomes and retained partial plans through direct planning, worker delivery, and cancellation checkpoints. Reuse #64's captured calculation date; do not recapture it on opening the popup, reconstruct earnings from remaining balances or trace history, or infer attribution by parsing balance identifiers.
- A valid plan with no qualifying earnings shows a total of 0. Trace readiness and failure do not gate the total or breakdown, and partial plans retain their prominent label.
- Fixed-clock behavior tests verify partial and full consumption, multiple rules and repeated occurrences, shared contributing dates, availability before/on/after the reference date and beyond the horizon, period extensions, original rule names, and cancellation retaining a different state from the latest candidate. Assert the rendered total and breakdown through the direct and worker paths and run the repository's existing tests, lint, formatting, type checks, and production build.
Presentation proposal, not an agreed requirement: show contributing rules only, omitting zero-earning rows. The total and all positive contributions are required regardless of that display choice.