66 lines
2.4 KiB
Markdown
66 lines
2.4 KiB
Markdown
|
|
# Vollständige Consent-Änderungs-Historie
|
|
|
|
**Aktueller Stand**: Basis-Tracking existiert bereits
|
|
- ✅ `group_social_media_consents`: Aktueller Status + Timestamps (`consent_timestamp`, `revoked_timestamp`)
|
|
- ✅ `management_audit_log`: Allgemeine Aktionen ohne detaillierte Old/New Values
|
|
- ✅ Ausreichend für grundlegende DSGVO-Compliance
|
|
|
|
**Was fehlt**: Dedizierte Änderungs-Historie mit Old→New Values
|
|
|
|
**Geplante Implementierung**:
|
|
\Project-Image-Uploader\backend\src\database\migrations
|
|
```sql
|
|
-- Migration 008: Consent Change History
|
|
CREATE TABLE consent_change_history (
|
|
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
|
group_id TEXT NOT NULL,
|
|
consent_type TEXT NOT NULL, -- 'workshop' | 'social_media'
|
|
platform_id INTEGER, -- NULL für workshop
|
|
|
|
-- Old/New Values als JSON
|
|
old_value TEXT, -- {"consented": true, "revoked": false}
|
|
new_value TEXT NOT NULL, -- {"consented": true, "revoked": true}
|
|
|
|
-- Metadaten
|
|
changed_by TEXT NOT NULL, -- 'user_management' | 'admin_moderation'
|
|
change_reason TEXT,
|
|
ip_address TEXT,
|
|
management_token TEXT, -- Maskiert
|
|
|
|
created_at DATETIME DEFAULT CURRENT_TIMESTAMP
|
|
);
|
|
```
|
|
|
|
**Vorteile**:
|
|
- ✅ Vollständige rechtliche Compliance mit Änderungs-Historie
|
|
- ✅ Debugging: "Wer hat wann was geändert?"
|
|
- ✅ User-Transparenz im Management-Portal
|
|
- ✅ Admin-Audit-Trail für Nachvollziehbarkeit
|
|
|
|
**Implementierungs-Aufwand**: ~1-2 Tage
|
|
1. Migration 008 erstellen
|
|
2. `ConsentHistoryRepository` implementieren
|
|
3. Hooks in Consent-Change-Routes (management.js, admin.js)
|
|
4. Frontend `ConsentHistoryViewer` Komponente (Timeline-View)
|
|
1. diese soll dann im Management-Portal unter "Consent-Verlauf" angezeigt werden
|
|
5. Admin-API: `GET /api/admin/consent-history?groupId=xxx`
|
|
|
|
|
|
|
|
---
|
|
|
|
# 📚 Referenzen
|
|
|
|
- [DSGVO Art. 7 - Bedingungen für die Einwilligung](https://dsgvo-gesetz.de/art-7-dsgvo/)
|
|
- [Material-UI Checkbox Documentation](https://mui.com/material-ui/react-checkbox/)
|
|
- [SQLite Foreign Key Support](https://www.sqlite.org/foreignkeys.html)
|
|
- [UUID v4 Best Practices](https://www.rfc-editor.org/rfc/rfc4122)
|
|
|
|
---
|
|
|
|
**Erstellt am**: 9. November 2025
|
|
**Letzte Aktualisierung**: 15. November 2025, 18:20 Uhr
|
|
**Status**: ✅ Phase 1: 100% komplett | ✅ Phase 2 Backend: 100% komplett | ✅ Phase 2 Frontend: 100% komplett
|
|
**Production-Ready**: Ja (alle Features implementiert und getestet)
|