Systemet til håndtering af Fælles Vinindkøb
Full CRUD on Participant scoped to the caller's organization via new get_route_in_organization/get_participant_in_organization helpers in app/dependencies.py (shared cross-cutting spot, reused by task 6). PATCH is_active is the primary deactivation path — replaces the old spreadsheet-era "empty order" trick and preserves order history for participants who leave and later return. DELETE is a separate, superadmin-gated hard-delete for GDPR erasure requests, which cascades to the participant's orders. Adds UNIQUE(route_id, email) at the DB level (existing 308 participants already conform, per task 3's dedup) plus email normalization on create/update, so case-variant duplicates can't reappear via the API. Every write path relies on catching the constraint's IntegrityError for a clean 409 rather than a racy pre-check. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> |
||
|---|---|---|
| app | ||
| migrations | ||
| scripts | ||
| .env.example | ||
| .gitignore | ||
| .python-version | ||
| alembic.ini | ||
| CLAUDE.md | ||
| pyproject.toml | ||
| README.md | ||
| uv.lock | ||
Vinindkøb v2
Admin-backend til fælles vinindkøb (FastAPI + SQLModel + PostgreSQL + Alembic). Se CLAUDE.md for projektplan og datamodel.
Kom i gang
uv sync
cp .env.example .env # udfyld DATABASE_URL med din egen Postgres-instans
uv run alembic upgrade head
uv run fastapi dev app/main.py
GET /health bekræfter at appen kan nå databasen.