Unterschrift, Schadensbeschreibung und PDF-Export beim Fahrtende sind das
erste Sub-Projekt aus einem groesseren Feature-Wunsch; weitere Bereiche
(Routenberechnung, Benachrichtigungen, Reporting, ...) sind als Backlog
in CLAUDE.md vorgemerkt.
- 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
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
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>
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>
Kommen/Gehen-Tabelle mit Column-Lockdown-Trigger, Pausenpauschale nach
§4 ArbZG, Aggregation, CSV-Export und Korrektur-Workflow in 9 Tasks.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Kommen/Gehen-Modul mit Pausenpauschale nach §4 ArbZG, Auswertung und
Korrekturmoeglichkeit durch Disponent/Admin.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
7 tasks: RLS policy for disponent-sees-fahrer-profiles (needed for the
assignment picker), pure drag-permission helper, Kanban query layer,
result-based server actions for the board context (deliberately not
reusing the redirect-based form actions), the KanbanBoard component
with @dnd-kit/core, the Fahrer-Auswaehler dialog, and wiring into the
dashboard page.
Replaces the Dashboard placeholder with an interactive Kanban board
(drag-and-drop via @dnd-kit/core, touch-capable per the mobile-first
requirement). Reuses existing RLS-driven visibility and the
uebernehmen()/stornieren() actions; adds one new server action
(zuweisenAnFahrer) for Disponent/Admin assigning orders to a specific
Fahrer, a gap that existed since the original Auftragsverwaltung scope.
7 tasks: validation helpers, query/mutation data layer, pgTAP RLS
coverage (a gap that predates this plan), Stammdaten page for Orte
and Fahrzeuge (list+create+edit), and inline quick-add for both on
the Auftrag-anlegen form. No schema/RLS changes - reuses existing
insert/update policies from the Auftragsverwaltung foundation.
Closes a gap found during the first live design-system test: no UI
existed to create new Abholorte/Zielorte/Fahrzeuge (only dropdowns of
existing entries). No schema change needed - RLS already supports
admin/disponent insert/update on orte/fahrzeuge. Covers a new
/stammdaten management page (list+create+edit) plus an inline
quick-add on the Auftrag-anlegen form.
The plain form-urlencoded curl POST in the manual verification steps
does not work against a real Next.js Server Action (found during Task
3's manual verification). Documents the correct multipart/$ACTION_ID
technique and the test admin credentials in Global Constraints so
later tasks don't rediscover this.
Brand tokens (colors, Inter font) extracted directly from widmannbewegt.de's
production CSS; logo SVG saved for later use. Covers layout/nav, reusable
UI primitives, and page-by-page application as a pure presentation-layer
sub-project on top of the existing Fundament and Auftragsverwaltung features.
Task 2's fahrer UPDATE policy only constrains zugewiesen_an in its
WITH CHECK, not the status value itself, so a fahrer could set their
own assigned order straight to 'storniert' even though the spec
reserves cancellation for Disponent/Admin. Live-verified the gap
(UPDATE 1 as fahrer before the fix). Extends Task 4's trigger with a
role-gated check on the 'storniert' target status plus a regression
test (plan(12) -> plan(13)). Also hardens fahrtBeenden/stornieren in
Task 11 to check affected-row counts (matching uebernehmen's existing
pattern) instead of silently "succeeding" when RLS blocks a write for
an unauthorized caller.
The plan's original upsert(onConflict: "auftrag_id,position") for
auftrag_fotos cannot work: PostgREST's onConflict generates an
unqualified ON CONFLICT clause that can't target Task 3's partial
unique index (position <> 'schaden'), and even a working ON CONFLICT
would hit RLS since only admin has UPDATE on auftrag_fotos. Switched
to plain insert with checked errors on both write paths, consistent
with the spec's "Loeschen/Ersetzen nur durch Admin" rule.
The fahrer UPDATE policy on auftraege, the fahrer INSERT policy on
auftrag_fotos, and the storage upload policy all lacked an explicit
public.user_role() = 'fahrer' predicate, so any authenticated role
(including the default readonly signup role) could exploit the
status='offen' clause to self-assign open orders. Also adds identity
binding (erstellt_von/uploaded_by = auth.uid()) on inserts, and a
column-lockdown check in Task 4's trigger so a fahrer can't smuggle
changes to abholort_id/zielort_id/fahrzeug_id/erstellt_von/
vorgaenger_auftrag_id into an otherwise-legitimate update.
11 tasks covering the orte/fahrzeuge lookup pools, the auftraege
core table with RLS and a DB-enforced status transition trigger,
photo storage with RLS, and the driver/dispatcher-facing pages.
Covers the full order lifecycle (create, assign, driver pickup with
km/photos, dropoff, vehicle chaining) building on the auth/roles
foundation, scoped separately from Kanban board, routing, and full
time tracking per CLAUDE.md's independent feature list.
There was no end-to-end runbook for getting from a fresh clone to a
running dev environment -- the sequence was scattered across script
comments and .env.example. Add a root README.md covering secrets
generation, template rendering, docker compose up, migrations, first
admin user creation, and the non-Docker web/ dev alternative, plus a
heads-up that the admin@aushilfsfahrer.local test password was reset
out-of-band during implementation and isn't recorded anywhere.
Replace web/README.md's untouched create-next-app boilerplate (which
mentioned yarn/pnpm/bun and "Deploy on Vercel") with a one-line pointer
to the root README, since it was actively misleading for this
self-hosted Docker project.
Also fix the design spec still naming the helper auth.user_role() --
it was renamed to public.user_role() during Task 3 due to the
auth-schema lockdown; the migrations and plan already reflect this.