add missing endpoints
This commit is contained in:
@@ -0,0 +1,28 @@
|
||||
from datetime import datetime
|
||||
|
||||
from pydantic import BaseModel
|
||||
|
||||
from src.db.models.tysc import Team
|
||||
|
||||
|
||||
class TeamResponse(BaseModel):
|
||||
id: str
|
||||
created_date: datetime
|
||||
last_modified_date: datetime
|
||||
version: int
|
||||
name: str
|
||||
short_name: str
|
||||
sport_id: str
|
||||
|
||||
|
||||
def to_response(team: Team) -> TeamResponse:
|
||||
response: TeamResponse = TeamResponse(
|
||||
id=team.id,
|
||||
created_date=team.created_date,
|
||||
last_modified_date=team.last_modified_date,
|
||||
version=team.version,
|
||||
name=team.name,
|
||||
short_name=team.short_name,
|
||||
sport_id=team.sport_id
|
||||
)
|
||||
return response
|
||||
Reference in New Issue
Block a user