No description
Find a file
rene 297bd22f96 Bündel 2: Zentrale Helper für DRY-Cleanup, SW by-v1114
NEUE BACKEND-MODULE:

math_utils.py
- haversine_km(lat1, lon1, lat2, lon2) — Distanz in km
- haversine_m(...) — Convenience-Wrapper in Metern
- bbox_deg_from_km(lat, radius_km) — Bounding-Box-Approximation
  für SQL-Vorfilter (statt Haversine im Python-Loop)

config.py
- DB_PATH, MEDIA_DIR, BREEDER_DOCS_DIR, SCANINPUT_DIR
- API_TIMEOUT_SHORT (5s) / DEFAULT (10s) / LONG (30s)
- HTTP_USER_AGENT, HTTP_HEADERS

errors.py
- not_found(msg), forbidden(msg), bad_request(msg), unauthorized(msg)
- conflict(msg), too_many_requests(msg, retry_after), service_unavailable(msg)
- require_or_404(row, msg) — Convenience-Helper

UI.JS ERWEITERUNGEN:

UI.time erweitert:
- formatDate(d)     → "15.03.2026"
- formatDateTime(d) → "15.03.2026, 14:30"
- weekday(d)        → "Di"
- parseISO(str)     → {year, month, day}

UI.text (neu):
- truncate(str, maxLen, ellipsis='…')
- slug(str) — URL-Slug aus String (mit DE-Umlauten)

UI.money (neu):
- format(value) → "12,34 €" (de-DE, EUR)
- formatWithSuffix(value, '/Jahr')

HAVERSINE-MIGRATION (13 Backend-Routen):
alerts.py, services.py, places.py, events.py, diary.py, playdate.py,
lost.py, poison.py, adoption.py, gassi_zeiten.py, sitting.py, routen.py,
walks.py

- Alle lokalen def _haversine/haversine_km entfernt
- Aufrufe ersetzt durch haversine_km/haversine_m je nach Einheit
- from math_utils import haversine_km|haversine_m in jeder Datei

Tests 19/19 grün.

Hinweis: Migrationen für MEDIA_DIR (19 Stellen), API-Timeouts (12),
Date-Formatter im Frontend (24) und UI.text.truncate (5) sind als
Folge-Sprints möglich. Helper sind verfügbar.
2026-05-27 11:19:06 +02:00
backend Bündel 2: Zentrale Helper für DRY-Cleanup, SW by-v1114 2026-05-27 11:19:06 +02:00
diary Sprint 15: Suche, Ausweis, Teilen, Widget 2026-04-17 15:51:09 +02:00
promotion Dateien nach „promotion“ hochladen 2026-04-28 08:32:31 +02:00
reports Reports 2026-05-01 — Quartalsbericht 2026-05-01 08:07:41 +02:00
scripts Feature: Generische Seiten-Hilfe (UI.pageInfo), POI Multi-Select, Tagessprüche-DB (SW by-v654) 2026-05-03 20:10:01 +02:00
tests Big Sweep: Security + Race-Conditions + Tests + DSGVO + A11y, SW by-v1095 2026-05-26 20:12:01 +02:00
.env.example ki: Port 11435, Modell gemma-4-31b-it (LM Studio 0.4.x) 2026-04-24 18:15:32 +02:00
.gitignore Security: Play Store Paket aus Git entfernen (signing.keystore nicht eincheckbar) 2026-05-09 18:10:13 +02:00
docker-compose.staging.yml Fix: Storno sendet PDF+Mail+Scaninput; /scaninput Volume in staging ergänzt 2026-05-15 11:18:48 +02:00
docker-compose.yml Feature: Rechnungs-System (invoices) — Backend komplett 2026-05-15 10:04:23 +02:00
Dockerfile Fix: VERSION-Datei ins Docker-Image kopieren, SW by-v1096 2026-05-26 20:13:35 +02:00
Makefile Security: CSP gehärtet — unsafe-inline + unsafe-eval raus, SW by-v1100 2026-05-27 06:23:47 +02:00
PROJEKT.md Doku: Sprint 16 komplett — Phone-Frame, Screenshots, UX-Fixes 2026-04-27 19:44:26 +02:00
pytest.ini Big Sweep: Security + Race-Conditions + Tests + DSGVO + A11y, SW by-v1095 2026-05-26 20:12:01 +02:00
VERSION Bündel 2: Zentrale Helper für DRY-Cleanup, SW by-v1114 2026-05-27 11:19:06 +02:00