Files
kontor/kontor-api/src/schema/comics/volume.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

26 lines
609 B
Python

from datetime import datetime
from pydantic import BaseModel
from src.db.models.comic import Volume
class VolumeResponse(BaseModel):
id: str
created_date: datetime
last_modified_date: datetime
version: int
name: str
comic_id: str
def volume_to_response(volume: Volume) -> VolumeResponse:
response: VolumeResponse = VolumeResponse(
id=volume.id,
created_date=volume.created_date,
last_modified_date=volume.last_modified_date,
version=volume.version,
name=str(volume.name),
comic_id=str(volume.comic_id)
)
return response