Initial commit: breakpilot-compliance - Compliance SDK Platform

Services: Admin-Compliance, Backend-Compliance,
AI-Compliance-SDK, Consent-SDK, Developer-Portal,
PCA-Platform, DSMS

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Benjamin Boenisch
2026-02-11 23:47:28 +01:00
commit 4435e7ea0a
734 changed files with 251369 additions and 0 deletions

View File

@@ -0,0 +1,164 @@
/**
* Extended TypeScript types for Abitur-Archiv
* Builds upon abitur-docs-types.ts with additional search and integration features
*/
import { AbiturDokument, AbiturDocsFilter } from './abitur-docs-types'
// Theme suggestion for autocomplete search
export interface ThemaSuggestion {
label: string // "Gedichtanalyse Romantik"
count: number // 12 Dokumente
aufgabentyp: string // "gedichtanalyse"
zeitraum?: string // "Romantik"
kategorie?: string // Category for grouping
}
// Extended filter with theme search
export interface AbiturArchivFilter extends AbiturDocsFilter {
thema?: string // Semantic theme search query
aufgabentyp?: string // Specific task type filter
}
// Similar document result from RAG
export interface SimilarDocument {
id: string
dateiname: string
similarity_score: number
fach: string
jahr: number
niveau: 'eA' | 'gA'
typ: 'aufgabe' | 'erwartungshorizont'
aufgaben_nummer: string
}
// Extended document with similar documents
export interface AbiturDokumentExtended extends AbiturDokument {
similar_documents?: SimilarDocument[]
themes?: string[] // Extracted themes from content
}
// Response for archive listing
export interface AbiturArchivResponse {
documents: AbiturDokumentExtended[]
total: number
page: number
limit: number
total_pages: number
themes?: ThemaSuggestion[] // Available themes for current filter
}
// Response for theme suggestions
export interface ThemaSuggestResponse {
suggestions: ThemaSuggestion[]
query: string
}
// Response for similar documents
export interface SimilarDocsResponse {
document_id: string
similar: SimilarDocument[]
}
// Klausur creation from archive
export interface KlausurFromArchivRequest {
archiv_dokument_id: string
aufgabentyp: string
title?: string
}
export interface KlausurFromArchivResponse {
klausur_id: string
eh_id?: string
success: boolean
message?: string
}
// View mode for document display
export type ViewMode = 'grid' | 'list'
// Sort options
export type SortField = 'jahr' | 'fach' | 'datum' | 'dateiname'
export type SortDirection = 'asc' | 'desc'
export interface SortConfig {
field: SortField
direction: SortDirection
}
// Predefined theme categories
export const THEME_CATEGORIES = {
textanalyse: {
label: 'Textanalyse',
subcategories: ['pragmatisch', 'literarisch', 'sachtext', 'rede', 'kommentar']
},
gedichtanalyse: {
label: 'Gedichtanalyse',
subcategories: ['romantik', 'expressionismus', 'barock', 'klassik', 'moderne']
},
dramenanalyse: {
label: 'Dramenanalyse',
subcategories: ['klassisch', 'modern', 'episches_theater']
},
prosaanalyse: {
label: 'Prosaanalyse',
subcategories: ['roman', 'kurzgeschichte', 'novelle', 'erzaehlung']
},
eroerterung: {
label: 'Eroerterung',
subcategories: ['textgebunden', 'materialgestuetzt', 'frei']
},
sprachreflexion: {
label: 'Sprachreflexion',
subcategories: ['sprachwandel', 'sprachkritik', 'kommunikation']
}
} as const
// Popular theme suggestions (static fallback)
export const POPULAR_THEMES: ThemaSuggestion[] = [
{ label: 'Textanalyse', count: 45, aufgabentyp: 'textanalyse_pragmatisch', kategorie: 'Analyse' },
{ label: 'Gedichtanalyse', count: 38, aufgabentyp: 'gedichtanalyse', kategorie: 'Analyse' },
{ label: 'Eroerterung', count: 32, aufgabentyp: 'eroerterung_textgebunden', kategorie: 'Argumentation' },
{ label: 'Dramenanalyse', count: 28, aufgabentyp: 'dramenanalyse', kategorie: 'Analyse' },
{ label: 'Prosaanalyse', count: 25, aufgabentyp: 'prosaanalyse', kategorie: 'Analyse' },
]
// Quick action types for document cards
export type QuickAction = 'preview' | 'download' | 'add_to_klausur' | 'view_similar'
// Fullscreen viewer state
export interface ViewerState {
isFullscreen: boolean
zoom: number
currentPage: number
totalPages: number
}
// Default viewer state
export const DEFAULT_VIEWER_STATE: ViewerState = {
isFullscreen: false,
zoom: 100,
currentPage: 1,
totalPages: 1
}
// Zoom levels
export const ZOOM_LEVELS = [25, 50, 75, 100, 125, 150, 175, 200] as const
export const MIN_ZOOM = 25
export const MAX_ZOOM = 200
export const ZOOM_STEP = 25
// Helper functions
export function getThemeLabel(aufgabentyp: string): string {
const entries = Object.entries(THEME_CATEGORIES)
for (const [key, value] of entries) {
if (aufgabentyp.startsWith(key)) {
return value.label
}
}
return aufgabentyp
}
export function formatSimilarityScore(score: number): string {
return `${Math.round(score * 100)}%`
}

