[split-required] Split final 43 files (500-668 LOC) to complete refactoring
klausur-service (11 files): - cv_gutter_repair, ocr_pipeline_regression, upload_api - ocr_pipeline_sessions, smart_spell, nru_worksheet_generator - ocr_pipeline_overlays, mail/aggregator, zeugnis_api - cv_syllable_detect, self_rag backend-lehrer (17 files): - classroom_engine/suggestions, generators/quiz_generator - worksheets_api, llm_gateway/comparison, state_engine_api - classroom/models (→ 4 submodules), services/file_processor - alerts_agent/api/wizard+digests+routes, content_generators/pdf - classroom/routes/sessions, llm_gateway/inference - classroom_engine/analytics, auth/keycloak_auth - alerts_agent/processing/rule_engine, ai_processor/print_versions agent-core (5 files): - brain/memory_store, brain/knowledge_graph, brain/context_manager - orchestrator/supervisor, sessions/session_manager admin-lehrer (5 components): - GridOverlay, StepGridReview, DevOpsPipelineSidebar - DataFlowDiagram, sbom/wizard/page website (2 files): - DependencyMap, lehrer/abitur-archiv Other: nibis_ingestion, grid_detection_service, export-doclayout-onnx Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,84 @@
|
||||
/**
|
||||
* Abitur-Archiv Constants & Mock Data
|
||||
*
|
||||
* Extracted from page.tsx.
|
||||
*/
|
||||
|
||||
// API Base URL
|
||||
export const API_BASE = '/api/education/abitur-archiv'
|
||||
|
||||
// Filter constants
|
||||
export const FAECHER = [
|
||||
{ id: 'deutsch', label: 'Deutsch' },
|
||||
{ id: 'englisch', label: 'Englisch' },
|
||||
{ id: 'mathematik', label: 'Mathematik' },
|
||||
{ id: 'biologie', label: 'Biologie' },
|
||||
{ id: 'physik', label: 'Physik' },
|
||||
{ id: 'chemie', label: 'Chemie' },
|
||||
{ id: 'geschichte', label: 'Geschichte' },
|
||||
]
|
||||
|
||||
export const JAHRE = [2025, 2024, 2023, 2022, 2021]
|
||||
|
||||
export const NIVEAUS = [
|
||||
{ id: 'eA', label: 'Erhoehtes Niveau (eA)' },
|
||||
{ id: 'gA', label: 'Grundlegendes Niveau (gA)' },
|
||||
]
|
||||
|
||||
export const TYPEN = [
|
||||
{ id: 'aufgabe', label: 'Aufgabe' },
|
||||
{ id: 'erwartungshorizont', label: 'Erwartungshorizont' },
|
||||
]
|
||||
|
||||
export interface AbiturDokument {
|
||||
id: string
|
||||
dateiname: string
|
||||
fach: string
|
||||
jahr: number
|
||||
niveau: 'eA' | 'gA'
|
||||
typ: 'aufgabe' | 'erwartungshorizont'
|
||||
aufgaben_nummer: string
|
||||
status: string
|
||||
file_path: string
|
||||
file_size: number
|
||||
}
|
||||
|
||||
export function getMockDocuments(): AbiturDokument[] {
|
||||
const docs: AbiturDokument[] = []
|
||||
const faecher = ['deutsch', 'englisch']
|
||||
const jahre = [2024, 2023, 2022]
|
||||
const niveaus: Array<'eA' | 'gA'> = ['eA', 'gA']
|
||||
const typen: Array<'aufgabe' | 'erwartungshorizont'> = ['aufgabe', 'erwartungshorizont']
|
||||
const nummern = ['I', 'II', 'III']
|
||||
|
||||
let id = 1
|
||||
for (const jahr of jahre) {
|
||||
for (const fach of faecher) {
|
||||
for (const niveau of niveaus) {
|
||||
for (const nummer of nummern) {
|
||||
for (const typ of typen) {
|
||||
docs.push({
|
||||
id: `doc-${id++}`,
|
||||
dateiname: `${jahr}_${fach}_${niveau}_${nummer}${typ === 'erwartungshorizont' ? '_EWH' : ''}.pdf`,
|
||||
fach,
|
||||
jahr,
|
||||
niveau,
|
||||
typ,
|
||||
aufgaben_nummer: nummer,
|
||||
status: 'indexed',
|
||||
file_path: '#',
|
||||
file_size: 250000 + Math.random() * 500000
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return docs
|
||||
}
|
||||
|
||||
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'
|
||||
}
|
||||
@@ -11,45 +11,10 @@ import {
|
||||
FileText, Filter, ChevronLeft, ChevronRight, Eye, Download, Search,
|
||||
X, Loader2, Grid, List, LayoutGrid, Plus, Archive, BookOpen
|
||||
} from 'lucide-react'
|
||||
|
||||
// API Base URL
|
||||
const API_BASE = '/api/education/abitur-archiv'
|
||||
|
||||
// Filter constants
|
||||
const FAECHER = [
|
||||
{ id: 'deutsch', label: 'Deutsch' },
|
||||
{ id: 'englisch', label: 'Englisch' },
|
||||
{ id: 'mathematik', label: 'Mathematik' },
|
||||
{ id: 'biologie', label: 'Biologie' },
|
||||
{ id: 'physik', label: 'Physik' },
|
||||
{ id: 'chemie', label: 'Chemie' },
|
||||
{ id: 'geschichte', label: 'Geschichte' },
|
||||
]
|
||||
|
||||
const JAHRE = [2025, 2024, 2023, 2022, 2021]
|
||||
|
||||
const NIVEAUS = [
|
||||
{ id: 'eA', label: 'Erhoehtes Niveau (eA)' },
|
||||
{ id: 'gA', label: 'Grundlegendes Niveau (gA)' },
|
||||
]
|
||||
|
||||
const TYPEN = [
|
||||
{ id: 'aufgabe', label: 'Aufgabe' },
|
||||
{ id: 'erwartungshorizont', label: 'Erwartungshorizont' },
|
||||
]
|
||||
|
||||
interface AbiturDokument {
|
||||
id: string
|
||||
dateiname: string
|
||||
fach: string
|
||||
jahr: number
|
||||
niveau: 'eA' | 'gA'
|
||||
typ: 'aufgabe' | 'erwartungshorizont'
|
||||
aufgaben_nummer: string
|
||||
status: string
|
||||
file_path: string
|
||||
file_size: number
|
||||
}
|
||||
import {
|
||||
API_BASE, FAECHER, JAHRE, NIVEAUS, TYPEN,
|
||||
type AbiturDokument, getMockDocuments, formatFileSize,
|
||||
} from './_components/archiv-constants'
|
||||
|
||||
export default function AbiturArchivPage() {
|
||||
const [documents, setDocuments] = useState<AbiturDokument[]>([])
|
||||
@@ -140,12 +105,6 @@ export default function AbiturArchivPage() {
|
||||
|
||||
const hasActiveFilters = filterFach || filterJahr || filterNiveau || filterTyp || searchQuery
|
||||
|
||||
const formatFileSize = (bytes: number) => {
|
||||
if (bytes < 1024) return bytes + ' B'
|
||||
if (bytes < 1024 * 1024) return (bytes / 1024).toFixed(1) + ' KB'
|
||||
return (bytes / (1024 * 1024)).toFixed(1) + ' MB'
|
||||
}
|
||||
|
||||
return (
|
||||
<div className="space-y-6">
|
||||
{/* Header */}
|
||||
@@ -469,36 +428,3 @@ export default function AbiturArchivPage() {
|
||||
)
|
||||
}
|
||||
|
||||
function getMockDocuments(): AbiturDokument[] {
|
||||
const docs: AbiturDokument[] = []
|
||||
const faecher = ['deutsch', 'englisch']
|
||||
const jahre = [2024, 2023, 2022]
|
||||
const niveaus: Array<'eA' | 'gA'> = ['eA', 'gA']
|
||||
const typen: Array<'aufgabe' | 'erwartungshorizont'> = ['aufgabe', 'erwartungshorizont']
|
||||
const nummern = ['I', 'II', 'III']
|
||||
|
||||
let id = 1
|
||||
for (const jahr of jahre) {
|
||||
for (const fach of faecher) {
|
||||
for (const niveau of niveaus) {
|
||||
for (const nummer of nummern) {
|
||||
for (const typ of typen) {
|
||||
docs.push({
|
||||
id: `doc-${id++}`,
|
||||
dateiname: `${jahr}_${fach}_${niveau}_${nummer}${typ === 'erwartungshorizont' ? '_EWH' : ''}.pdf`,
|
||||
fach,
|
||||
jahr,
|
||||
niveau,
|
||||
typ,
|
||||
aufgaben_nummer: nummer,
|
||||
status: 'indexed',
|
||||
file_path: '#',
|
||||
file_size: 250000 + Math.random() * 500000
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return docs
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user