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:
1 parent
c6824f83a6
commit
3d05472b25
14 files changed
+585
-115
No files matched your search
@@ -0,0 +1,20 @@
|
||||
// Website-Analyse: Angaben des Verantwortlichen fuer die Datenschutz-Zusatzseite aus dem Kundendatensatz.
|
||||
// Rein, ohne Imports. Einziger Regelsatz: Portal-Sperre, Portal-Vorschau und Runner-Auftrag nutzen ihn.
|
||||
|
||||
const clean = (v) => String(v ?? '').replace(/[\x00-\x1f\x7f]/g, ' ').replace(/\s+/g, ' ').trim()
|
||||
const EMAIL_RE = /^[^\s@]+@[^\s@]+\.[^\s@]+$/
|
||||
|
||||
/**
|
||||
* @returns {{ ok: boolean, company: string, address: string, email: string, missing: Array<'firma'|'email'> }}
|
||||
*/
|
||||
export function analysePrivacyData(customer) {
|
||||
const c = customer || {}
|
||||
const company = (clean(c.companyName) || clean(c.name)).slice(0, 200).trim()
|
||||
const address = [clean(c.street), clean(`${c.postalCode || ''} ${c.city || ''}`)].filter(Boolean).join(', ').slice(0, 300).trim()
|
||||
const rawEmail = clean(c.email)
|
||||
const email = rawEmail.slice(0, 200)
|
||||
const missing = []
|
||||
if (!company) missing.push('firma')
|
||||
if (rawEmail.length > 200 || !EMAIL_RE.test(rawEmail)) missing.push('email')
|
||||
return { ok: missing.length === 0, company, address, email, missing }
|
||||
}
|
||||
Reference in new issue
Block a user