Analyse: Einwilligungs-Historie, Nachweis beim Einschalten, Sperre ohne Verantwortlichen-Angaben, Textform für Mitarbeiter

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
ClaudeandClaude Opus 5.5 committed 2026-10-01 18:50:36 +00:00
1 parent c6824f83a6
commit 3d05472b25
14 files changed
+585 -115

No files matched your search

+15
View File
@@ -0,0 +1,15 @@
// Website-Analyse: Einwilligungs-Historie je Projekt (Collection analyseConsents).
// Nur anfuegen und lesen: es gibt bewusst keine Aenderungs- und Loeschfunktion.
import { config } from '../config.js'
import { createDocument, listDocuments, Query } from './appwriteAdmin.js'
/** @param {{customerId,projectId,siteKey,event,avvVersion,via,acceptedAt,acceptedBy,textformDate,textformChannel}} entry */
export async function recordConsent(entry) {
return createDocument(config.collections.analyseConsents, entry)
}
/** Alle Eintraege eines Projekts, aelteste zuerst. */
export async function listConsents(projectId) {
const docs = await listDocuments(config.collections.analyseConsents, [Query.equal('projectId', projectId), Query.limit(500)])
return [...docs].sort((a, b) => String(a.acceptedAt).localeCompare(String(b.acceptedAt)) || String(a.$createdAt).localeCompare(String(b.$createdAt)))
}