from datetime import date
from uuid import UUID

from pydantic import BaseModel


class RiderCreate(BaseModel):
    name: str
    ftp: float | None = None
    lthr: int | None = None
    weight: float | None = None
    goals: str | None = None
    experience_level: str | None = None


class RiderUpdate(BaseModel):
    name: str | None = None
    ftp: float | None = None
    lthr: int | None = None
    weight: float | None = None
    zones_config: dict | None = None
    goals: str | None = None
    experience_level: str | None = None


class FitnessHistoryResponse(BaseModel):
    model_config = {"from_attributes": True}

    date: date
    ctl: float
    atl: float
    tsb: float
    ramp_rate: float | None = None


class RiderResponse(BaseModel):
    model_config = {"from_attributes": True}

    id: UUID
    telegram_id: int | None = None
    telegram_username: str | None = None
    avatar_url: str | None = None
    name: str
    ftp: float | None = None
    lthr: int | None = None
    weight: float | None = None
    zones_config: dict | None = None
    goals: str | None = None
    experience_level: str | None = None
    coaching_profile: dict | None = None
    onboarding_completed: bool = False
