feat: Package 4 Nachbesserungen — History-Tracking, Pagination, Frontend-Fixes
All checks were successful
CI / go-lint (push) Has been skipped
CI / python-lint (push) Has been skipped
CI / nodejs-lint (push) Has been skipped
CI / test-go-ai-compliance (push) Successful in 36s
CI / test-python-backend-compliance (push) Successful in 31s
CI / test-python-document-crawler (push) Successful in 23s
CI / test-python-dsms-gateway (push) Successful in 18s
All checks were successful
CI / go-lint (push) Has been skipped
CI / python-lint (push) Has been skipped
CI / nodejs-lint (push) Has been skipped
CI / test-go-ai-compliance (push) Successful in 36s
CI / test-python-backend-compliance (push) Successful in 31s
CI / test-python-document-crawler (push) Successful in 23s
CI / test-python-dsms-gateway (push) Successful in 18s
Backend:
- Migration 009: compliance_einwilligungen_consent_history Tabelle
- EinwilligungenConsentHistoryDB Modell (consent_id, action, version, ip, ua, source)
- _record_history() Helper: automatisch bei POST /consents (granted) + PUT /revoke (revoked)
- GET /consents/{id}/history Endpoint (vor revoke platziert für korrektes Routing)
- GET /consents: history-Array pro Eintrag (inline Sub-Query)
- 5 neue Tests (TestConsentHistoryTracking) — 32/32 bestanden
Frontend:
- consent/route.ts: limit+offset aus Frontend-Request weitergeleitet, total-Feld ergänzt
- Neuer Proxy consent/[id]/history/route.ts für GET /consents/{id}/history
- page.tsx: globalStats state + loadStats() (Backend /consents/stats für globale Zahlen)
- page.tsx: Stats-Kacheln auf globalStats umgestellt (nicht mehr page-relativ)
- page.tsx: history-Mapper: created_at→timestamp, consent_version→version
- page.tsx: loadStats() bei Mount + nach Revoke
Dokumentation:
- Developer Portal: neue API-Docs-Seite /api/einwilligungen (Consent + Legal Docs + Cookie Banner)
- developer-portal/app/api/page.tsx: Consent Management Abschnitt
- MkDocs: History-Endpoint, Pagination-Abschnitt, History-Tracking Abschnitt
- Deploy-Skript: scripts/apply_consent_history_migration.sh
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -106,10 +106,13 @@ export async function GET(request: NextRequest) {
|
||||
return NextResponse.json({ statistics: stats })
|
||||
}
|
||||
|
||||
// Fetch consents with optional user filter
|
||||
// Fetch consents — forward pagination params from frontend
|
||||
const limit = searchParams.get('limit') || '50'
|
||||
const offset = searchParams.get('offset') || '0'
|
||||
const queryParams = new URLSearchParams()
|
||||
if (userId) queryParams.set('user_id', userId)
|
||||
queryParams.set('limit', '50')
|
||||
queryParams.set('limit', limit)
|
||||
queryParams.set('offset', offset)
|
||||
|
||||
const response = await fetch(
|
||||
`${BACKEND_URL}/api/compliance/einwilligungen/consents?${queryParams.toString()}`,
|
||||
@@ -123,9 +126,10 @@ export async function GET(request: NextRequest) {
|
||||
|
||||
const data = await response.json()
|
||||
return NextResponse.json({
|
||||
total: data.total || 0,
|
||||
totalConsents: data.total || 0,
|
||||
activeConsents: (data.consents || []).filter((c: { granted: boolean; revoked_at: string | null }) => c.granted && !c.revoked_at).length,
|
||||
revokedConsents: (data.consents || []).filter((c: { revoked_at: string | null }) => c.revoked_at).length,
|
||||
offset: data.offset || 0,
|
||||
limit: data.limit || parseInt(limit),
|
||||
consents: data.consents || [],
|
||||
})
|
||||
} catch (error) {
|
||||
|
||||
Reference in New Issue
Block a user