feat: Implement Content Reporting Backend
Deploy Development / deploy (push) Successful in 37s
Test Suite / pytest-backend (push) Successful in 35s
Test Suite / lint-backend (push) Successful in 0s
Test Suite / build-frontend (push) Successful in 11s
Test Suite / playwright-tests (push) Successful in 58s

- Added new API endpoints for content reporting, including submission, retrieval, and status updates.
- Created database migration for `content_reports` table to store report data.
- Integrated content reports into the existing admin inbox for better management.
- Implemented validation for report submissions, including required fields and email format.
- Added tests for content reporting functionality, covering various scenarios and edge cases.
- Updated frontend API utility to include new content report methods.
- Bumped app version to 0.8.87 and updated relevant page versions.
This commit is contained in:
Lars committed 2026-05-11 17:54:53 +02:00
1 parent 3c0e63757c
commit 60709df615
12 files changed
+1610 -116

No files matched your search

+10 -10
View File
@@ -3,7 +3,7 @@
**Typ:** Kanonisches Referenzdokument
**Erstellt:** 2026-05-10
**Basisdokument:** `docs/compliance-audit.md` (Initial-Audit 2026-05-09, App-Version 0.8.65)
**Letzte Aktualisierung:** 2026-05-11 (App-Version 0.8.86)
**Letzte Aktualisierung:** 2026-05-11 (App-Version 0.8.87)
---
@@ -266,11 +266,11 @@
|------|--------|
| **Kanonischer Titel** | Content-Melde-Backend (content_reports-Tabelle + Endpoints) |
| **Findings** | KRIT-03 |
| **Etappe** | 3 |
| **Status** | ❌ open |
| **Letzter Stand** | Nicht umgesetzt. Juristisch zu klären (DSA-Anwendungsbereich). Technische Spec vorhanden in `docs/compliance-audit.md` §17. |
| **Verweise** | `docs/compliance-audit.md` §12, §17 |
| **Hinweise** | Keine Nummerierungsabweichung festgestellt. |
| **Etappe** | 3 → B (vorgezogen; → `docs/compliance-roadmap.md` §4) |
| **Status** | ✅ implemented |
| **Letzter Stand** | Vollständig umgesetzt (2026-05-11, Version 0.8.87). Migration 052 (`content_reports`-Tabelle, Indizes). `POST /api/content-reports`: optionale Auth via `X-Auth-Token`, official+aktive Medien ohne Login meldbar, good_faith_confirmed-Pflicht, automatische Priorisierung (high für minors/illegal_content/youth_protection). `GET /api/me/inbox/content-reports`: Plattform-Admin, JOIN auf Zieltabellen. `GET /api/content-reports/{id}`: Admin-Detail. `PATCH /api/content-reports/{id}`: Status/Notiz/Zuweisung (resolution_note für Abschluss-Status Pflicht). `POST /api/content-reports/{id}/legal-hold`: Superadmin, ruft P-11 `set_legal_hold()` auf (reason_code-Mapping), setzt Report-Status auf `resolved_legal_hold`. Inbox-Integration: Zweiter Abschnitt „Inhaltsmeldungen" in `InboxPage.jsx`; `OrgInboxContext` liefert `contentReports` + `contentReportCount`. Keine separate Moderations-Queue — bestehende Admin-Inbox erweitert. 15 Backend-Unit-Tests (`test_p13_content_reports.py`). |
| **Verweise** | `docs/compliance-audit.md` §12, §17; `backend/migrations/052_content_reports.sql`; `backend/routers/content_reports.py`; `backend/tests/test_p13_content_reports.py`; `frontend/src/pages/InboxPage.jsx`; `frontend/src/context/OrgInboxContext.jsx`; `frontend/src/utils/api.js` |
| **Hinweise** | Architekturentscheidung: Die bestehende Admin-Inbox (`InboxPage.jsx`) wurde um einen zweiten Abschnitt erweitert statt einer separaten Moderations-Queue. P-14 (Moderations-UI als eigenständige Seite), P-15 (Uploader-Benachrichtigung) und P-16 (Beschwerdeverfahren) folgen als eigenständige Pakete in Etappe D. E-Mail-Bestätigungen sind nicht in P-13-Scope (SMTP-Infrastruktur vorhanden, P-15 zugeordnet). |
---
@@ -406,7 +406,7 @@
| P-10 | Mindestalter-Abfrage | 2 | HOCH-06 | ❌ open |
| P-11 | Legal-Hold Lifecycle-Status | 2 | MITT-02 | ✅ implemented |
| P-12 | sessionStorage bei Logout bereinigen | 2 | MITT-05 | ✅ implemented |
| P-13 | Content-Melde-Backend | 3 | KRIT-03 | ❌ open |
| P-13 | Content-Melde-Backend | 3→B | KRIT-03 | ✅ implemented |
| P-14 | Moderations-UI | 3 | KRIT-03 | ❌ open |
| P-15 | Uploader-Benachrichtigung bei Sperrung | 3 | KRIT-03 | ❌ open |
| P-16 | Beschwerdeverfahren | 3 | KRIT-03 | ❌ open |
@@ -423,11 +423,11 @@
## Fortschritt
**Implementiert (vollständig):** P-03, P-03b, P-04, P-05, P-05b, P-07, P-11, P-12, P-23, P-24 — 10 Pakete (inkl. 2 Nacharbeiten)
**Implementiert (vollständig):** P-03, P-03b, P-04, P-05, P-05b, P-07, P-11, P-12, P-13, P-23, P-24 — 11 Pakete (inkl. 2 Nacharbeiten)
**Teilweise implementiert:** P-01 (technischer Teil vollständig inkl. P-01b, P-01c, copy-as-draft, jsPDF; juristische Inhalte offen) — 1 Paket
**Teilweise umgesetzt (KRIT offen):** P-06 (Upload-Einwilligungsdialog inkl. P-06+ Volljournal + Korrektur — KRIT-04 bis juristische Validierung ausstehend)
**Offen:** P-02, P-08, P-09, P-10, P-13, P-14, P-15, P-16, P-17, P-18, P-19, P-20, P-21, P-22 — 14 Pakete
**App-Version bei letzter Aktualisierung:** 0.8.86
**Offen:** P-02, P-08, P-09, P-10, P-14, P-15, P-16, P-17, P-18, P-19, P-20, P-21, P-22 — 13 Pakete
**App-Version bei letzter Aktualisierung:** 0.8.87
**Letztes Umsetzungsdatum:** 2026-05-11
---