1
0
Fork 0
Commit Graph

22 Commits

Author SHA1 Message Date
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 cd6fa14551 docs: add Zeiterfassung implementation plan
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>
2026-07-13 15:53:20 +02:00
Jonny 50b511fe9c docs: add Zeiterfassung design spec
Kommen/Gehen-Modul mit Pausenpauschale nach §4 ArbZG, Auswertung und
Korrekturmoeglichkeit durch Disponent/Admin.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-07-13 15:39:01 +02:00
Jonny 70d68d6b6b docs: add Kanban-Dashboard implementation plan
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.
2026-07-07 15:26:33 +02:00
Jonny 1d148e0db0 docs: add Kanban-Dashboard design spec
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.
2026-07-07 15:18:50 +02:00
Jonny ebbb5d67a4 docs: add Stammdaten (Orte/Fahrzeuge) implementation plan
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.
2026-07-06 19:27:57 +02:00
Jonny 1c9be22df2 docs: add Stammdaten (Orte/Fahrzeuge) design spec
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.
2026-07-06 19:07:14 +02:00
Jonny 133308adf8 docs: fix curl login verification technique in plan
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.
2026-07-06 12:01:44 +02:00
Jonny cdacc76fb4 docs: add design-system implementation plan
7 tasks: Tailwind v4 setup + brand tokens, UI primitives + login,
mobile drawer navigation, dashboard, Aufträge-Liste + StatusBadge,
Auftrag-Detail, Auftrag-anlegen. Pure presentation layer, no
Server-Action/RLS/schema changes.
2026-07-06 09:55:23 +02:00
Jonny 7f1df79b41 docs: add design-system spec (mobile-first, Widmann-Branding)
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.
2026-07-06 09:42:06 +02:00
Jonny 0334fb4f10 docs: fix stornieren RLS gap and fahrtBeenden silent-noop found by security review
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.
2026-07-05 22:43:10 +02:00
Jonny ad15af965b docs: fix fahrtBeginnen photo write - upsert on partial index doesn't work
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.
2026-07-05 22:19:02 +02:00
Jonny e52a499b71 docs: fix invalid hex digit in readonly test-fixture UUID (r -> 0) 2026-07-05 17:03:28 +02:00
Jonny b576c4e3b1 docs: fix RLS role-gating gaps found by automated security review
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.
2026-07-05 11:18:58 +02:00
Jonny f9bddc01a8 docs: add implementation plan for auftragsverwaltung sub-project
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.
2026-07-05 10:53:57 +02:00
Jonny e9c9c36448 docs: add design spec for Auftragsverwaltung sub-project
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.
2026-07-05 10:36:08 +02:00
Jonny bf7af326f4 docs: add root setup README and fix stale auth.user_role() reference
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.
2026-07-05 00:45:39 +02:00
Jonny 16f8b09606 docs: correct plan for auth schema lockdown and missing grants
Self-hosted Supabase now revokes CREATE on the auth schema from the
migration role, so the RLS helper lives in public.user_role() instead
of auth.user_role(). Also documents the authenticated grants that
Task 2's schema was missing (RLS alone doesn't grant access).
2026-07-04 12:00:44 +02:00
Jonny 2f2f354402 docs: fix plan to prevent role privilege escalation via user metadata
Automated security review flagged that reading `role` from
raw_user_meta_data in the profiles trigger lets a user set their own
role at account-creation time in some GoTrue flows (OAuth, invites).
New users now always start as readonly; admins promote them
explicitly afterwards via SQL/table editor.
2026-07-04 11:42:16 +02:00
Jonny a1e08fb1d0 docs: add implementation plan for foundation (auth & roles)
Nine-task plan covering Next.js scaffold, Supabase schema/RLS/pgTAP,
the self-hosted Docker Compose stack, and the login/middleware/
dashboard flow that later subprojects build on.
2026-07-04 10:38:25 +02:00
Jonny 0643bef299 chore: initial commit - requirements and foundation design spec
Sets up Aushilfsfahrer as its own repository with the project
requirements (CLAUDE.md) and the design spec for the foundation
subproject (auth, roles, infra).
2026-07-04 10:27:07 +02:00