\s*<\/p>/g, '')
+
+ return html
+}
+
+// ============================================================================
+// Component
+// ============================================================================
+
export default function GeneratorPreviewTab({
template,
ruleResult,
@@ -20,12 +87,17 @@ export default function GeneratorPreviewTab({
onCopy,
onExportMarkdown,
}: GeneratorPreviewTabProps) {
+ const [viewMode, setViewMode] = useState<'preview' | 'markdown'>('preview')
+
+ const htmlContent = markdownToHtml(renderedContent)
+
return (
+ {/* Violations */}
{ruleResult && ruleResult.violations.length > 0 && (
- 🔴 {ruleResult.violations.length} Fehler
+ {ruleResult.violations.length} Fehler
{ruleResult.violations.map((v) => (
@@ -36,6 +108,8 @@ export default function GeneratorPreviewTab({
)}
+
+ {/* Warnings */}
{ruleResult && ruleResult.warnings.filter((w) => w.id !== 'WARN_LEGAL_REVIEW').length > 0 && (
@@ -43,69 +117,133 @@ export default function GeneratorPreviewTab({
.filter((w) => w.id !== 'WARN_LEGAL_REVIEW')
.map((w) => (
- 🟡 [{w.id}] {w.message}
+ [{w.id}] {w.message}
))}
)}
+
+ {/* Legal notice */}
{ruleResult && (
- ℹ️ Rechtlicher Hinweis: Diese Vorlage ist MIT-lizenziert. Vor Produktionseinsatz
- wird eine rechtliche Überprüfung dringend empfohlen.
+ Rechtlicher Hinweis: Diese Vorlage ist MIT-lizenziert. Vor Produktionseinsatz
+ wird eine rechtliche Ueberpruefung dringend empfohlen.
)}
- {ruleResult && ruleResult.appliedDefaults.length > 0 && (
-
- Defaults angewendet: {ruleResult.appliedDefaults.join(', ')}
-
- )}
+ {/* Toolbar */}
-
- {missing.length > 0 && (
-
- ⚠ {missing.length} Platzhalter noch nicht ausgefüllt
-
- )}
-
-
+
setViewMode('preview')}
+ className={`px-3 py-1 text-xs font-medium rounded-md transition-colors ${
+ viewMode === 'preview' ? 'bg-white text-gray-900 shadow-sm' : 'text-gray-500'
+ }`}
>
-
-
-
- Kopieren
+ Vorschau
setViewMode('markdown')}
+ className={`px-3 py-1 text-xs font-medium rounded-md transition-colors ${
+ viewMode === 'markdown' ? 'bg-white text-gray-900 shadow-sm' : 'text-gray-500'
+ }`}
>
-
-
-
+ Markdown
+
+
+
+
+ {missing.length > 0 && (
+
+ {missing.length} Platzhalter offen
+
+ )}
+
+ Kopieren
+
+
Markdown
window.print()}
- className="flex items-center gap-1.5 px-4 py-1.5 text-xs bg-purple-600 text-white rounded-lg hover:bg-purple-700 transition-colors"
+ onClick={() => {
+ const printWindow = window.open('', '_blank')
+ if (!printWindow) return
+ printWindow.document.write(`${template.documentTitle || 'Dokument'} ${htmlContent}`)
+ printWindow.document.close()
+ printWindow.print()
+ }}
+ className="px-4 py-1.5 text-xs bg-purple-600 text-white rounded-lg hover:bg-purple-700"
>
-
-
-
PDF drucken
-
-
- {renderedContent}
-
-
+
+ {/* Content */}
+ {viewMode === 'markdown' ? (
+
+
+ {renderedContent}
+
+
+ ) : (
+
+ )}
+
+ {/* Attribution */}
{template.attributionRequired && template.attributionText && (
Attribution erforderlich: {template.attributionText}
diff --git a/admin-compliance/app/sdk/document-generator/_components/GeneratorSection.tsx b/admin-compliance/app/sdk/document-generator/_components/GeneratorSection.tsx
index 01a722c..ea313e6 100644
--- a/admin-compliance/app/sdk/document-generator/_components/GeneratorSection.tsx
+++ b/admin-compliance/app/sdk/document-generator/_components/GeneratorSection.tsx
@@ -160,6 +160,33 @@ export default function GeneratorSection({
)}
+
+ {
+ // Load example data for current template type
+ const templateType = template.templateType || ''
+ const lang = template.language || 'de'
+ const exampleFile = `/sdk/document-generator/examples/${templateType}_${lang}.json`
+ fetch(exampleFile)
+ .then(r => r.ok ? r.json() : null)
+ .then(data => {
+ if (!data?.context) return
+ const ctx = data.context
+ for (const [section, fields] of Object.entries(ctx)) {
+ if (typeof fields === 'object' && fields) {
+ for (const [key, value] of Object.entries(fields as Record)) {
+ onContextChange(section as keyof TemplateContext, key, value)
+ }
+ }
+ }
+ })
+ .catch(() => {/* no example available */})
+ }}
+ className="px-3 py-1 text-xs bg-blue-50 text-blue-600 border border-blue-200 rounded-lg hover:bg-blue-100 transition-colors"
+ >
+ Beispieldaten
+
+
diff --git a/admin-compliance/lib/sdk/company-profile-presets.ts b/admin-compliance/lib/sdk/company-profile-presets.ts
new file mode 100644
index 0000000..3b02814
--- /dev/null
+++ b/admin-compliance/lib/sdk/company-profile-presets.ts
@@ -0,0 +1,306 @@
+/**
+ * Company Profile Presets — Branchenvorlagen fuer typische Kundenszenarien
+ *
+ * Jeder Preset enthaelt ein vorbefuelltes CompanyProfile + typische Scope-Antworten.
+ * Der Kunde waehlt beim Onboarding ein Profil und passt es dann an.
+ */
+
+export interface CompanyProfilePreset {
+ id: string
+ label: string
+ description: string
+ icon: string
+ /** Vorbefuellte CompanyProfile-Felder */
+ profile: {
+ legalForm: string
+ industry: string[]
+ businessModel: string
+ companySize: string
+ employeeCount: string
+ headquartersCountry: string
+ targetMarkets: string[]
+ isDataController: boolean
+ isDataProcessor: boolean
+ }
+ /** Typische Scope-Antworten fuer diese Branche */
+ scopeHints: Record
+ /** Typische Dokumente die diese Branche braucht */
+ recommendedDocs: string[]
+}
+
+export const COMPANY_PROFILE_PRESETS: CompanyProfilePreset[] = [
+ {
+ id: 'saas_startup',
+ label: 'SaaS Startup',
+ description: 'B2B Software-Startup, 1-5 Mitarbeiter, Cloud-basiert, remote-first',
+ icon: '🚀',
+ profile: {
+ legalForm: 'GmbH',
+ industry: ['tech'],
+ businessModel: 'b2b',
+ companySize: 'micro',
+ employeeCount: '1-9',
+ headquartersCountry: 'DE',
+ targetMarkets: ['DE', 'EU'],
+ isDataController: true,
+ isDataProcessor: true,
+ },
+ scopeHints: {
+ org_employee_count: '1-9',
+ org_industry: 'tech',
+ org_business_model: 'b2b',
+ proc_ai_usage: 'yes',
+ tech_hosting_location: 'eu',
+ tech_encryption_transit: 'yes',
+ tech_encryption_rest: 'yes',
+ comp_documentation_level: 'basic',
+ },
+ recommendedDocs: ['privacy_policy', 'impressum', 'agb', 'cookie_policy', 'dpa'],
+ },
+ {
+ id: 'consumer_app',
+ label: 'App Startup (Consumer)',
+ description: 'B2C Mobile App, 1-5 Mitarbeiter, App Store, Nutzerdaten',
+ icon: '📱',
+ profile: {
+ legalForm: 'GmbH',
+ industry: ['tech'],
+ businessModel: 'b2c',
+ companySize: 'micro',
+ employeeCount: '1-9',
+ headquartersCountry: 'DE',
+ targetMarkets: ['DE', 'EU'],
+ isDataController: true,
+ isDataProcessor: false,
+ },
+ scopeHints: {
+ org_employee_count: '1-9',
+ org_industry: 'tech',
+ org_business_model: 'b2c',
+ data_volume: '1000-10000',
+ proc_tracking: 'yes',
+ prod_consent_management: 'yes',
+ tech_hosting_location: 'eu',
+ },
+ recommendedDocs: ['privacy_policy', 'impressum', 'terms_of_use', 'cookie_policy', 'community_guidelines'],
+ },
+ {
+ id: 'ecommerce',
+ label: 'E-Commerce / Online-Shop',
+ description: 'Online-Handel B2C, 5-20 Mitarbeiter, Webshop, Zahlungsabwicklung',
+ icon: '🛒',
+ profile: {
+ legalForm: 'GmbH',
+ industry: ['retail'],
+ businessModel: 'b2c',
+ companySize: 'small',
+ employeeCount: '10-49',
+ headquartersCountry: 'DE',
+ targetMarkets: ['DE', 'EU'],
+ isDataController: true,
+ isDataProcessor: false,
+ },
+ scopeHints: {
+ org_employee_count: '10-49',
+ org_industry: 'retail',
+ org_business_model: 'b2c',
+ prod_webshop: 'yes',
+ data_volume: '10000-100000',
+ tech_hosting_location: 'eu',
+ prod_consent_management: 'yes',
+ },
+ recommendedDocs: ['privacy_policy', 'impressum', 'agb', 'widerruf', 'cookie_policy', 'cookie_banner'],
+ },
+ {
+ id: 'it_agency',
+ label: 'IT-Dienstleister / Agentur',
+ description: 'IT-Beratung oder Agentur, 10-50 Mitarbeiter, Kundenprojekte',
+ icon: '💻',
+ profile: {
+ legalForm: 'GmbH',
+ industry: ['tech'],
+ businessModel: 'b2b',
+ companySize: 'small',
+ employeeCount: '10-49',
+ headquartersCountry: 'DE',
+ targetMarkets: ['DE', 'EU'],
+ isDataController: true,
+ isDataProcessor: true,
+ },
+ scopeHints: {
+ org_employee_count: '10-49',
+ org_industry: 'tech',
+ org_business_model: 'b2b',
+ proc_ai_usage: 'yes',
+ tech_hosting_location: 'eu',
+ comp_vendor_management: 'yes',
+ comp_training: 'yes',
+ },
+ recommendedDocs: ['privacy_policy', 'impressum', 'agb', 'dpa', 'nda', 'employee_dsi'],
+ },
+ {
+ id: 'maschinenbau',
+ label: 'Maschinenbau KMU',
+ description: 'Maschinenbau B2B, 50-200 Mitarbeiter, Produktion, CE-Kennzeichnung',
+ icon: '🏭',
+ profile: {
+ legalForm: 'GmbH',
+ industry: ['manufacturing'],
+ businessModel: 'b2b',
+ companySize: 'medium',
+ employeeCount: '50-249',
+ headquartersCountry: 'DE',
+ targetMarkets: ['DE', 'EU'],
+ isDataController: true,
+ isDataProcessor: false,
+ },
+ scopeHints: {
+ org_employee_count: '50-249',
+ org_industry: 'manufacturing',
+ org_business_model: 'b2b',
+ proc_employee_monitoring: 'no',
+ tech_hosting_location: 'eu',
+ comp_vendor_management: 'yes',
+ comp_documentation_level: 'structured',
+ },
+ recommendedDocs: ['privacy_policy', 'impressum', 'agb', 'dpa', 'employee_dsi', 'applicant_dsi', 'whistleblower_policy', 'tom_documentation'],
+ },
+ {
+ id: 'law_firm',
+ label: 'Rechtsanwaltskanzlei',
+ description: 'Kanzlei, 5-20 Mitarbeiter, Mandantendaten, besondere Vertraulichkeit',
+ icon: '⚖️',
+ profile: {
+ legalForm: 'PartG',
+ industry: ['legal'],
+ businessModel: 'b2b',
+ companySize: 'small',
+ employeeCount: '1-9',
+ headquartersCountry: 'DE',
+ targetMarkets: ['DE'],
+ isDataController: true,
+ isDataProcessor: false,
+ },
+ scopeHints: {
+ org_employee_count: '1-9',
+ org_industry: 'legal',
+ org_business_model: 'b2b',
+ data_art9: 'no',
+ tech_encryption_transit: 'yes',
+ tech_encryption_rest: 'yes',
+ comp_documentation_level: 'basic',
+ },
+ recommendedDocs: ['privacy_policy', 'impressum', 'dpa', 'employee_dsi', 'applicant_dsi'],
+ },
+ {
+ id: 'healthcare',
+ label: 'Arztpraxis / Gesundheit',
+ description: 'Gesundheitswesen, 5-50 Mitarbeiter, Patientendaten (Art. 9), hoher Schutzbedarf',
+ icon: '🏥',
+ profile: {
+ legalForm: 'GbR',
+ industry: ['healthcare'],
+ businessModel: 'b2c',
+ companySize: 'small',
+ employeeCount: '1-9',
+ headquartersCountry: 'DE',
+ targetMarkets: ['DE'],
+ isDataController: true,
+ isDataProcessor: false,
+ },
+ scopeHints: {
+ org_employee_count: '1-9',
+ org_industry: 'healthcare',
+ org_business_model: 'b2c',
+ data_art9: 'yes',
+ tech_encryption_transit: 'yes',
+ tech_encryption_rest: 'yes',
+ comp_documentation_level: 'basic',
+ },
+ recommendedDocs: ['privacy_policy', 'impressum', 'dpa', 'employee_dsi', 'tom_documentation', 'vvt_register', 'dsfa'],
+ },
+ {
+ id: 'handwerk',
+ label: 'Handwerksbetrieb',
+ description: 'Handwerk, 5-20 Mitarbeiter, Kundendaten, einfache IT',
+ icon: '🔧',
+ profile: {
+ legalForm: 'GmbH',
+ industry: ['crafts'],
+ businessModel: 'b2c',
+ companySize: 'small',
+ employeeCount: '1-9',
+ headquartersCountry: 'DE',
+ targetMarkets: ['DE'],
+ isDataController: true,
+ isDataProcessor: false,
+ },
+ scopeHints: {
+ org_employee_count: '1-9',
+ org_industry: 'other',
+ org_business_model: 'b2c',
+ data_art9: 'no',
+ tech_hosting_location: 'eu',
+ comp_documentation_level: 'none',
+ },
+ recommendedDocs: ['privacy_policy', 'impressum', 'agb'],
+ },
+ {
+ id: 'education',
+ label: 'Bildungseinrichtung',
+ description: 'Schule, Hochschule oder Weiterbildung, 20-100 Mitarbeiter, Schuelerdaten',
+ icon: '🎓',
+ profile: {
+ legalForm: 'gGmbH',
+ industry: ['education'],
+ businessModel: 'b2c',
+ companySize: 'medium',
+ employeeCount: '10-49',
+ headquartersCountry: 'DE',
+ targetMarkets: ['DE'],
+ isDataController: true,
+ isDataProcessor: false,
+ },
+ scopeHints: {
+ org_employee_count: '10-49',
+ org_industry: 'education',
+ org_business_model: 'b2c',
+ data_minors: 'yes',
+ tech_hosting_location: 'eu',
+ comp_training: 'yes',
+ },
+ recommendedDocs: ['privacy_policy', 'impressum', 'dpa', 'employee_dsi', 'dsfa', 'tom_documentation'],
+ },
+ {
+ id: 'enterprise',
+ label: 'Konzern / Enterprise',
+ description: 'Grossunternehmen, 500+ Mitarbeiter, international, reguliert, ISO 27001',
+ icon: '🏢',
+ profile: {
+ legalForm: 'AG',
+ industry: ['finance'],
+ businessModel: 'b2b',
+ companySize: 'enterprise',
+ employeeCount: '1000+',
+ headquartersCountry: 'DE',
+ targetMarkets: ['DE', 'EU', 'US'],
+ isDataController: true,
+ isDataProcessor: true,
+ },
+ scopeHints: {
+ org_employee_count: '1000+',
+ org_industry: 'finance',
+ org_business_model: 'b2b',
+ org_cert_target: 'iso27001',
+ data_art9: 'yes',
+ data_volume: '>1000000',
+ proc_ai_usage: 'yes',
+ tech_third_country: 'yes',
+ tech_hosting_location: 'eu_us_adequacy',
+ comp_vendor_management: 'yes',
+ comp_training: 'yes',
+ comp_documentation_level: 'comprehensive',
+ },
+ recommendedDocs: ['privacy_policy', 'impressum', 'agb', 'dpa', 'nda', 'sla', 'employee_dsi', 'applicant_dsi', 'whistleblower_policy', 'tom_documentation', 'vvt_register', 'isms_manual', 'dsfa', 'transfer_impact_assessment'],
+ },
+]