Let vacation years go back to the child's birth year

Settings only offered vacation-day rows from the current year forward,
while analytics ran its balance series from the child's birth year. Every
year in the gap had no vacation_days row, so the series assumed a full
statutory 25 earned with no use and banked earned - floor of it forward —
phantom saved days the user had no row to correct.

Settings now offers editable rows back to the birth year, and a past year
with no row assumes only the floor was earned, so it banks nothing. A past
year the user did enter is untouched by that rule.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
2026-09-22 20:49:56 +02:00
parent 06592df87c
commit 1a02bdcdbf
12 changed files with 248 additions and 33 deletions
+9 -2
View File
@@ -77,11 +77,18 @@ class TestGetOverviewYearBalances:
"expiring_age",
"expiring_over_cap",
}
assert vacation["earned"] == 25 # statutory default — no vacation_days row entered
# `birth` (2025-01-01) is a PAST year relative to "today" in this
# test run — no `vacation_days` row was entered for it, so
# `_vacation_year_series`'s past-year rule applies: `earned` is the
# parent's floor (`PersonalData.min_vacation_days_per_year`, default
# 20), not the statutory default, so a phantom past year can't bank
# `25 - floor` days forward the user never actually saved. See
# `ParentYearBalance`'s docstring.
assert vacation["earned"] == 20
assert vacation["is_assumed"] is True
assert vacation["carried_in"] == 0
assert vacation["planned_use"] == 0
assert vacation["left"] == 25
assert vacation["left"] == 20
parental_leave = birth_year["parental_leave"]
assert set(parental_leave) == {