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:
@@ -0,0 +1,37 @@
|
||||
"""Postgres stub for PreschoolPlanningDaysRepository.
|
||||
|
||||
Implement when switching to Postgres (install asyncpg via `uv sync --extra postgres`).
|
||||
All methods raise NotImplementedError until then.
|
||||
"""
|
||||
|
||||
from uuid import UUID
|
||||
|
||||
from app.entities.preschool_planning_days import PreschoolPlanningDays
|
||||
from app.repositories.filter_validator import validate_filters
|
||||
from app.repositories.preschool_planning_days_repository import (
|
||||
PreschoolPlanningDaysRepository,
|
||||
)
|
||||
|
||||
|
||||
class PostgresPreschoolPlanningDaysRepository(PreschoolPlanningDaysRepository):
|
||||
def __init__(self, connection: object) -> None:
|
||||
self._conn = connection
|
||||
|
||||
async def create(self, item: PreschoolPlanningDays) -> PreschoolPlanningDays:
|
||||
raise NotImplementedError("Postgres repo not yet implemented")
|
||||
|
||||
async def get_by_id(self, id: UUID) -> PreschoolPlanningDays | None:
|
||||
raise NotImplementedError("Postgres repo not yet implemented")
|
||||
|
||||
async def update(self, id: UUID, item: PreschoolPlanningDays) -> PreschoolPlanningDays:
|
||||
raise NotImplementedError("Postgres repo not yet implemented")
|
||||
|
||||
async def delete(self, id: UUID) -> None:
|
||||
raise NotImplementedError("Postgres repo not yet implemented")
|
||||
|
||||
async def list(self, **filters: object) -> list[PreschoolPlanningDays]:
|
||||
validate_filters(filters, {"child_id", "year"})
|
||||
raise NotImplementedError("Postgres repo not yet implemented")
|
||||
|
||||
async def get_by_child_year(self, child_id: UUID, year: int) -> PreschoolPlanningDays | None:
|
||||
raise NotImplementedError("Postgres repo not yet implemented")
|
||||
Reference in New Issue
Block a user