from pydantic import BaseModel


class KosyncProgressUpdate(BaseModel):
    """Schema for uploading progress from KOReader."""

    document: str
    progress: str | None = None
    percentage: float
    device: str | None = None
    device_id: str | None = None


class KosyncProgressRead(BaseModel):
    """Schema for reading progress to KOReader."""

    document: str
    progress: str | None = None
    percentage: float | None = None
    device: str | None = None
    device_id: str | None = None


class KosyncDeviceRead(BaseModel):
    """Schema for reading device information."""

    id: int
    user_id: int
    api_key: str
    name: str


class KosyncDeviceCreate(BaseModel):
    """Schema for creating a new device."""

    name: str
