
from datetime import datetime
from pydantic import BaseModel

from src.db.models.tysc import Sport


class SportResponse(BaseModel):
    id: str
    created_date: datetime
    last_modified_date: datetime
    version: int
    name: str


def to_response(sport: Sport) -> SportResponse:
    response: SportResponse = SportResponse(
        id=sport.id,
        created_date=sport.created_date,
        last_modified_date=sport.last_modified_date,
        version=sport.version,
        name=sport.name
    )
    return response
