Files
breakpilot-compliance/admin-compliance/lib/sdk/drafting-engine/rag-config.ts
T
Benjamin Admin a28db8f8f0 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>
2026-06-11 00:42:44 +02:00

91 lines
3.2 KiB
TypeScript

/**
* RAG Configuration per Document Type
*
* Maps each ScopeDocumentType to its optimal RAG collection and search query.
* Used by the Drafting Engine to fetch type-specific legal context.
*/
import type { ScopeDocumentType } from '@/lib/sdk/compliance-scope-types'
export interface DocumentRAGConfig {
/** RAG collection name in bp-core-rag-service */
collection: string
/** Optimized search query for this document type */
query: string
}
export const DOCUMENT_RAG_CONFIG: Partial<Record<ScopeDocumentType, DocumentRAGConfig>> = {
dsfa: {
collection: 'bp_dsfa_corpus',
query: 'Art. 35 DSGVO Datenschutz-Folgenabschaetzung DSFA Risikobewertung WP248 EDPB',
},
tom: {
collection: 'bp_compliance_datenschutz',
query: 'Art. 32 DSGVO Sicherheit Verarbeitung TOM technisch-organisatorische Massnahmen EDPB DPbD',
},
vvt: {
collection: 'bp_compliance_gesetze',
query: 'Art. 30 DSGVO Verarbeitungsverzeichnis Dokumentationspflicht DSK Kurzpapier VVT',
},
lf: {
collection: 'bp_compliance_recht',
query: 'Aufbewahrungsfristen Loeschkonzept Art. 17 DSGVO Recht auf Loeschung DSK Kurzpapier',
},
dsi: {
collection: 'bp_compliance_datenschutz',
query: 'Art. 13 Art. 14 DSGVO Transparenz Informationspflicht WP260 EDPB',
},
betroffenenrechte: {
collection: 'bp_compliance_recht',
query: 'Art. 15-22 DSGVO Betroffenenrechte Auskunft Loeschung EDPB Access Right',
},
datenpannen: {
collection: 'bp_compliance_recht',
query: 'Art. 33 Art. 34 DSGVO Datenpanne Meldepflicht EDPB Breach Notification WP250',
},
daten_transfer: {
collection: 'bp_compliance_ce',
query: 'Kapitel V DSGVO Drittlandtransfer SCC EDPB Transfers Supplementary Measures',
},
einwilligung: {
collection: 'bp_compliance_datenschutz',
query: 'Art. 6 Art. 7 DSGVO Einwilligung Widerruf EDPB Consent Guidelines WP259',
},
vertragsmanagement: {
collection: 'bp_compliance_recht',
query: 'AVV Art. 28 DSGVO Vertragsmanagement Auftragsverarbeiter Pruefpflichten',
},
schulung: {
collection: 'bp_compliance_datenschutz',
query: 'Datenschutz Schulung Awareness Sensibilisierung Art. 39 DSGVO Mitarbeiter',
},
audit_log: {
collection: 'bp_compliance_datenschutz',
query: 'Audit Logging Protokollierung Art. 5 Abs. 2 DSGVO Rechenschaftspflicht',
},
risikoanalyse: {
collection: 'bp_compliance_ce',
query: 'Risikoanalyse Risikobewertung Framework DSK Kurzpapier 18 SDM Schutzbedarf',
},
notfallplan: {
collection: 'bp_compliance_recht',
query: 'Notfallplan Incident Response Krisenmanagement Art. 32 DSGVO Wiederherstellung',
},
zertifizierung: {
collection: 'bp_compliance_ce',
query: 'Art. 42 Art. 43 DSGVO Zertifizierung Datenschutz-Siegel EDPB Certification',
},
datenschutzmanagement: {
collection: 'bp_compliance_datenschutz',
query: 'DSMS PDCA Datenschutzmanagement Organisation SDM Standard-Datenschutzmodell',
},
iace_ce_assessment: {
collection: 'bp_compliance_ce',
query: 'AI Act KI-Verordnung CE-Konformitaet Hochrisiko-KI Art. 6 EDPB',
},
av_vertrag: {
collection: 'bp_compliance_recht',
query: 'AVV Art. 28 DSGVO Auftragsverarbeitung Mindestinhalte EDPB Controller Processor',
},
}