1
0
Fork 0
Commit Graph

38 Commits

Author SHA1 Message Date
Jonny 54bc2f966e fix: Abschlussreview-Befunde der PWA (Progressive Enhancement, veraltetes Absenden, SW-Caching, Icon-Version)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-28 12:27:19 +01:00
Jonny 6e4b784bf9 fix: fahrtBeginnen lehnt erneutes Absenden ausserhalb des Status zugewiesen ab
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-28 11:54:56 +01:00
Jonny 906b822250 feat: Eingaben bleiben bei Netzausfall beim Absenden erhalten
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-28 11:49:51 +01:00
Jonny 228b7c731c feat: PDF-Erzeugung als gemeinsame Funktion, Fotos fuers Protokoll verkleinert
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-11 18:53:11 +02:00
Jonny ff201eb2cd fix: Final-Review (FIN maxLength, Labels, Fahrer-Hinweis bei Abweichung, Import-Platzierung)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-11 12:24:57 +02:00
Jonny c86f4df08f feat: optionaler FIN-Abgleich bei Fahrtbeginn mit Abweichungs-Bestaetigung
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-09 22:18:30 +02:00
Jonny 7ea4a5b551 feat: FIN in Fahrzeug-Stammdaten und beim Anlegen im Auftrag erfassen
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-09 22:05:07 +02:00
Jonny 5f2af33e3e feat: FIN und FIN-Abgleich in Listen, Kanban, Auslastung, Auftragsdetail und PDF anzeigen
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-09 16:58:49 +02:00
Jonny 2ee9fd591f feat: Statusfilter in der Auftragsliste (Standard: offen, zugewiesen, unterwegs)
Umschalter Aktiv/Alle ueber ?status=alle, serverseitig gefiltert, fuer alle
Rollen. Bei Fahrern wirkt er auf Meine Auftraege; Offene Auftraege bleibt.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-02 09:52:54 +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 5c7b289cb9 feat: digitale Unterschrift und Empfaenger-Name bei Fahrtende erfassen und anzeigen 2026-09-03 12:49:52 +02:00
Jonny 803b726bea feat: pro Schadensfoto eine optionale Freitext-Beschreibung erfassen und anzeigen 2026-09-03 12:42:04 +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 2eb85870bb feat: Zeitplanung auf Detailseite und in Auftragsliste anzeigen 2026-08-20 20:17:51 +02:00
Jonny 0863d5d9b9 feat: Zeitplanung-Auswahl beim Anlegen eines Auftrags
Neuer ZeitplanungFeld-Client-Komponente zeigt Datum/Uhrzeit-Feld nur
fuer die Zeitplanungstypen "am"/"ab" an und wird auf der Auftrag-
Neu-Seite eingebunden. createAuftrag validiert und speichert
zeitplanung_typ/zeitplanung_zeitpunkt, mit serverseitiger Pruefung
vor dem Insert.
2026-08-20 20:00:16 +02:00
Jonny 20d5b4a687 feat: Auftragsnummer auf Detailseite und in Auftragsliste anzeigen 2026-08-20 10:50:15 +02:00
Jonny ca24bcd407 feat: Auftragsnummer beim Anlegen eingebbar machen 2026-08-20 10:43:21 +02:00
Jonny 846eb7d05f feat: Telefon/E-Mail des Ansprechpartners auf Auftrag-Detailseite anzeigen 2026-08-19 12:46:30 +02:00
Jonny 9d03c6d68d feat: Telefon/E-Mail in Standort-Formularen und -Tabelle
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HCHRPWuV3bd37NJhW2NK6P
2026-08-19 12:39:15 +02:00
Jonny bcaa545aaa feat: Telefon/E-Mail in Standort-Server-Actions durchreichen 2026-08-19 12:30:40 +02:00
Jonny 6296ecd466 feat: Ersteller-Name auf Auftrag-Detailseite anzeigen 2026-08-19 10:52:07 +02:00
Jonny e9c7827611 feat: remove required attribute from Fahrtbeginn photo fields
Photos are now optional when a driver starts a trip: the 8 vehicle photo
fields remain in the form but no longer carry the required attribute, are
labeled "(optional)", and validateFahrtBeginn no longer checks for missing
positions. Combined with the DB trigger fix in 9f410cb/eaa5faa, a trip can
now begin with zero, some, or all photos uploaded.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HCHRPWuV3bd37NJhW2NK6P
2026-08-18 17:25:15 +02:00
Jonny 9406ab31d7 feat: show Foto-Galerie on Auftrag detail page 2026-08-18 13:41:16 +02:00
Jonny eb0fad8c16 fix: remove encType from Server-Action forms to fix upload error
React 19 forbids setting encType/method on a <form> whose action is a
function - it manages FormData (including files) itself. The extra
attribute triggered a console error and blocked "Fahrt beginnen" /
"Schadensfoto nachtragen" whenever photos were attached.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HCHRPWuV3bd37NJhW2NK6P
2026-08-18 11:27:33 +02:00
Jonny 116e78fdc6 feat: add inline Fahrzeug quick-add to Auftrag-anlegen page
Adds createFahrzeugUndAuswaehlen (unbound server action) so a new
Fahrzeug can be created inline from /auftraege/neu without leaving
the page, mirroring the existing Ort quick-add flow from Task 6.
Includes an app-layer admin/disponent role check as defense-in-depth
alongside RLS, consistent with the pattern already applied to
createOrtUndAuswaehlen and the page-level gate.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-07-07 09:39:38 +02:00
Jonny e55ab12c2b fix: add defense-in-depth role check to createOrtUndAuswaehlen 2026-07-07 09:13:29 +02:00
Jonny 69c22f9afe feat: add inline Ort quick-add to Auftrag-anlegen page 2026-07-07 08:47:42 +02:00
Jonny 06e115cc05 fix: resolve nested <main> landmarks, nav touch targets, focus consistency 2026-07-06 13:17:51 +02:00
Jonny ae78bcaab2 feat: restyle Auftrag-anlegen page 2026-07-06 12:49:29 +02:00
Jonny 55f19858d7 feat: restyle Auftrag detail page 2026-07-06 12:37:35 +02:00
Jonny 4de4482c88 feat: add StatusBadge and restyle Aufträge list page
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-07-06 12:20:50 +02:00
Jonny c758dd2305 fix: allow schaden photos during unterwegs and close final-review gaps
Final whole-branch review before merging feature/auftragsverwaltung found
two Important and three Minor issues, all fixed in this round:

