Files
kontor/kontor-api/src/schema/tysc/fieldposition.py
T
tpeetz d5705c3a28
Gitea Actions Demo / Explore-Gitea-Actions (push) Successful in 4s
move kontor_model in kontor-api (#98)
Co-authored-by: Thomas Peetz <thomas.peetz@cimt-ag.de>
Reviewed-on: #98
2026-10-15 23:14:16 +00:00

29 lines
763 B
Python

from datetime import datetime
from pydantic import BaseModel
from src.db.models.tysc import FieldPosition
class FieldPositionResponse(BaseModel):
id: str
created_date: datetime
last_modified_date: datetime
version: int
name: str
short_name: str
sport_id: str
def to_response(fieldposition: FieldPosition) -> FieldPositionResponse:
response: FieldPositionResponse = FieldPositionResponse(
id=fieldposition.id,
created_date=fieldposition.created_date,
last_modified_date=fieldposition.last_modified_date,
version=fieldposition.version,
name=str(fieldposition.name),
short_name=str(fieldposition.short_name),
sport_id=str(fieldposition.sport_id)
)
return response