Files
F-r-ldraledigplannerare/backend/app/entities/vacation_days.py
T
2026-06-01 16:48:21 +02:00

30 lines
896 B
Python

"""Domain entity: VacationDays.
This is the REFERENCE entity — copy this shape for the other entities
(parental_leave, planned_leave, child, break_period, ...). A domain entity is a
plain dataclass with no framework or persistence concerns.
"""
from dataclasses import dataclass
from datetime import datetime
from uuid import UUID
@dataclass
class VacationDays:
"""Manual vacation (semester) entry per parent per year.
Swedish semester is typically 25 statutory days/year; days above 20 may be
saved up to 5 years. `saved_days_in` carries those over so the tips engine
can warn before they expire.
"""
id: UUID
personal_data_uuid: UUID
workspace_id: UUID
year: int
total_days: int # entitlement for this year
saved_days_in: int = 0 # carried over from prior years
created_at: datetime | None = None
updated_at: datetime | None = None