- auftrag_fotos and storage.objects INSERT policies now split the
  condition: Pflicht-positions still require status = 'zugewiesen', but
  schaden photos may additionally be uploaded while status = 'unterwegs',
  matching the spec's "jederzeit waehrend der Fahrt nachtragen" requirement.
- Added schadenFotoNachtragen server action + a page form so drivers can
  actually use the new mid-trip upload window.
- Added supabase/tests/auftrag_fotos_rls_test.sql (12 pgTAP tests) covering
  SELECT/INSERT RLS on both auftrag_fotos and storage.objects, including the
  new unterwegs-schaden-allowed / unterwegs-pflicht-blocked cases.
- fahrtBeginnen now checks affected row count like fahrtBeenden/stornieren
  instead of only checking `error`.
- /auftraege/neu now gates on role (admin/disponent) via loadProfile(),
  redirecting non-privileged roles back to /auftraege with a visible error
  (which now renders the error query param).
- Renamed the over-long storage INSERT policy name to stay under the 63
  byte Postgres identifier limit.

Migrations were edited in place rather than layered with a new migration,
following the established precedent (55c4ac5) for pre-merge, not-yet-deployed
RLS fixes on this branch.

Verified: npx supabase db reset clean, npx supabase test db 33/33 passing
(was 21), npm run build and npm test green in web/, and a live rolled-back
SQL probe confirming a driver can insert a schaden photo but not a Pflicht
photo while status = 'unterwegs'.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-07-06 06:57:22 +02:00
Jonny 58e34a14a6 fix: close stornieren RLS gap and harden fahrtBeenden/stornieren
Security review (automated scan + Task 11 reviewer) found a fahrer could
storniere their own assigned order because Task 2's fahrer UPDATE policy
only constrains zugewiesen_an, never status. Adds a role-gated check to
the status trigger (only admin/disponent may set status='storniert') plus
a pgTAP regression test. Also hardens fahrtBeenden/stornieren to check
affected-row counts instead of silently redirecting to a success page on
a blocked update.

Live-verified: fahrer storno attempt now rejected by the trigger; normal
fahrer fahrtBeenden flow unaffected. db reset + test db (21/21), build,
and npm test (17/17) all pass.
2026-07-06 06:22:53 +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 89564e527d feat: add auftrag detail page with uebernehmen and fahrt-beginnen actions
fahrtBeginnen uses plain insert (not upsert) for auftrag_fotos writes:
the partial unique index from Task 3 (where position <> 'schaden') can't
be targeted by PostgREST's onConflict option (Postgres 42P10), and
fahrer have no UPDATE grant on auftrag_fotos anyway, so an upsert's
DO UPDATE branch could never succeed for them. Verified live against
the local Supabase stack that the original upsert-based approach
silently wrote zero photo rows, blocking every real fahrtBeginnen
attempt at the DB trigger.
2026-07-05 22:16:54 +02:00
Jonny d292d122c9 feat: add auftraege list page with role-aware sections 2026-07-05 21:45:27 +02:00
Jonny e85e9ce993 feat: add auftrag creation page and server action 2026-07-05 17:49:48 +02:00