Rework balances around per-parent days left and deduce the partner from FK

Manual entry now takes one parent's sjukpenningnivå, lägstanivå and
dubbeldagar left (plus optional reserved days) and derives the rest in
build_snapshot, shared with the scraper. The scraper also reads the
family panel and exposes a partner deduction; with two parents it is
saved as a 'deduced' snapshot (migration 002). Parent count is the single
source of entitlement: one member gets 480 days and 96 savable at age 4,
two get 240 and 48 each. Workspaces are capped at two parents.

Also lands the in-flight squash of migrations 002–011 into the initial
schema and the removal of planning_mode.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
2026-09-19 12:27:29 +02:00
parent 375bc64f2f
commit e4719cb9ae
71 changed files with 5705 additions and 1859 deletions
+2 -2
View File
@@ -257,7 +257,6 @@ def get_tips_service(
pd_repo: PersonalDataRepositoryDep,
vacation_repo: VacationDaysRepositoryDep,
leave_wish_repo: LeaveWishRepositoryDep,
ws_repo: WorkspaceRepositoryDep,
dismissal_repo: TipDismissalRepositoryDep,
) -> TipsService:
return TipsService(
@@ -267,7 +266,6 @@ def get_tips_service(
pd_repo,
vacation_repo,
leave_wish_repo,
ws_repo,
dismissal_repo,
)
@@ -367,6 +365,7 @@ def get_planning_service(
parental_leave_repo: ParentalLeaveRepositoryDep,
vacation_repo: VacationDaysRepositoryDep,
planning_engine_service: PlanningEngineServiceDep,
leave_wish_repo: LeaveWishRepositoryDep,
uow: UnitOfWorkDep,
) -> PlanningService:
return PlanningService(
@@ -375,6 +374,7 @@ def get_planning_service(
parental_leave_repo,
vacation_repo,
planning_engine_service,
leave_wish_repo=leave_wish_repo,
uow=uow,
)