Track preschool planning days, partner invites and real vacation forfeiture
Three strands of work that grew together across the same settings screen and
API client, so they land as one change.
Per-year preschool planning days ("studiedagar"): new table, repository
(SQLite + Postgres), service, router and migration 007, plus the hooks and
Settings UI to plan and record them per child and year. Allocation now
reserves the recorded figure for a year where one exists and only falls back
to the child-level estimate otherwise, marking that fallback as assumed.
Partner invitations: workspaces issue and list invitations, registration
accepts an invite token to join the inviter's workspace instead of creating a
personal one, and a /join/:token page plus the settings invite panel drive it.
Vacation forfeiture: tips and the dashboard now distinguish days a parent
genuinely loses from days that merely age, so the warning stops firing on
balances that were never at risk.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
@@ -31,6 +31,9 @@ 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.preschool_planning_days_repository import (
|
||||
SQLitePreschoolPlanningDaysRepository,
|
||||
)
|
||||
from app.repositories_impl.sqlite.tip_dismissal_repository import SQLiteTipDismissalRepository
|
||||
from app.repositories_impl.sqlite.unit_of_work import SQLiteUnitOfWork
|
||||
from app.repositories_impl.sqlite.user_repository import SQLiteUserRepository
|
||||
@@ -49,6 +52,7 @@ 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.preschool_planning_days_service import PreschoolPlanningDaysService
|
||||
from app.services.tips_service import TipsService
|
||||
from app.services.vacation_days_service import VacationDaysService
|
||||
from app.services.workspace_service import WorkspaceService
|
||||
@@ -114,8 +118,9 @@ async def auth_service(
|
||||
user_repo: SQLiteUserRepository,
|
||||
personal_data_repo: SQLitePersonalDataRepository,
|
||||
workspace_repo: SQLiteWorkspaceRepository,
|
||||
invitation_repo: SQLiteWorkspaceInvitationRepository,
|
||||
) -> AuthService:
|
||||
return AuthService(user_repo, personal_data_repo, workspace_repo)
|
||||
return AuthService(user_repo, personal_data_repo, workspace_repo, inv_repo=invitation_repo)
|
||||
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
@@ -448,6 +453,20 @@ async def tip_dismissal_repo(
|
||||
return SQLiteTipDismissalRepository(connection)
|
||||
|
||||
|
||||
@pytest_asyncio.fixture
|
||||
async def preschool_planning_days_repo(
|
||||
connection: aiosqlite.Connection,
|
||||
) -> SQLitePreschoolPlanningDaysRepository:
|
||||
return SQLitePreschoolPlanningDaysRepository(connection)
|
||||
|
||||
|
||||
@pytest_asyncio.fixture
|
||||
async def preschool_planning_days_service(
|
||||
preschool_planning_days_repo: SQLitePreschoolPlanningDaysRepository,
|
||||
) -> PreschoolPlanningDaysService:
|
||||
return PreschoolPlanningDaysService(preschool_planning_days_repo)
|
||||
|
||||
|
||||
@pytest_asyncio.fixture
|
||||
async def tips_service(
|
||||
parental_leave_repo: SQLiteParentalLeaveRepository,
|
||||
|
||||
Reference in New Issue
Block a user