feat(validation): complete validation editor and master data modules

This commit is contained in:
Schubert Ferenc 2026-07-10 22:42:03 +02:00
parent 2b5c765e41
commit f73a24df13
73 changed files with 10194 additions and 0 deletions

View file

@ -0,0 +1,19 @@
from __future__ import annotations
import csv
from dataclasses import dataclass
from pathlib import Path
@dataclass(frozen=True)
class MeasurementSeries:
headers: list[str]
rows: list[dict[str, str]]
class HeliosImportService:
def import_csv(self, path: Path) -> MeasurementSeries:
with path.open(newline="", encoding="utf-8-sig") as handle:
reader = csv.DictReader(handle)
return MeasurementSeries(headers=reader.fieldnames or [], rows=list(reader))

View file

@ -0,0 +1,30 @@
from __future__ import annotations
from pathlib import Path
from weasyprint import HTML
class OrionReportService:
chapters = [
"Deckblatt",
"Inhaltsverzeichnis",
"Zusammenfassung",
"Gerät",
"Kunde",
"Normen",
"Prüfmittel",
"Programme",
"Beladung",
"Messungen",
"Diagramme",
"Empfehlungen",
"Anlagen",
]
def render_pdf(self, title: str, output_path: Path) -> Path:
chapter_markup = "".join(f"<section><h2>{chapter}</h2></section>" for chapter in self.chapters)
html = f"<html><body><h1>{title}</h1>{chapter_markup}</body></html>"
HTML(string=html).write_pdf(output_path)
return output_path