move kontor_model in kontor-api

This commit is contained in:
Thomas Peetz
2026-10-15 19:10:32 +02:00
parent 2e80cd9b0e
commit 7cc2784bdb
69 changed files with 3974 additions and 730 deletions
+30
View File
@@ -0,0 +1,30 @@
from datetime import datetime
from typing import Optional
from pydantic import BaseModel
from src.db.models.comic import Publisher
class PublisherResponse(BaseModel):
id: str
created_date: datetime
last_modified_date: datetime
version: int
name: str
weblink: Optional[str]
parent_publisher_id: Optional[str]
def publisher_to_response(publisher: Publisher) -> PublisherResponse:
response: PublisherResponse = PublisherResponse(
id=publisher.id,
created_date=publisher.created_date,
last_modified_date=publisher.last_modified_date,
version=publisher.version,
name=str(publisher.name),
weblink=str(publisher.weblink),
parent_publisher_id=publisher.parent_publisher_id
)
return response