Files
scenar-creator/app/models/event.py
Daneel 25fd578543
Some checks failed
Build & Push Docker / build (push) Has been cancelled
feat: v3.0 - canvas editor, JSON-only, no Excel, new UI
- Remove all Excel code (import, export, template, pandas, openpyxl)
- New canvas-based schedule editor with drag & drop (interact.js)
- Modern 3-panel UI: sidebar, canvas, documentation tab
- New data model: Block with id/date/start/end, ProgramType with id/name/color
- Clean API: GET /api/health, POST /api/validate, GET /api/sample, POST /api/generate-pdf
- Rewritten PDF generator using ScenarioDocument directly (no DataFrame)
- Professional PDF output: dark header, colored blocks, merged cells, legend, footer
- Sample JSON: "Zimní výjezd oddílu" with 11 blocks, 3 program types
- 30 tests passing (API, core models, PDF generation)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-20 17:02:51 +01:00

38 lines
781 B
Python

"""Pydantic v2 models for Scenar Creator v3."""
import uuid
from typing import List, Optional
from pydantic import BaseModel, Field
class Block(BaseModel):
id: str = Field(default_factory=lambda: str(uuid.uuid4()))
date: str # "YYYY-MM-DD"
start: str # "HH:MM"
end: str # "HH:MM"
title: str
type_id: str
responsible: Optional[str] = None
notes: Optional[str] = None
class ProgramType(BaseModel):
id: str
name: str
color: str # "#RRGGBB"
class EventInfo(BaseModel):
title: str
subtitle: Optional[str] = None
date: Optional[str] = None
location: Optional[str] = None
class ScenarioDocument(BaseModel):
version: str = "1.0"
event: EventInfo
program_types: List[ProgramType]
blocks: List[Block]