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:
Benjamin Admin
2026-06-11 00:42:44 +02:00
parent bb9aacc3d3
commit a28db8f8f0
76 changed files with 280 additions and 190 deletions
@@ -165,6 +165,44 @@ export interface FeaturesCtx {
HAS_WITHDRAWAL: boolean
CONSUMER_WITHDRAWAL_TEXT: string
SUPPORT_CHANNELS_TEXT: string
// ── Optionale Feature-Template-Variablen (per str() ausgegeben, daher string) ─
// Whistleblower (HinSchG)
WHISTLEBLOWER_CONTACT_NAME?: string
WHISTLEBLOWER_CONTACT_ROLE?: string
WHISTLEBLOWER_EMAIL?: string
WHISTLEBLOWER_PHONE?: string
WHISTLEBLOWER_URL?: string
// Videokonferenz
VIDEO_PROVIDER_NAME?: string
VIDEO_PROVIDER_COUNTRY?: string
VIDEO_PROVIDER_ROLE?: string
VIDEO_PROVIDER_PRIVACY_URL?: string
RECORDING_RETENTION_DAYS?: string
// KI / BYOD / Consent / Social Media
APPROVED_AI_SYSTEMS?: string
BYOD_COST_DETAILS?: string
NEWSLETTER_SIGNUP_URL?: string
SOCIAL_MEDIA_PLATFORMS_LIST?: string
EDITORIAL_EMAIL?: string
// Transfer / SCC (Empfänger im Drittland)
RECIPIENT_NAME?: string
RECIPIENT_COUNTRY?: string
RECIPIENT_ADDRESS?: string
RECIPIENT_CONTACT?: string
RECIPIENT_EMAIL?: string
RECIPIENT_ROLE?: string
TRANSFER_PURPOSE?: string
TRANSFER_MECHANISM?: string
TRANSFER_FREQUENCY?: string
DATA_CATEGORIES_TRANSFERRED?: string
DATA_SUBJECTS?: string
// DSI
DSI_TITLE?: string
SERVICE_SCOPE_DESCRIPTION?: string
FULFILLMENT_LOCATION?: string
GUIDELINES_URL?: string
PROCESSOR_LIST_URL?: string
}
export interface TOMCtx {