fix(admin): resolve all 266 TypeScript errors, enable strict build
Eliminate the pre-existing TS errors that were masked by next.config.js `typescript.ignoreBuildErrors: true`, then turn the flag OFF so the compiler is a real safety net for future changes. `next build` and `tsc --noEmit` now pass with 0 errors. The errors were not cosmetic — several exposed real latent bugs hidden by the flag, e.g. the drafting-engine ConstraintEnforcer read non-existent fields (`t.rule.dsfaRequired`, `d.required`, `r.title`), so its DSFA hard gate and risk-flag checks were silently no-ops; scopeDefaults read snake_case CompanyProfile fields that never matched the camelCase type (generator defaults never populated). Both fixed by aligning code to the current types. Highlights: - Vitest globals: add vitest-globals.d.ts (config already had globals:true) so the test files type-check; exclude Playwright specs from vitest. - Add a minimal ambient `pg` module declaration (no @types/pg installed). - Fix Next 15 route handlers to await Promise params. - Reconcile drifted types across loeschfristen, compliance-scope, document- generator, drafting-engine, vendor-compliance, agent and more. Pre-existing (NOT caused here, proven by stashing the diff): 3 vitest logic tests still fail — getNextStep (2) and buildDocumentScope priority (1). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -153,7 +153,7 @@ export default function SDKDashboard() {
|
||||
</div>
|
||||
<div>
|
||||
<h3 className="font-semibold text-gray-900">Erkannte Regulierungen</h3>
|
||||
<p className="text-xs text-gray-500">Basierend auf Ihrem Scope-Profiling (Level {state.complianceScope.decision.level})</p>
|
||||
<p className="text-xs text-gray-500">Basierend auf Ihrem Scope-Profiling (Level {state.complianceScope.decision.determinedLevel})</p>
|
||||
</div>
|
||||
</div>
|
||||
<Link href={projectId ? `/sdk/compliance-scope?project=${projectId}` : '/sdk/compliance-scope'}
|
||||
@@ -165,11 +165,11 @@ export default function SDKDashboard() {
|
||||
{(state.complianceScope.decision.requiredDocuments || []).length > 0 ? (
|
||||
['DSGVO', 'AI Act', 'NIS2', 'HinSchG', 'TTDSG'].filter(reg => {
|
||||
const docs = state.complianceScope?.decision?.requiredDocuments || []
|
||||
const triggers = state.complianceScope?.decision?.hardTriggers || []
|
||||
const triggers = state.complianceScope?.decision?.triggeredHardTriggers || []
|
||||
if (reg === 'DSGVO') return true
|
||||
if (reg === 'AI Act') return triggers.some((t: string) => t.toLowerCase().includes('ai') || t.toLowerCase().includes('ki'))
|
||||
if (reg === 'NIS2') return triggers.some((t: string) => t.toLowerCase().includes('nis') || t.toLowerCase().includes('kritisch'))
|
||||
if (reg === 'HinSchG') return triggers.some((t: string) => t.toLowerCase().includes('whistleblower') || t.toLowerCase().includes('hinweis'))
|
||||
if (reg === 'AI Act') return triggers.some((t) => t.ruleId.toLowerCase().includes('ai') || t.ruleId.toLowerCase().includes('ki'))
|
||||
if (reg === 'NIS2') return triggers.some((t) => t.ruleId.toLowerCase().includes('nis') || t.ruleId.toLowerCase().includes('kritisch'))
|
||||
if (reg === 'HinSchG') return triggers.some((t) => t.ruleId.toLowerCase().includes('whistleblower') || t.ruleId.toLowerCase().includes('hinweis'))
|
||||
return false
|
||||
}).map(reg => (
|
||||
<span key={reg} className="px-3 py-1.5 bg-green-50 text-green-700 border border-green-200 rounded-lg text-sm font-medium">
|
||||
|
||||
Reference in New Issue
Block a user