Let a day removed from a period stay removed

Taking one day out of a period the planner placed did nothing that
lasted: the period still asked for a full week, so the next sync put the
day straight back. The option was disabled rather than lying about it.

A removed day is now recorded as its own thing — no leave for this
parent, this child, this date — and the planner honours it on every
later sync. It is kept apart from the working-day overrides, which
answer a different question about the calendar rather than about the
plan.

The day belongs to the parent whose band was clicked, so removing one
parent's day leaves their partner's alone; where both parents were to be
off on one funding arrangement, the partner is simply funded on their
own instead. A removed day shortens what the period is asking for rather
than counting as a day the plan failed to find, so the advice about
closing a shortfall does not start arguing for a day nobody wants.

Nothing is removed without a way back: the toast undoes it, and the day
itself is marked in the calendar and offers to restore.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Ei7gCZzdd751uZtPzb1Pep
This commit is contained in:
2026-09-19 16:05:17 +02:00
parent 6d92b87bf3
commit 8cfb9c82c6
39 changed files with 2362 additions and 31 deletions
+26
View File
@@ -27,6 +27,9 @@ from app.repositories_impl.sqlite.day_override_repository import SQLiteDayOverri
from app.repositories_impl.sqlite.leave_wish_repository import SQLiteLeaveWishRepository
from app.repositories_impl.sqlite.parental_leave_repository import SQLiteParentalLeaveRepository
from app.repositories_impl.sqlite.personal_data_repository import SQLitePersonalDataRepository
from app.repositories_impl.sqlite.planned_day_exclusion_repository import (
SQLitePlannedDayExclusionRepository,
)
from app.repositories_impl.sqlite.planned_leave_repository import SQLitePlannedLeaveRepository
from app.repositories_impl.sqlite.tip_dismissal_repository import SQLiteTipDismissalRepository
from app.repositories_impl.sqlite.unit_of_work import SQLiteUnitOfWork
@@ -44,6 +47,7 @@ from app.services.auth_service import AuthService
from app.services.child_service import ChildService
from app.services.day_override_service import DayOverrideService
from app.services.leave_wish_service import LeaveWishService
from app.services.planned_day_exclusion_service import PlannedDayExclusionService
from app.services.planning_service import PlanningService
from app.services.tips_service import TipsService
from app.services.vacation_days_service import VacationDaysService
@@ -299,6 +303,26 @@ async def day_override_service(
return DayOverrideService(day_override_repo)
# ---------------------------------------------------------------------------
# PlannedDayExclusion (user-removed days — see app/entities/planned_day_exclusion.py)
# ---------------------------------------------------------------------------
@pytest_asyncio.fixture
async def planned_day_exclusion_repo(
connection: aiosqlite.Connection,
) -> SQLitePlannedDayExclusionRepository:
return SQLitePlannedDayExclusionRepository(connection)
@pytest_asyncio.fixture
async def planned_day_exclusion_service(
planned_day_exclusion_repo: SQLitePlannedDayExclusionRepository,
planned_leave_repo: SQLitePlannedLeaveRepository,
) -> PlannedDayExclusionService:
return PlannedDayExclusionService(planned_day_exclusion_repo, planned_leave_repo)
@pytest_asyncio.fixture
async def child_service(
child_repo: SQLiteChildRepository,
@@ -329,6 +353,7 @@ async def allocation_input_loader(
planned_leave_repo: SQLitePlannedLeaveRepository,
leave_wish_repo: SQLiteLeaveWishRepository,
day_override_repo: SQLiteDayOverrideRepository,
planned_day_exclusion_repo: SQLitePlannedDayExclusionRepository,
) -> AllocationInputLoader:
return AllocationInputLoader(
workspace_repo=workspace_repo,
@@ -339,6 +364,7 @@ async def allocation_input_loader(
planned_leave_repo=planned_leave_repo,
leave_wish_repo=leave_wish_repo,
day_override_repo=day_override_repo,
exclusion_repo=planned_day_exclusion_repo,
)