1
0
Fork 0
Commit Graph

139 Commits

Author SHA1 Message Date
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
Jonny b70c1511f1 docs: add Login-per-Benutzername implementation plan 2026-07-16 08:29:19 +02:00
Jonny 6b4e53d46f docs: add Login-per-Benutzername design spec 2026-07-15 22:46:16 +02:00
Jonny 8ed4c86813 feat: add Nutzerverwaltung page 2026-07-15 11:43:26 +02:00
Jonny 3f78e4f65a feat: add Nutzerverwaltung server actions (erstellen, rolle aendern, sperren, entsperren) 2026-07-15 10:54:08 +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 5ad147088c docs: add Nutzerverwaltung implementation plan
Admin-Client mit Service-Role-Key, Validierung, Nutzerliste-Merge aus
profiles + auth.admin.listUsers, vier Server Actions und die Seite in
6 Tasks.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-07-14 18:48:55 +02:00
Jonny cffd576451 docs: add Nutzerverwaltung design spec
Admin kann Nutzer anlegen, Rollen aendern und ueber die Supabase Admin
API sperren/entsperren -- RLS ist hier bewusst nicht die Grenze, die
Server-Action-Rollenpruefung ist es.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-07-14 18:35:24 +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 d87e881d0e feat: add Zeiterfassung link to navigation 2026-07-14 09:11:39 +02:00
Jonny 02dfc2b23e feat: add Zeiterfassung page with Kommen/Gehen, Korrektur and CSV export 2026-07-14 09:03:57 +02:00
Jonny c3cdfc9ac7 feat: add Zeiterfassung server actions (kommen, gehen, korrigieren, csv export) 2026-07-14 08:51:53 +02:00
Jonny d8ccdc85ca feat: add Zeiterfassung query helpers (Schichten, offene Schichten, verknuepfte Auftraege) 2026-07-14 08:45:27 +02:00