Erstumsetzung: OAMC Turnierauswertung (AP 0–7, 9)

* Datenmodell + Alembic-Initialmigration (Plan §4), Seed Saison 2026
* Wertungs-Engine (Plan §3.3), regelbasiert je Kategorie/Saison
  - Abnahmetest gegen die Ergebnisliste 2026-05-31
* Meisterschaftsberechnung mit Streichresultaten + Tie-Break
  (PLATZHALTER-Punktetabelle, O-1 offen)
* Ingest-API (idempotent, dry_run) inkl. Excel-Leser und Fahrer-Matching/Merge
* Zeitmessungs-Endpoint (Batch, idempotent, unzugeordnet/unplausibel) + SSE-Anzeige
  - Mess-Pi-Client bewusst NICHT enthalten (docs/zeitmessung-endpoint.md)
* Frontend: öffentliche Seiten + internes Backend (Jinja2/HTMX, kein Build)
* Auslieferung: Docker (multi-arch) + docker-compose sowie Debian-Paket/APT-Repo
* 57 Tests grün gegen echte PostgreSQL-Testdatenbank

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
linus
2026-09-05 18:49:00 +02:00
co-authored by Claude Sonnet 5
commit 03f6fdb0d9
115 changed files with 8041 additions and 0 deletions
+30
View File
@@ -0,0 +1,30 @@
#!/bin/sh
# Wartet auf die DB, spielt Migrationen ein, optional Seed, startet dann das CMD.
set -eu
echo "[entrypoint] warte auf Datenbank ..."
python - <<'PY'
import os, time, sys
import psycopg
url = os.environ.get("OAMC_DATABASE_URL", "")
dsn = url.replace("postgresql+psycopg://", "postgresql://", 1)
for i in range(60):
try:
psycopg.connect(dsn, connect_timeout=3).close()
print("[entrypoint] DB erreichbar")
sys.exit(0)
except Exception as e: # noqa
print(f"[entrypoint] ({i+1}/60) noch nicht bereit: {e}")
time.sleep(2)
sys.exit("[entrypoint] DB nicht erreichbar")
PY
echo "[entrypoint] alembic upgrade head"
alembic upgrade head
if [ "${OAMC_SEED_ON_START:-0}" = "1" ]; then
echo "[entrypoint] Seed Saison 2026 (idempotent)"
oamc-turnier seed || echo "[entrypoint] Seed uebersprungen/fehlgeschlagen"
fi
exec "$@"