1
0
Fork 0
Commit Graph

103 Commits

Author SHA1 Message Date
Jonny 4ed9a3bede feat: buildTemplateComponents und sendWhatsAppTemplate (Meta Cloud API) 2026-09-03 17:33:43 +02:00
Jonny 71ea72c9fc feat: getWhatsAppConfig -- WhatsApp-Konfiguration aus env 2026-09-03 17:30:56 +02:00
Jonny 70fb01dfa1 fix: Abschluss-Review -- Status-Guard fahrtBeenden, PDF-Fehlerbehandlung+Format, Fahrer/Startzeit+Datumsformat im PDF, standalone-Deps, Touch-Target, Thumbnail-Caption, pgTAP
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Dimk8Jo64b4wULp2yAzSNh
2026-09-03 16:12:42 +02:00
Jonny f90fe1f347 feat: PDF-Uebergabeprotokoll als Download bereitstellen
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Dimk8Jo64b4wULp2yAzSNh
2026-09-03 14:16:59 +02:00
Jonny 93dd6fc46b feat: PDF-Layout und Datenaufbereitung fuer das Uebergabeprotokoll 2026-09-03 14:10:07 +02:00
Jonny 569048122f feat: Empfaenger-Name und Unterschrift-Pfad im Auftrag-Query freigeben 2026-09-03 12:46:17 +02:00
Jonny 002601f1e5 feat: Parser fuer indizierte Schadensfoto-Felder (Foto + Beschreibung)
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>
2026-09-03 12:36:20 +02:00
Jonny b0331790a4 feat: Schadensbeschreibung durchreichen, Unterschrift-URL-Helfer ergaenzen
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-09-03 12:31:14 +02:00
Jonny caf72557d5 feat: allow login via username in addition to email 2026-08-21 00:53:40 +02:00
Jonny 956fe82edb feat: add username to validateNutzerBearbeiten, erstelleNutzer and aktualisiereNutzer 2026-08-21 00:38:18 +02:00
Jonny 7dcee542f2 feat: add username to Nutzerliste query 2026-08-20 23:54:59 +02:00
Jonny ade7d85791 test: restore exact-8-character password boundary case 2026-08-20 23:42:34 +02:00
Jonny 9967a705d6 feat: add validateUsername and wire it into validateNutzerErstellen 2026-08-20 23:42:23 +02:00
Jonny c9bf7b5c3e fix: parse Zeitplanung-Zeitpunkt als Europe/Berlin statt Server-TZ
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
2026-08-20 20:35:50 +02:00
Jonny 343f7a3aac feat: Zeitplanung in Auftrag-Query aufnehmen 2026-08-20 19:50:00 +02:00
Jonny a592054ef6 feat: Zeitplanung-Typen, Formatierung und Datumsvorbefuellung 2026-08-20 19:46:59 +02:00
Jonny 9ef5e17cba feat: Auftragsnummer in Auftrag-Query aufnehmen 2026-08-20 10:29:56 +02:00
Jonny 67abe86edd feat: Telefon/E-Mail in Orte-Mutations und -Queries aufnehmen 2026-08-19 12:17:54 +02:00
Jonny 086d7459ee feat: Telefon/E-Mail-Validierung fuer Ansprechpartner
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session
2026-08-19 12:14:36 +02:00
Jonny 0c3caea4f8 feat: Ersteller-Profil in Auftrag-Query aufnehmen 2026-08-19 10:39:38 +02:00
Jonny 76c555a292 feat: make Fahrtbeginn photos optional, rename PFLICHT_FOTO_POSITIONEN to STANDARD_FOTO_POSITIONEN 2026-08-18 15:05:27 +02:00
Jonny 0a0b0b3112 feat: add loadAuftragFotos query with sort/label logic and signed-URL origin rewrite
- 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
2026-08-18 12:49:44 +02:00
Jonny bef98d1898 feat: add validateNutzerBearbeiten and export GUELTIGE_ROLLEN 2026-08-17 17:05:44 +02:00
Jonny c8be1c0c00 feat: split Stammdaten nav into Standorte and Fahrzeuge, remove old page
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
2026-08-17 15:32:51 +02:00
Jonny 02c9274c13 fix: paginate auth.admin.listUsers() in Nutzerliste query 2026-07-15 10:42:24 +02:00
Jonny 3013a7d52c feat: add Nutzerliste query (merges profiles with auth.admin.listUsers) 2026-07-14 22:08:04 +02:00
Jonny 371312fc89 test: add exact 8-character password boundary case 2026-07-14 22:04:32 +02:00
Jonny 147f601e34 feat: add validation for Nutzer-Erstellen, Rolle and Selbstschutz 2026-07-14 22:00:27 +02:00
Jonny 8db31c72a8 feat: add Supabase admin client and service-role-key wiring 2026-07-14 21:56:15 +02:00
Jonny 90ed4d764f fix: unify Zeiterfassung timezone display and add DB guard against double clock-in
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.
2026-07-14 10:27:50 +02:00
Jonny 02dfc2b23e feat: add Zeiterfassung page with Kommen/Gehen, Korrektur and CSV export 2026-07-14 09:03:57 +02:00
Jonny d8ccdc85ca feat: add Zeiterfassung query helpers (Schichten, offene Schichten, verknuepfte Auftraege) 2026-07-14 08:45:27 +02:00
Jonny b1da32ae7a test: add bare-CR quoting case for CSV export 2026-07-13 17:11:44 +02:00
Jonny 45612501df fix: harden CSV export against formula injection and CR row corruption
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.
2026-07-13 17:02:07 +02:00
Jonny 9f2b2d292e feat: add CSV export helper for Zeiterfassung 2026-07-13 16:57:21 +02:00
Jonny b8a7509363 feat: add Tages-/Wochensummen aggregation for Zeiterfassung 2026-07-13 16:51:40 +02:00
Jonny 070b1287c1 test: add invalid-date case for validateSchichtKorrektur 2026-07-13 16:48:51 +02:00
Jonny d91765bd69 feat: add validation for Schicht-Korrektur (geht_um after kommt_um) 2026-07-13 16:44:30 +02:00
Jonny 3fe33c5e0f feat: add pure pause/netto time calculation per §4 ArbZG 2026-07-13 16:31:35 +02:00
Jonny d0017a45b1 feat: add Kanban query helpers (grouped by status, fahrer list) 2026-07-07 21:35:59 +02:00
Jonny 4c0b9772f2 feat: add pure permission helper for Kanban drag targets 2026-07-07 19:39:37 +02:00
Jonny 36c941cad9 feat: add Stammdaten page with Orte list, create and edit 2026-07-06 20:01:40 +02:00
Jonny d8990ba57b feat: add query and mutation helpers for orte and fahrzeuge 2026-07-06 19:35:25 +02:00
Jonny 4795ea1f32 feat: add validation helpers for orte and fahrzeuge 2026-07-06 19:31:33 +02:00
Jonny 4459a6cfcb feat: add fahrt-beenden, stornieren and folgeauftrag suggestion
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.
2026-07-05 22:36:19 +02:00
Jonny 36e65cad48 feat: add server-side data access helpers for auftraege 2026-07-05 17:32:05 +02:00
Jonny 225504f3a9 feat: add fahrt validation helpers for km and required photos 2026-07-05 17:20:40 +02:00
Jonny d812db7da3 fix: fall back to NEXT_PUBLIC_SUPABASE_URL when SUPABASE_INTERNAL_URL is unset
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>
2026-07-05 00:29:35 +02:00
Jonny 2f508ea5dd feat: containerize the Next.js app and wire it into docker-compose
Adds web/Dockerfile (multi-stage node:22-alpine build, standalone output)
and web/.dockerignore, and wires a `web` service into docker-compose.yaml
so the whole stack (self-hosted Supabase + Next.js) starts with a single
`docker compose up -d`.

