/**
 * Korrekturplattform API Service Layer - Barrel re-export
 *
 * Split into:
 * - api-core.ts: Base functions, CRUD, annotations, fairness, export URLs
 * - api-archiv.ts: NiBiS archiv and dashboard stats
 * - api.ts (this file): Barrel re-export + korrekturApi namespace
 */

// Re-export everything from core
export {
  getApiBase, apiFetch,
  getKlausuren, getKlausur, createKlausur, deleteKlausur,
  getStudents, getStudent, uploadStudentWork, deleteStudent,
  updateCriteria, updateGutachten, generateGutachten,
  getAnnotations, createAnnotation, updateAnnotation, deleteAnnotation,
  getEHSuggestions, queryRAG, uploadEH,
  getFairnessAnalysis, getGradeInfo,
  getGutachtenExportUrl, getAnnotationsExportUrl, getOverviewExportUrl, getAllGutachtenExportUrl, getStudentFileUrl,
} from './api-core'

// Re-export everything from archiv
export type { ArchivDokument, ArchivSearchResponse, ArchivFilters, KorrekturStats } from './api-archiv'
export {
  getArchivDocuments, getArchivDocument, getArchivDocumentUrl,
  searchArchivSemantic, getArchivSuggestions, getArchivStats,
  getKorrekturStats,
} from './api-archiv'

// Import for namespace
import * as core from './api-core'
import * as archiv from './api-archiv'

// Export all functions as a namespace
export const korrekturApi = {
  // Klausuren
  getKlausuren: core.getKlausuren,
  getKlausur: core.getKlausur,
  createKlausur: core.createKlausur,
  deleteKlausur: core.deleteKlausur,
  // Students
  getStudents: core.getStudents,
  getStudent: core.getStudent,
  uploadStudentWork: core.uploadStudentWork,
  deleteStudent: core.deleteStudent,
  // Criteria & Gutachten
  updateCriteria: core.updateCriteria,
  updateGutachten: core.updateGutachten,
  generateGutachten: core.generateGutachten,
  // Annotations
  getAnnotations: core.getAnnotations,
  createAnnotation: core.createAnnotation,
  updateAnnotation: core.updateAnnotation,
  deleteAnnotation: core.deleteAnnotation,
  // EH/RAG
  getEHSuggestions: core.getEHSuggestions,
  queryRAG: core.queryRAG,
  uploadEH: core.uploadEH,
  // Fairness & Export
  getFairnessAnalysis: core.getFairnessAnalysis,
  getGradeInfo: core.getGradeInfo,
  getGutachtenExportUrl: core.getGutachtenExportUrl,
  getAnnotationsExportUrl: core.getAnnotationsExportUrl,
  getOverviewExportUrl: core.getOverviewExportUrl,
  getAllGutachtenExportUrl: core.getAllGutachtenExportUrl,
  getStudentFileUrl: core.getStudentFileUrl,
  // Archiv (NiBiS)
  getArchivDocuments: archiv.getArchivDocuments,
  getArchivDocument: archiv.getArchivDocument,
  getArchivDocumentUrl: archiv.getArchivDocumentUrl,
  searchArchivSemantic: archiv.searchArchivSemantic,
  getArchivSuggestions: archiv.getArchivSuggestions,
  getArchivStats: archiv.getArchivStats,
  // Stats
  getKorrekturStats: archiv.getKorrekturStats,
}
