feat: refactor to FastAPI architecture v2.0
Some checks failed
Build & Push Docker / build (push) Has been cancelled

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-02-20 16:28:21 +01:00
parent 87f1fc2c7a
commit e2bdadd0ce
32 changed files with 2896 additions and 55 deletions

3
app/models/__init__.py Normal file
View File

@@ -0,0 +1,3 @@
from .event import Block, ProgramType, EventInfo, ScenarioDocument
__all__ = ["Block", "ProgramType", "EventInfo", "ScenarioDocument"]

34
app/models/event.py Normal file
View File

@@ -0,0 +1,34 @@
"""Pydantic v2 models for Scenar Creator."""
from datetime import date, time
from typing import List, Optional
from pydantic import BaseModel, Field
class Block(BaseModel):
datum: date
zacatek: time
konec: time
program: str
typ: str
garant: Optional[str] = None
poznamka: Optional[str] = None
class ProgramType(BaseModel):
code: str
description: str
color: str # hex #RRGGBB
class EventInfo(BaseModel):
title: str = Field(..., max_length=200)
detail: str = Field(..., max_length=500)
class ScenarioDocument(BaseModel):
version: str = "1.0"
event: EventInfo
program_types: List[ProgramType]
blocks: List[Block]

22
app/models/responses.py Normal file
View File

@@ -0,0 +1,22 @@
"""API response models."""
from typing import Any, List, Optional
from pydantic import BaseModel
class HealthResponse(BaseModel):
status: str = "ok"
version: str
class ValidationResponse(BaseModel):
valid: bool
errors: List[str] = []
class ImportExcelResponse(BaseModel):
success: bool
document: Optional[Any] = None
errors: List[str] = []
warnings: List[str] = []