Task 4: Implementiert parseSchadenUploads() zur Extraktion von indizierten
Schadensfoto-Feldern aus FormData. Unterstützt:
- Parsing von 'foto_schaden_<i>' und 'foto_schaden_<i>_beschreibung'
- Sortierung nach Index
- Nulling von leeren/Whitespace-Beschreibungen
- Ignorieren von Zeilen ohne Foto (auch wenn Beschreibung vorhanden)
Alle 6 Testfälle bestanden (TDD: RED -> GREEN).
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
createAuftrag interpretierte den datetime-local-Wert bisher mit new
Date(zeitpunktRaw), was in Node die Zeitzone des ausfuehrenden Prozesses
annimmt. Im produktiven Docker-Container (kein TZ gesetzt, laeuft in
UTC) fuehrte das zu einer stillen Zeitverschiebung: 15:00 Uhr Eingabe
wurde als 15:00 UTC statt 15:00 Europe/Berlin gespeichert und beim
Anzeigen faelschlich als 17:00 Uhr zurueckformatiert.
parseZeitplanungZeitpunkt() in zeitplanung.ts ermittelt den
Europe/Berlin-UTC-Offset fuer den gegebenen Zeitpunkt ueber
Intl.DateTimeFormat (unabhaengig von der Prozess-Zeitzone) und
interpretiert die Eingabe explizit als Berliner Wanduhrzeit.
createAuftrag nutzt jetzt diese Funktion statt new Date() direkt.
Neue Tests decken Sommer-/Winterzeit sowie den Round-Trip ueber
formatZeitplanung ab und wurden unter TZ=UTC, TZ=Europe/Berlin und
TZ=America/New_York identisch bestanden.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HCHRPWuV3bd37NJhW2NK6P
- Add fotos.ts: loadAuftragFotos query function and sortiereUndBeschrifteFotos utility
- Add fotos.test.ts: 6 unit tests for sorting/labeling logic
- Update vitest.config.ts: add path alias resolution for @/ imports
Task 5 of the standorte-fahrzeuge-tabellen plan: point the nav at the
new /standorte and /fahrzeuge routes built in tasks 1-4, and remove the
now-dead old combined /stammdaten page and its now-unreferenced
loadOrt/loadFahrzeug query helpers.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HCHRPWuV3bd37NJhW2NK6P
Page and CSV export now both render shift timestamps in Europe/Berlin
consistently (previously CSV used UTC, page used server-local time,
causing the same shift to show different clock times in each place).
Also adds a partial unique index so two near-simultaneous Kommen
requests for the same fahrer can no longer create two open shifts --
the existing app-layer check was check-then-act with no DB backstop.
Fields starting with =, +, -, @, tab, or CR are now neutralized with a
leading single quote before quoting, closing a CSV/spreadsheet formula
injection gap (CWE-1236) flagged by automated security review. Also
closes a bare-CR gap in the RFC 4180 escape trigger set.
Adds fahrtBeenden (unterwegs -> abgeschlossen with end_km validation)
and stornieren (any non-terminal status -> storniert) Server Actions,
plus findeFolgeauftrag to surface a linked follow-up order on the
detail page once an order is abgeschlossen.
kannStornieren uses a local admin/disponent role check rather than
canManageUsers, since the latter is scoped to user management and
would incorrectly hide the storno action from disponents.
Adds graceful degradation for environments that don't have SUPABASE_INTERNAL_URL
configured. Uses nullish coalescing to fall back to NEXT_PUBLIC_SUPABASE_URL if
the new internal URL variable is unset, maintaining backward compatibility while
preserving the Docker-specific optimization.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>