2.6 KiB
2.6 KiB
Story 3.4: Blueprint CRUD — Frontend & Backend
Status: done
Story
Als Nutzer, möchte ich Councils speichern, laden und löschen können, so dass ich meine Konfigurationen wiederverwenden kann.
Acceptance Criteria
POST /api/councils/mit Blueprint →201 Created+ gespeichertes Blueprint mitidGET /api/councils/→ Liste aller BlueprintsGET /api/councils/{id}→ Einzelnes Blueprint; unbekannte ID →404PUT /api/councils/{id}→ Aktualisiertes BlueprintDELETE /api/councils/{id}→204 No Content; unbekannte ID →404- Frontend: „Speichern"-Button ruft
councilApi.create()auf, Bestätigung erscheint - Frontend: Blueprint-Export als JSON-Datei
Tasks / Subtasks
- Task 1:
api/blueprint_routes.pymit CRUD-Endpunkten (AC: 1–5)- Subtask 1.1: Pydantic-Request/Response-Modelle
- Subtask 1.2: Alle fünf CRUD-Endpunkte mit DB-Session
- Task 2:
services/blueprint_service.pyService-Layer (AC: 1–5)- Subtask 2.1:
create_blueprint(),get_blueprint(),list_blueprints() - Subtask 2.2:
update_blueprint(),delete_blueprint()
- Subtask 2.1:
- Task 3: Frontend
utils/api-client.tsBlueprint-Client (AC: 6) - Task 4: Speichern/Export-Buttons in
rat-architekt/page.tsx(AC: 6, 7) - Task 5: Unit-Tests für Service und API (AC: 1–5)
Dev Notes
- Service-Layer nutzt
AsyncSessionvon SQLAlchemy - Tests: In-Memory SQLite,
create_all()statt Alembic - Frontend:
URL.createObjectURL()für JSON-Download ohne Server
Project Structure Notes
backend/api/blueprint_routes.pybackend/services/blueprint_service.pybackend/tests/test_blueprint_api.pybackend/tests/test_blueprint_service.pyfrontend/app/utils/api-client.tsfrontend/app/rat-architekt/page.tsx
References
- [Source: _bmad-output/planning-artifacts/architecture.md#REST-Endpunkte]
- [Source: _bmad-output/planning-artifacts/epics.md#Story-3.4]
Dev Agent Record
Agent Model Used
Amelia (💻 BMAD Dev Agent)
Completion Notes List
blueprint_routerwird inmain.pyunter/apiPrefix eingehangen.- Service-Layer macht API-Tests unabhängig von HTTP-Details.
- Alle 9 Blueprint-API-Tests und 10 Service-Tests bestehen.
File List
backend/api/blueprint_routes.pybackend/services/blueprint_service.pybackend/tests/test_blueprint_api.pybackend/tests/test_blueprint_service.pyfrontend/app/utils/api-client.tsfrontend/app/rat-architekt/page.tsxfrontend/app/__tests__/api-client.test.ts