diff --git a/admin-compliance/app/sdk/agent/_components/PreScanWizard.tsx b/admin-compliance/app/sdk/agent/_components/PreScanWizard.tsx
index b503ee7b..addadc2f 100644
--- a/admin-compliance/app/sdk/agent/_components/PreScanWizard.tsx
+++ b/admin-compliance/app/sdk/agent/_components/PreScanWizard.tsx
@@ -110,6 +110,34 @@ export function isContextComplete(ctx: ScanContext): boolean {
)
}
+// Track B — consolidation: prefill from the shared CompanyProfile instead of
+// re-asking. Vocabularies differ across modules, so map tolerantly (only fields
+// that map cleanly; the rest the user fills). User-triggered, never silent.
+const DEV_TENANT = '9282a473-5c95-4b3a-bf78-0ecc0ec71d3e'
+const _VALID_LEGAL = new Set(['ag', 'gmbh', 'gmbh_co_kg', 'kg', 'ohg', 'ug', 'ek', 'verein', 'stiftung', 'behoerde'])
+const _INDUSTRY_ALIAS: Record = {
+ maschinenbau: 'manufacturing', industrie: 'manufacturing', manufacturing: 'manufacturing',
+ automotive: 'automotive', oem: 'automotive', saas: 'saas', software: 'saas',
+ ecommerce: 'ecommerce', handel: 'ecommerce', banking: 'banking', finance: 'banking',
+ insurance: 'insurance', versicherung: 'insurance', healthcare: 'healthcare', gesundheit: 'healthcare',
+ bildung: 'education', education: 'education', medien: 'media', media: 'media',
+ verwaltung: 'public', public: 'public',
+}
+const _SIZE_TO_EMP: Record = {
+ micro: 'lt10', small: '20_49', medium: '50_249', large: '250_499', enterprise: '1000_plus',
+}
+
+function mapProfileToScanContext(p: any): Partial {
+ const out: Partial = {}
+ const lf = String(p.legal_form || '').toLowerCase().replace(/[^a-z_]/g, '')
+ if (_VALID_LEGAL.has(lf)) out.legal_form = lf
+ const ind = String(Array.isArray(p.industry) ? p.industry[0] : (p.industry || '')).toLowerCase().trim()
+ if (_INDUSTRY_ALIAS[ind]) out.industry = _INDUSTRY_ALIAS[ind]
+ const size = String(p.company_size || '').toLowerCase()
+ if (_SIZE_TO_EMP[size]) out.employee_count = _SIZE_TO_EMP[size]
+ return out
+}
+
export function PreScanWizard({
value,
onChange,
@@ -117,6 +145,14 @@ export function PreScanWizard({
value: ScanContext
onChange: (ctx: ScanContext) => void
}) {
+ const [profile, setProfile] = useState(null)
+ useEffect(() => {
+ fetch(`/api/sdk/v1/company-profile?tenant_id=${DEV_TENANT}`)
+ .then((r) => (r.ok ? r.json() : null))
+ .then((p) => { if (p && p.company_name) setProfile(p) })
+ .catch(() => {})
+ }, [])
+
const update = (key: K, val: ScanContext[K]) => {
onChange({ ...value, [key]: val })
}
@@ -149,6 +185,24 @@ export function PreScanWizard({
Einschätzung statt pauschaler Verstoss-Listen.
+ {profile && (
+
+ Unternehmensprofil erkannt: {profile.company_name}
+ {profile.industry ? ` · ${Array.isArray(profile.industry) ? profile.industry.join(', ') : profile.industry}` : ''}
+ {profile.legal_form ? ` · ${profile.legal_form}` : ''}
+ {profile.company_size ? ` · ${profile.company_size}` : ''}
+ {' '}— diese Angaben müssen Sie nicht erneut eingeben.
+
+
+ )}
+