1
0
Fork 0
Commit Graph

155 Commits

Author SHA1 Message Date
Jonny d11d23feaa feat: Auftragsnummer-Trigger, Zaehler und Backfill
security definer + set search_path auf generiere_auftragsnummer()
ergaenzt (Abweichung vom Task-Brief): ohne das schlaegt jeder Insert als
"authenticated" mit "permission denied for table
auftragsnummer_zaehler" fehl, da die Funktion sonst invoker-mode laeuft
und der Zaehler-Tabelle absichtlich kein Grant an authenticated erteilt
wird (sonst waere der Tageszaehler ueber die REST-API frei
lesbar/schreibbar). Gleiches Muster wie
check_auftrag_status_transition() in
20260705145543_auftrag_status_trigger.sql.
2026-08-20 10:21:51 +02:00
Jonny e3d82e0cf6 docs: add Auftragsnummer implementation plan 2026-08-20 10:12:02 +02:00
Jonny 40e17e3a5a docs: add Auftragsnummer design spec 2026-08-20 10:05:55 +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 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 b623805530 feat: telefon/email Spalten auf orte ergaenzen 2026-08-19 12:11:01 +02:00
Jonny eaa848f845 docs: add Ansprechpartner-Kontakt implementation plan 2026-08-19 12:06:26 +02:00
Jonny 60c033184b docs: add Ansprechpartner-Kontakt (Telefon/E-Mail) design spec 2026-08-19 12:02:08 +02:00
Jonny 6d6a857ee7 docs: offene Punkte aktualisieren, Rebuild-Master-Stack proaktiv erlauben
Ersteller-Anzeige (Punkt 3) ist umgesetzt und aus den offenen Punkten
entfernt; kleinere Textkorrektur bei Fahrtbeginn-Fotos bleibt erhalten.
Nutzer hat am 2026-08-19 dauerhafte Erlaubnis erteilt, /rebuild-master-stack
nach jedem Merge proaktiv auszufuehren statt jedes Mal nachzufragen.
2026-08-19 11:38:57 +02:00
Jonny 306ce1544d fix: pgTAP-Luecke (Fahrer-Grenze) und veraltete Spec-Stelle nach Final-Review
- profiles_rls_test.sql: fehlende negative Assertion ergaenzt, die
  sicherstellt, dass der Fahrer-Testnutzer 44444444... weiterhin KEIN
  Readonly-Profil sieht (Policy bleibt scharf auf role in
  ('admin','disponent') begrenzt). plan(12) -> plan(13).
- design.md: Aussage zu erstellt_von im Auftrag-Typ korrigiert (nullable
  statt immer vorhanden), passend zum bereits umgesetzten Code und zum
  Nachtrag in Abschnitt 1 der gleichen Spec.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HCHRPWuV3bd37NJhW2NK6P
2026-08-19 11:06:54 +02:00
Jonny 6296ecd466 feat: Ersteller-Name auf Auftrag-Detailseite anzeigen 2026-08-19 10:52:07 +02:00
Jonny 0c3caea4f8 feat: Ersteller-Profil in Auftrag-Query aufnehmen 2026-08-19 10:39:38 +02:00
Jonny 038e2e422b feat: Fahrer/Readonly sehen Admin- und Disponent-Profile (RLS)
Neue Policy fuer Ersteller-Anzeige im Auftrag (Task 2/3 folgen). Bestehende
Assertion "Fahrer sieht nur das eigene Profil" testete eine Einschraenkung,
die dieses Feature bewusst aufhebt -- Erwartungswert und Titel angepasst,
statt der Policy, auf Anweisung des Plan-Autors.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HCHRPWuV3bd37NJhW2NK6P
2026-08-19 10:24:36 +02:00
Jonny 6ef0842a62 docs: add Auftrag-Ersteller-anzeigen implementation plan 2026-08-19 10:11:29 +02:00
Jonny ab31b5121c docs: add Auftrag-Ersteller-anzeigen design spec 2026-08-19 10:00:06 +02:00
Jonny 91607baf7f docs: add pgTAP suite and /rebuild-master-stack reminder to plan's merge checklist 2026-08-18 17:48:04 +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 eaa5faad7b fix: restore dropped explanatory comment in trigger function
Restore the security-review context comment that explains why the
storniert status check is necessary. This comment was part of the
original trigger function body and should be preserved for future
maintainers who inspect the function directly in the database.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HCHRPWuV3bd37NJhW2NK6P
2026-08-18 16:52:39 +02:00
Jonny 9f410cbe80 fix: remove photo-count check from DB trigger, photos now optional at Fahrtbeginn
- Add migration 20260818120000_auftrag_fotos_optional_trigger.sql that replaces
  check_auftrag_status_transition() function, removing ONLY the photo-count check
  while preserving all other validation (start_km, end_km, uebergabe_bestaetigt_at,
  status transitions, column lockdown, role-based restrictions)