View File

@@ -0,0 +1,84 @@
/**
* TypeScript types for Abitur Documents (NiBiS, etc.)
*/
export interface AbiturDokument {
id: string
dateiname: string
original_dateiname: string
bundesland: string
fach: string
jahr: number
niveau: 'eA' | 'gA' // erhöhtes/grundlegendes Anforderungsniveau
typ: 'aufgabe' | 'erwartungshorizont'
aufgaben_nummer: string // I, II, III
status: 'pending' | 'indexed' | 'error'
confidence: number
file_path: string
file_size: number
indexed: boolean
vector_ids: string[]
created_at: string
updated_at: string
}
export interface AbiturDocsResponse {
documents: AbiturDokument[]
total: number
page: number
limit: number
total_pages: number
}
export interface AbiturDocsFilter {
fach?: string
jahr?: number
bundesland?: string
niveau?: 'eA' | 'gA'
typ?: 'aufgabe' | 'erwartungshorizont'
page?: number
limit?: number
}
// Available filter options
export const FAECHER = [
{ id: 'deutsch', label: 'Deutsch' },
{ id: 'mathematik', label: 'Mathematik' },
{ id: 'englisch', label: 'Englisch' },
{ id: 'biologie', label: 'Biologie' },
{ id: 'physik', label: 'Physik' },
{ id: 'chemie', label: 'Chemie' },
{ id: 'geschichte', label: 'Geschichte' },
] as const
export const JAHRE = [2025, 2024, 2023, 2022, 2021, 2020] as const
export const BUNDESLAENDER = [
{ id: 'niedersachsen', label: 'Niedersachsen' },
{ id: 'bayern', label: 'Bayern' },
{ id: 'nrw', label: 'Nordrhein-Westfalen' },
{ id: 'bw', label: 'Baden-Württemberg' },
] as const
export const NIVEAUS = [
{ id: 'eA', label: 'Erhöhtes Anforderungsniveau (eA)' },
{ id: 'gA', label: 'Grundlegendes Anforderungsniveau (gA)' },
] as const
export const TYPEN = [
{ id: 'aufgabe', label: 'Aufgabe' },
{ id: 'erwartungshorizont', label: 'Erwartungshorizont' },
] as const
// Helper functions
export function formatFileSize(bytes: number): string {
if (bytes < 1024) return bytes + ' B'
if (bytes < 1024 * 1024) return (bytes / 1024).toFixed(1) + ' KB'
return (bytes / (1024 * 1024)).toFixed(1) + ' MB'
}
export function formatDocumentTitle(doc: AbiturDokument): string {
const fachLabel = FAECHER.find(f => f.id === doc.fach)?.label || doc.fach
const typLabel = doc.typ === 'erwartungshorizont' ? 'EWH' : 'Aufgabe'
return `${fachLabel} ${doc.jahr} - ${doc.niveau} ${doc.aufgaben_nummer} (${typLabel})`
}