"""Domain entity: PlannedLeaveDay (a single calendar day of planned leave).""" from dataclasses import dataclass from datetime import date, datetime from uuid import UUID @dataclass class PlannedLeaveDay: """A single derived/persisted calendar day of planned leave. Restructure step 3b: this row is now purely derived output — "is this day pinned/immovable" is no longer one of its own columns. That fact lives in `DayAssertion` (see `app/entities/day_assertion.py`) instead, keyed by (workspace, child, parent, date); the allocator (`_Ledger`) consults `AllocationInput.pinned_days` (built from assertions), never a field on this class. `PlanningService`'s read paths (`get`/`list_*`) still annotate a display-only `is_pinned` onto the response for the calendar UI (which needs to render a lock icon) — see `PlanningService._annotate_pinned` — but that is done explicitly at the read boundary, not carried by this entity nor by any DB column (migration 010 drops it). """ id: UUID workspace_id: UUID child_id: UUID parent_personal_data_uuid: UUID date: date day_type: str # 'sjukpenning' | 'lagsta' | 'vacation' is_dubbeldag: bool = False # True → counts against the 60-day dubbeldagar quota # Which `LeaveWish` produced this day (nullable: ad-hoc/legacy/unattributable # days have none). Lets the UI click a multi-day band on a calendar and edit # it as one period instead of one day at a time. wish_id: UUID | None = None created_at: datetime | None = None updated_at: datetime | None = None