Networking fix: Next.js inlines NEXT_PUBLIC_* env vars at build time into
every compiled bundle, including server-side ones (Server Actions, Server
Components, Middleware) - not just the browser bundle. Since
NEXT_PUBLIC_SUPABASE_URL must point at the externally-reachable
http://localhost:8000 for the browser, the server-side Supabase clients in
lib/supabase/server.ts and lib/supabase/middleware.ts got that same literal
baked in - which resolves to the web container itself (not kong) once
running in Docker, causing ECONNREFUSED on any server-side Supabase call
(most visibly signInWithPassword in the login server action).

Fix: introduce SUPABASE_INTERNAL_URL, a server-only env var without the
NEXT_PUBLIC_ prefix, so it's read at actual runtime rather than inlined at
build time. It points at http://kong:8000 in docker-compose.yaml (same
pattern already used by the studio service's internal SUPABASE_URL) and at
http://localhost:8000 in web/.env.local(.example) for non-Docker local dev,
where there's no container networking boundary. lib/supabase/client.ts
(browser-only) is untouched and keeps reading NEXT_PUBLIC_SUPABASE_URL.

Considered extra_hosts: ["localhost:host-gateway"] instead, but rejected it:
overriding what the literal string "localhost" resolves to inside a
container is unreliable (glibc's resolver typically still prioritizes the
container's own loopback), and is the kind of workaround that looks fixed
in a quick check and quietly breaks later.

Verified end-to-end against the running container via curl (unauth redirect,
real signInWithPassword through the login server action, authenticated
dashboard content, logout) with zero ECONNREFUSED in `docker compose logs
web` afterward, plus a local `npm run dev` smoke test to confirm non-Docker
development still works unchanged.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-07-05 00:25:01 +02:00
Jonny c236e61692 feat: add root layout, role-based navigation and dashboard 2026-07-04 16:14:53 +02:00
Jonny b397cb326b feat: add auth middleware with session refresh and redirects 2026-07-04 15:57:41 +02:00
Jonny 63866f7f50 feat: add login page with server action and validation 2026-07-04 15:47:54 +02:00
Jonny 7254923885 feat: add Supabase browser and server client helpers
- Add browser client helper (createClient) for client-side components
- Add server client helper (createClient) for server components and route handlers
- Add test for browser client functionality
- Update .gitignore to allow .env.local.example while ignoring .env*.local
- Install @supabase/supabase-js and @supabase/ssr packages

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-07-04 15:32:05 +02:00