- Update pgTAP test: plan(13) -> plan(12), replace photo-mandatory test with
  test verifying transition succeeds without photos
- Completes DB-level optional photos feature (app-level optional already done in Task 1)

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HCHRPWuV3bd37NJhW2NK6P
2026-08-18 16:32:34 +02:00
Jonny df79d9324e docs: correct plan/spec after discovering DB trigger also enforces mandatory photos
Task 2's implementer found that check_auftrag_status_transition() independently
blocks the zugewiesen->unterwegs transition below 8 photos, duplicating the
app-level check removed in Task 1. Insert a new Task 2 (migration + pgTAP test
update) and correct the "no schema change" claims accordingly.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HCHRPWuV3bd37NJhW2NK6P
2026-08-18 16:00:14 +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 6137dac74d docs: add Fahrtbeginn-Fotos-optional implementation plan 2026-08-18 14:53:16 +02:00
Jonny 6780ef32b8 docs: add Fahrtbeginn-Fotos-optional design spec 2026-08-18 14:43:38 +02:00
Jonny c55d10f414 perf: lazy-load photo thumbnails for mobile bandwidth 2026-08-18 14:01:53 +02:00
Jonny 9406ab31d7 feat: show Foto-Galerie on Auftrag detail page 2026-08-18 13:41:16 +02:00
Jonny 3e544be8ce fix: add pointer-events-auto to lightbox image so clicking the photo does not close it 2026-08-18 13:08:52 +02:00
Jonny 97ac267158 feat: add FotoGalerie component with thumbnail grid and lightbox 2026-08-18 13:00:18 +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 a2254ae539 docs: add Auftrag-Foto-Galerie implementation plan 2026-08-18 12:25:18 +02:00
Jonny 61a306a121 docs: add Auftrag-Foto-Galerie design spec 2026-08-18 12:02:36 +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 930994126f feat: switch Nutzerverwaltung page to inline-editable table 2026-08-17 18:03:26 +02:00
Jonny d261061c1c fix: render Sperren button within a single row Card instead of a duplicate row 2026-08-17 17:36:43 +02:00
Jonny a85b79bb05 fix: make Sperren/Entsperren reachable during edit mode in NutzerZeile 2026-08-17 17:28:11 +02:00
Jonny d023bb49fe feat: add NutzerZeile and NutzerTabelle components 2026-08-17 17:19:33 +02:00
Jonny 50083ab8eb feat: replace aendereRolle with return-based aktualisiereNutzer, convert sperren/entsperren to return-based 2026-08-17 17:11:51 +02:00
Jonny bef98d1898 feat: add validateNutzerBearbeiten and export GUELTIGE_ROLLEN 2026-08-17 17:05:44 +02:00
Jonny 525c460a74 docs: add Nutzerverwaltung-Tabelle implementation plan 2026-08-17 16:49:52 +02:00
Jonny 3885fa5bea docs: add Nutzerverwaltung-Tabelle design spec 2026-08-17 16:41:10 +02:00
Jonny 6677679eb9 fix: use onSubmit instead of form action to prevent field reset on error, rename ActionResult type
Finding 1: React 19's native <form action={fn}> resets uncontrolled
fields once fn resolves without throwing, regardless of an app-level
{success:false} result. Since handleSubmit never throws, every failed
submit (e.g. duplicate Kennzeichen) silently wiped user edits. Switched
all four Standorte/Fahrzeuge inline-edit and create forms to a plain
onSubmit handler that calls event.preventDefault() and builds FormData
from the submitted element manually, sidestepping React's action-reset
machinery.

Finding 2: web/app/standorte/actions.ts and web/app/fahrzeuge/actions.ts
each declared their own MutationResult type shadowing the differently
shaped MutationResult exported from lib/orte-fahrzeuge/mutations.ts.
Renamed the local type to ActionResult in both files to remove the
name collision.
2026-08-17 16:08:19 +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 16b0300488 feat: add Fahrzeuge page with inline-editable table
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-08-17 15:12:00 +02:00
Jonny f8d466ccbf feat: add Fahrzeuge server actions (return-based, no redirect) 2026-08-17 15:07:51 +02:00
Jonny a33a18e6fa feat: add Standorte page with inline-editable table
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HCHRPWuV3bd37NJhW2NK6P
2026-08-17 15:02:17 +02:00
Jonny 587e36f81c feat: add Standorte server actions (return-based, no redirect) 2026-08-17 14:56:49 +02:00
Jonny ca942958c0 docs: add Standorte/Fahrzeuge-Tabellen implementation plan 2026-08-17 14:47:23 +02:00
Jonny b15f36e528 docs: add Standorte/Fahrzeuge-Tabellen design spec 2026-08-17 14:37:34 +02:00