from datetime import datetime from typing import Literal from uuid import UUID from pydantic import Field from app.common.schemas import RequestModel, ResponseModel class TeamOut(ResponseModel): """The team shape every endpoint returns (GET /me, team create, lookup and join).""" id: UUID code: str name: str coach_id: UUID coach_name: str coaching: str created_at: datetime class TeamCreate(RequestModel): name: str = Field(min_length=2, max_length=60) coach_name: str = Field(min_length=2, max_length=60) coaching: Literal["h", "p", "both"] class TeamResponse(ResponseModel): team: TeamOut class TeamSummaryOut(ResponseModel): """What a player sees before joining: no ids.""" code: str name: str coach_name: str coaching: str class TeamSummaryResponse(ResponseModel): team: TeamSummaryOut