Spaces:
Running
Running
| from typing import Literal, Optional | |
| from pydantic import BaseModel, Field | |
| from datetime import datetime, date | |
| import uuid | |
| class PlannedSession(BaseModel): | |
| """ | |
| Represents a planned running session for a specific week. | |
| Goal-informed and editable. | |
| """ | |
| id: uuid.UUID = Field(default_factory=uuid.uuid4) | |
| runner_id: uuid.UUID | |
| week_start_date: date | |
| session_type: Literal["weekday", "long_run"] | |
| planned_date: date | |
| target_distance_km: float | |
| completed_run_id: Optional[str] = None | |
| created_at: datetime = Field(default_factory=datetime.now) | |
| class Config: | |
| frozen = False # Allow mutation for completed_run_id | |