Barrel-split pattern: each original becomes a thin re-export barrel; logic moved to sibling files so no consumer imports need updating. Files split: - loeschfristen-profiling.ts → profiling-data.ts + profiling-generator.ts - vendor-compliance/catalog/vendor-templates.ts → vendor-country-profiles.ts - vendor-compliance/catalog/legal-basis.ts → legal-basis-retention.ts - dsfa/eu-legal-frameworks.ts → eu-legal-frameworks-national.ts - compliance-scope-types/document-scope-matrix-core.ts → core-part2.ts - compliance-scope-types/document-scope-matrix-extended.ts → extended-part2.ts - app/sdk/document-generator/contextBridge.ts → contextBridge-helpers.ts - app/api/sdk/drafting-engine/draft/route.ts → draft-helpers.ts + draft-helpers-v2.ts All files ≤ 500 LOC. Zero behavior changes. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
283 lines
12 KiB
TypeScript
283 lines
12 KiB
TypeScript
/**
|
|
* EU/EWR Rechtsgrundlagen pro Land
|
|
*
|
|
* Strukturierter Katalog der datenschutzrechtlichen Grundlagen fuer EU/EWR/DACH.
|
|
* 3-Schicht-Architektur: EU-Basis → Nationale Ergaenzungen → Dokumentspezifische Bausteine.
|
|
*
|
|
* Quellen: Amtliche Rechtstexte (gemeinfrei gemaess §5 UrhG / Art. 1 EU-Beschluss 2011/833/EU),
|
|
* EDPB-Leitlinien (CC-BY-4.0), nationale Aufsichtsbehoerden.
|
|
*/
|
|
|
|
// =============================================================================
|
|
// Types
|
|
// =============================================================================
|
|
|
|
export type CountryCode =
|
|
| 'EU' // EU-weite Basis
|
|
| 'DE' // Deutschland
|
|
| 'AT' // Oesterreich
|
|
| 'CH' // Schweiz (nicht EU, eigenes DSG)
|
|
| 'FR' // Frankreich
|
|
| 'ES' // Spanien
|
|
| 'IT' // Italien
|
|
| 'NL' // Niederlande
|
|
| 'GB' // Grossbritannien (post-Brexit)
|
|
| 'NO' // Norwegen (EWR)
|
|
| 'IS' // Island (EWR)
|
|
|
|
export type LegalDocumentType =
|
|
| 'regulation' // EU-Verordnung (unmittelbar geltendes Recht)
|
|
| 'directive' // EU-Richtlinie (nationale Umsetzung noetig)
|
|
| 'national_law' // Nationales Gesetz
|
|
| 'guideline' // Behoerdliche Leitlinie
|
|
| 'supervisory' // Aufsichtsbehoerden-Praxis
|
|
|
|
export type LicenseType =
|
|
| 'PUBLIC_DOMAIN' // Amtliche Werke, gemeinfrei
|
|
| 'CC-BY-4.0' // Creative Commons Attribution
|
|
| 'OGL-3.0' // UK Open Government Licence
|
|
| 'DL-DE-BY-2.0' // Datenlizenz Deutschland
|
|
|
|
/** Welche SDK-Dokumenttypen sind EU-weit einheitlich vs. laenderspezifisch? */
|
|
export type DocumentUniformity = 'eu_uniform' | 'needs_national_supplement' | 'country_specific'
|
|
|
|
// =============================================================================
|
|
// Interfaces
|
|
// =============================================================================
|
|
|
|
export interface LegalFramework {
|
|
id: string
|
|
countryCode: CountryCode
|
|
name: string
|
|
fullName: string
|
|
abbreviation: string
|
|
type: LegalDocumentType
|
|
description: string
|
|
sourceUrl: string | null
|
|
license: LicenseType
|
|
licenseNote: string
|
|
/** Welche DSGVO-Oeffnungsklauseln bedient dieses Gesetz? */
|
|
gdprOpeningClauses?: string[]
|
|
/** Spezialregelungen, die ueber die DSGVO hinausgehen */
|
|
specialProvisions?: string[]
|
|
/** Zustaendige Aufsichtsbehoerde(n) */
|
|
supervisoryAuthorities?: SupervisoryAuthority[]
|
|
/** Relevanz-Phase: wann sollte diese Quelle ins RAG? */
|
|
ragPhase: 1 | 2 | 3
|
|
}
|
|
|
|
export interface SupervisoryAuthority {
|
|
name: string
|
|
abbreviation: string
|
|
url: string
|
|
country: CountryCode
|
|
}
|
|
|
|
export interface DocumentTypeMatrix {
|
|
documentType: string
|
|
label: string
|
|
uniformity: DocumentUniformity
|
|
description: string
|
|
/** Welche Laender brauchen spezifische Logik? */
|
|
countrySpecificNotes?: Record<CountryCode, string>
|
|
}
|
|
|
|
// =============================================================================
|
|
// EU-Basis (Phase 1 — gilt fuer gesamte EU/EWR)
|
|
// =============================================================================
|
|
|
|
export const EU_BASE_FRAMEWORKS: LegalFramework[] = [
|
|
{
|
|
id: 'EU-GDPR',
|
|
countryCode: 'EU',
|
|
name: 'DSGVO / GDPR',
|
|
fullName: 'Verordnung (EU) 2016/679 — Datenschutz-Grundverordnung',
|
|
abbreviation: 'DSGVO',
|
|
type: 'regulation',
|
|
description:
|
|
'Die EU-Datenschutz-Grundverordnung gilt unmittelbar in allen EU-Mitgliedstaaten. ' +
|
|
'GDPR und DSGVO sind identisch — nur unterschiedliche Sprachfassungen derselben Verordnung. ' +
|
|
'Kern des europaeischen Datenschutzrechts.',
|
|
sourceUrl: 'https://eur-lex.europa.eu/eli/reg/2016/679/oj/deu',
|
|
license: 'CC-BY-4.0',
|
|
licenseNote: 'EU-Recht, EUR-Lex, Wiederverwendung gemaess Beschluss 2011/833/EU',
|
|
ragPhase: 1,
|
|
},
|
|
{
|
|
id: 'EU-EPRIVACY',
|
|
countryCode: 'EU',
|
|
name: 'ePrivacy-Richtlinie',
|
|
fullName: 'Richtlinie 2002/58/EG — Datenschutz in der elektronischen Kommunikation',
|
|
abbreviation: 'ePrivacy-RL',
|
|
type: 'directive',
|
|
description:
|
|
'Ergaenzt die DSGVO fuer elektronische Kommunikation (Cookies, Tracking, Direktmarketing). ' +
|
|
'Als Richtlinie national umgesetzt (DE: TTDSG, FR: Loi Informatique et Libertés, etc.).',
|
|
sourceUrl: 'https://eur-lex.europa.eu/eli/dir/2002/58/oj',
|
|
license: 'CC-BY-4.0',
|
|
licenseNote: 'EU-Recht, EUR-Lex, Wiederverwendung gemaess Beschluss 2011/833/EU',
|
|
ragPhase: 1,
|
|
},
|
|
{
|
|
id: 'EU-AI-ACT',
|
|
countryCode: 'EU',
|
|
name: 'AI Act',
|
|
fullName: 'Verordnung (EU) 2024/1689 — KI-Verordnung',
|
|
abbreviation: 'AI Act',
|
|
type: 'regulation',
|
|
description:
|
|
'EU-weite Regulierung kuenstlicher Intelligenz. Risikobasierter Ansatz mit Verboten (Art. 5), ' +
|
|
'Hochrisiko-Anforderungen und Transparenzpflichten. Gilt unmittelbar in allen Mitgliedstaaten.',
|
|
sourceUrl: 'https://eur-lex.europa.eu/eli/reg/2024/1689/oj/deu',
|
|
license: 'CC-BY-4.0',
|
|
licenseNote: 'EU-Recht, EUR-Lex, Wiederverwendung gemaess Beschluss 2011/833/EU',
|
|
ragPhase: 1,
|
|
},
|
|
{
|
|
id: 'EU-EDPB',
|
|
countryCode: 'EU',
|
|
name: 'EDPB-Leitlinien',
|
|
fullName: 'Leitlinien des Europaeischen Datenschutzausschusses',
|
|
abbreviation: 'EDPB',
|
|
type: 'guideline',
|
|
description:
|
|
'Verbindliche Auslegungshilfen zur DSGVO (z.B. DSFA, Art. 25, Art. 28, Drittlandtransfer, ' +
|
|
'Pseudonymisierung). Gelten als autoritaetive Rechtsquelle in der gesamten EU.',
|
|
sourceUrl: 'https://edpb.europa.eu/our-work-tools/general-guidance/guidelines-recommendations-best-practices_en',
|
|
license: 'CC-BY-4.0',
|
|
licenseNote: 'EDPB-Publikationen, CC BY 4.0',
|
|
ragPhase: 1,
|
|
},
|
|
]
|
|
|
|
// =============================================================================
|
|
// Dokumenttyp-Matrix: EU-einheitlich vs. laenderspezifisch
|
|
// =============================================================================
|
|
|
|
export const DOCUMENT_TYPE_MATRIX: DocumentTypeMatrix[] = [
|
|
{ documentType: 'privacy_policy', label: 'Datenschutzerklaerung', uniformity: 'needs_national_supplement', description: 'DSGVO-Kern EU-weit gleich. Nationale Ergaenzungen fuer ePrivacy-Umsetzung, Behoerden-Praxis.' },
|
|
{ documentType: 'ropa', label: 'Verarbeitungsverzeichnis (VVT)', uniformity: 'eu_uniform', description: 'Art. 30 DSGVO — EU-weit identische Anforderungen.' },
|
|
{ documentType: 'tom', label: 'Technisch-Organisatorische Massnahmen', uniformity: 'eu_uniform', description: 'Art. 32 DSGVO — EU-weit identische Anforderungen.' },
|
|
{ documentType: 'dpia', label: 'Datenschutz-Folgenabschaetzung (DSFA)', uniformity: 'eu_uniform', description: 'Art. 35 DSGVO — EU-weit identisch. Muss-Listen variieren je Aufsichtsbehoerde.' },
|
|
{ documentType: 'dpa', label: 'Auftragsverarbeitungsvertrag (AVV)', uniformity: 'eu_uniform', description: 'Art. 28 DSGVO — EU-weit identische Anforderungen.' },
|
|
{ documentType: 'deletion_concept', label: 'Loeschkonzept', uniformity: 'eu_uniform', description: 'Art. 5(1)(e), Art. 17 DSGVO — EU-weit einheitlich.' },
|
|
{ documentType: 'breach_process', label: 'Data Breach / Incident Response', uniformity: 'eu_uniform', description: 'Art. 33-34 DSGVO — EU-weit identische 72-Stunden-Frist.' },
|
|
{ documentType: 'dsar_process', label: 'Betroffenenrechte-Prozess (DSAR)', uniformity: 'eu_uniform', description: 'Art. 12-22 DSGVO — EU-weit identische Rechte und Fristen.' },
|
|
{
|
|
documentType: 'imprint',
|
|
label: 'Impressum',
|
|
uniformity: 'country_specific',
|
|
description: 'Kein DSGVO-Thema. Nationale Mediengesetze (DE: §5 TMG, AT: §5 ECG, CH: eigene Regeln).',
|
|
countrySpecificNotes: {
|
|
'EU': 'Keine EU-weite Regelung',
|
|
'DE': '§5 TMG / DDG — strenge Impressumspflicht',
|
|
'AT': '§5 ECG — aehnlich wie DE, nicht identisch',
|
|
'CH': 'Obligationenrecht + kantonale Regeln',
|
|
'FR': 'Loi pour la Confiance dans l\'Économie Numérique (LCEN)',
|
|
'ES': 'LSSI-CE Art. 10',
|
|
'IT': 'D.Lgs. 70/2003',
|
|
'NL': 'Handelsregisterpflicht + BW',
|
|
'GB': 'Companies Act 2006',
|
|
'NO': 'E-handelsloven',
|
|
'IS': 'Rafraeðislög',
|
|
},
|
|
},
|
|
{ documentType: 'terms_of_service', label: 'AGB / Nutzungsbedingungen', uniformity: 'country_specific', description: 'Nationales Vertragsrecht (BGB, ABGB, OR). Verbraucherrecht teils EU-harmonisiert, aber national umgesetzt.' },
|
|
{ documentType: 'withdrawal_notice', label: 'Widerrufsbelehrung', uniformity: 'country_specific', description: 'EU-Verbraucherrechterichtlinie national umgesetzt. DE/AT: Muster-Widerrufsbelehrung. CH: eigene Logik.' },
|
|
{ documentType: 'cookie_banner', label: 'Cookie-Banner / Consent', uniformity: 'needs_national_supplement', description: 'ePrivacy + DSGVO EU-weit aehnlich, aber Aufsichtspraxis variiert (CNIL vs. DSK vs. DPC etc.).' },
|
|
]
|
|
|
|
// =============================================================================
|
|
// RAG-Schichtmodell
|
|
// =============================================================================
|
|
|
|
export interface RAGLayer {
|
|
phase: 1 | 2 | 3
|
|
name: string
|
|
description: string
|
|
scope: string
|
|
sources: string[]
|
|
}
|
|
|
|
export const RAG_LAYERS: RAGLayer[] = [
|
|
{
|
|
phase: 1,
|
|
name: 'EU-Basis',
|
|
description: 'Einmal laden — gilt fuer gesamte EU/EWR (ausser CH)',
|
|
scope: 'EU/EWR',
|
|
sources: [
|
|
'DSGVO Volltext (EU 2016/679)',
|
|
'ePrivacy-Richtlinie (2002/58/EG)',
|
|
'AI Act (EU 2024/1689)',
|
|
'EDPB-Leitlinien (DSFA, Art. 25, Art. 28, Art. 32, Drittlandtransfer etc.)',
|
|
],
|
|
},
|
|
{
|
|
phase: 2,
|
|
name: 'Nationale Ergaenzungen',
|
|
description: 'Modular pro Land — nationale Begleitgesetze zur DSGVO',
|
|
scope: 'Je Land',
|
|
sources: [
|
|
'DE: BDSG, TTDSG, DSK-Kurzpapiere',
|
|
'AT: DSG (AT), DSB-Entscheidungen',
|
|
'CH: revDSG, EDOEB-Leitlinien (separater Stack!)',
|
|
'FR: Loi Informatique et Libertés, CNIL-Leitfaeden',
|
|
'ES: LOPDGDD, AEPD-Leitfaeden',
|
|
'IT: Codice Privacy, Garante-Leitfaeden',
|
|
'NL: UAVG, AP-Leitlinien',
|
|
'GB: UK DPA 2018, ICO Guidance',
|
|
],
|
|
},
|
|
{
|
|
phase: 3,
|
|
name: 'Dokumentspezifische Bausteine',
|
|
description: 'Templates und Mustertexte fuer laenderspezifische Dokumenttypen',
|
|
scope: 'Je Land + Dokumenttyp',
|
|
sources: [
|
|
'Impressum-Templates (DE §5 TMG, AT §5 ECG, CH)',
|
|
'AGB-Bausteine (SaaS/Webshop, B2B/B2C)',
|
|
'Widerrufsbelehrung (DE/AT Muster)',
|
|
'Cookie-Banner-Texte (EU-weit + Feinjustierung)',
|
|
],
|
|
},
|
|
]
|
|
|
|
// =============================================================================
|
|
// Re-exports from national sibling (backward compat — no consumer import changes)
|
|
// =============================================================================
|
|
|
|
export {
|
|
NATIONAL_FRAMEWORKS,
|
|
getAllSupervisoryAuthorities,
|
|
getSupervisoryAuthority,
|
|
getCountrySpecificDocTypes,
|
|
getEUUniformDocTypes,
|
|
isGDPRCountry,
|
|
hasSeparateLegalFramework,
|
|
getRAGSourcesForPhase,
|
|
getRequiredFrameworkSummary,
|
|
} from './eu-legal-frameworks-national'
|
|
|
|
// =============================================================================
|
|
// Helper Functions (EU-level)
|
|
// =============================================================================
|
|
|
|
import { NATIONAL_FRAMEWORKS } from './eu-legal-frameworks-national'
|
|
|
|
/** Alle Rechtsgrundlagen zusammen (EU-Basis + National) */
|
|
export function getAllFrameworks(): LegalFramework[] {
|
|
return [...EU_BASE_FRAMEWORKS, ...NATIONAL_FRAMEWORKS]
|
|
}
|
|
|
|
/** Rechtsgrundlagen fuer ein bestimmtes Land (inkl. EU-Basis) */
|
|
export function getFrameworksForCountry(country: CountryCode): LegalFramework[] {
|
|
return getAllFrameworks().filter(
|
|
f => f.countryCode === country || f.countryCode === 'EU'
|
|
)
|
|
}
|
|
|
|
/** Nur nationale Ergaenzungsgesetze (ohne EU-Basis) */
|
|
export function getNationalFrameworks(country: CountryCode): LegalFramework[] {
|
|
return NATIONAL_FRAMEWORKS.filter(f => f.countryCode === country)
|
|
}
|