/**
 * Python/FastAPI endpoints — Core compliance modules
 * (framework, audit, change-requests, company-profile, projects,
 *  compliance-scope, dashboard, generation, extraction, modules)
 */
import { ApiModule } from './types'

export const pythonCoreModules: ApiModule[] = [
  {
    id: 'compliance-framework',
    name: 'Compliance Framework — Regulierungen, Anforderungen & Controls',
    service: 'python',
    basePath: '/api/compliance',
    exposure: 'internal',
    endpoints: [
      { method: 'GET', path: '/regulations', description: 'Alle Regulierungen auflisten', service: 'python' },
      { method: 'GET', path: '/regulations/{code}', description: 'Regulierung nach Code laden', service: 'python' },
      { method: 'GET', path: '/regulations/{code}/requirements', description: 'Anforderungen einer Regulierung', service: 'python' },
      { method: 'GET', path: '/requirements', description: 'Anforderungen auflisten (paginiert)', service: 'python' },
      { method: 'GET', path: '/requirements/{requirement_id}', description: 'Einzelne Anforderung laden', service: 'python' },
      { method: 'POST', path: '/requirements', description: 'Anforderung erstellen', service: 'python' },
      { method: 'PUT', path: '/requirements/{requirement_id}', description: 'Anforderung aktualisieren', service: 'python' },
      { method: 'DELETE', path: '/requirements/{requirement_id}', description: 'Anforderung loeschen', service: 'python' },
      { method: 'GET', path: '/controls', description: 'Alle Controls auflisten', service: 'python' },
      { method: 'GET', path: '/controls/paginated', description: 'Controls paginiert laden', service: 'python' },
      { method: 'GET', path: '/controls/{control_id}', description: 'Einzelnes Control laden', service: 'python' },
      { method: 'PUT', path: '/controls/{control_id}', description: 'Control aktualisieren', service: 'python' },
      { method: 'PUT', path: '/controls/{control_id}/review', description: 'Control-Review durchfuehren', service: 'python' },
      { method: 'GET', path: '/controls/by-domain/{domain}', description: 'Controls nach Domain filtern', service: 'python' },
      { method: 'POST', path: '/export', description: 'Audit-Export erstellen', service: 'python' },
      { method: 'GET', path: '/export/{export_id}', description: 'Export-Status abfragen', service: 'python' },
      { method: 'GET', path: '/export/{export_id}/download', description: 'Export-Datei herunterladen', service: 'python' },
      { method: 'GET', path: '/exports', description: 'Alle Exports auflisten', service: 'python' },
      { method: 'POST', path: '/init-tables', description: 'Datenbanktabellen initialisieren', service: 'python', exposure: 'admin' },
      { method: 'POST', path: '/create-indexes', description: 'Datenbank-Indizes erstellen', service: 'python', exposure: 'admin' },
      { method: 'POST', path: '/seed-risks', description: 'Risikodaten einspielen', service: 'python', exposure: 'admin' },
      { method: 'POST', path: '/seed', description: 'Systemdaten einspielen', service: 'python', exposure: 'admin' },
    ],
  },

  {
    id: 'audit',
    name: 'Audit — Sitzungen & Checklisten',
    service: 'python',
    basePath: '/api/compliance/audit',
    exposure: 'internal',
    endpoints: [
      { method: 'POST', path: '/sessions', description: 'Audit-Sitzung erstellen', service: 'python' },
      { method: 'GET', path: '/sessions', description: 'Alle Audit-Sitzungen auflisten', service: 'python' },
      { method: 'GET', path: '/sessions/{session_id}', description: 'Sitzung laden', service: 'python' },
      { method: 'PUT', path: '/sessions/{session_id}/start', description: 'Sitzung starten', service: 'python' },
      { method: 'PUT', path: '/sessions/{session_id}/complete', description: 'Sitzung abschliessen', service: 'python' },
      { method: 'PUT', path: '/sessions/{session_id}/archive', description: 'Sitzung archivieren', service: 'python' },
      { method: 'DELETE', path: '/sessions/{session_id}', description: 'Sitzung loeschen', service: 'python' },
      { method: 'GET', path: '/sessions/{session_id}/report/pdf', description: 'Sitzungsbericht als PDF exportieren', service: 'python' },
      { method: 'GET', path: '/checklist/{session_id}', description: 'Checkliste einer Sitzung laden', service: 'python' },
      { method: 'PUT', path: '/checklist/{session_id}/items/{requirement_id}/sign-off', description: 'Anforderung abzeichnen', service: 'python' },
      { method: 'GET', path: '/checklist/{session_id}/items/{requirement_id}', description: 'Abzeichnung-Details laden', service: 'python' },
    ],
  },

  {
    id: 'ai-systems',
    name: 'AI Act — KI-Systeme & Risikobewertung',
    service: 'python',
    basePath: '/api/compliance/ai',
    exposure: 'internal',
    endpoints: [
      { method: 'GET', path: '/systems', description: 'KI-Systeme auflisten', service: 'python' },
      { method: 'POST', path: '/systems', description: 'KI-System erstellen', service: 'python' },
      { method: 'GET', path: '/systems/{system_id}', description: 'KI-System laden', service: 'python' },
      { method: 'PUT', path: '/systems/{system_id}', description: 'KI-System aktualisieren', service: 'python' },
      { method: 'DELETE', path: '/systems/{system_id}', description: 'KI-System loeschen', service: 'python' },
      { method: 'POST', path: '/systems/{system_id}/assess', description: 'KI-Compliance bewerten', service: 'python' },
    ],
  },

  {
    id: 'change-requests',
    name: 'Change Requests — Aenderungsantraege',
    service: 'python',
    basePath: '/api/compliance/change-requests',
    exposure: 'internal',
    endpoints: [
      { method: 'GET', path: '/stats', description: 'CR-Statistiken laden', service: 'python' },
      { method: 'GET', path: '/{cr_id}', description: 'Einzelnen CR laden', service: 'python' },
      { method: 'POST', path: '/{cr_id}/accept', description: 'CR akzeptieren', service: 'python' },
      { method: 'POST', path: '/{cr_id}/reject', description: 'CR ablehnen', service: 'python' },
      { method: 'POST', path: '/{cr_id}/edit', description: 'CR bearbeiten', service: 'python' },
      { method: 'DELETE', path: '/{cr_id}', description: 'CR loeschen', service: 'python' },
    ],
  },

  {
    id: 'company-profile',
    name: 'Stammdaten — Unternehmensprofil',
    service: 'python',
    basePath: '/api/v1/company-profile',
    exposure: 'internal',
    endpoints: [
      { method: 'GET', path: '/', description: 'Unternehmensprofil laden', service: 'python' },
      { method: 'POST', path: '/', description: 'Profil erstellen/aktualisieren', service: 'python' },
      { method: 'DELETE', path: '/', description: 'Profil loeschen', service: 'python' },
      { method: 'GET', path: '/template-context', description: 'Profil als Template-Kontext (flach)', service: 'python' },
      { method: 'GET', path: '/audit', description: 'Profil-Aenderungsprotokoll laden', service: 'python' },
    ],
  },

  {
    id: 'projects',
    name: 'Projekte — Multi-Projekt-Verwaltung',
    service: 'python',
    basePath: '/api/compliance/v1/projects',
    exposure: 'internal',
    endpoints: [
      { method: 'GET', path: '/', description: 'Alle Projekte des Tenants auflisten', service: 'python' },
      { method: 'POST', path: '/', description: 'Neues Projekt erstellen (optional mit Stammdaten-Kopie)', service: 'python' },
      { method: 'GET', path: '/{project_id}', description: 'Einzelnes Projekt laden', service: 'python' },
      { method: 'PATCH', path: '/{project_id}', description: 'Projekt aktualisieren (Name, Beschreibung)', service: 'python' },
      { method: 'DELETE', path: '/{project_id}', description: 'Projekt archivieren (Soft Delete)', service: 'python' },
    ],
  },

  {
    id: 'compliance-scope',
    name: 'Compliance Scope — Geltungsbereich',
    service: 'python',
    basePath: '/api/v1/compliance-scope',
    exposure: 'internal',
    endpoints: [
      { method: 'GET', path: '/', description: 'Compliance-Scope laden', service: 'python' },
      { method: 'POST', path: '/', description: 'Compliance-Scope erstellen/aktualisieren', service: 'python' },
    ],
  },

  {
    id: 'dashboard',
    name: 'Dashboard — Compliance-Uebersicht & Reports',
    service: 'python',
    basePath: '/api/compliance/dashboard',
    exposure: 'internal',
    endpoints: [
      { method: 'GET', path: '/dashboard', description: 'Haupt-Dashboard laden', service: 'python' },
      { method: 'GET', path: '/score', description: 'Compliance-Score berechnen', service: 'python' },
      { method: 'GET', path: '/dashboard/executive', description: 'Executive-Dashboard laden', service: 'python' },
      { method: 'GET', path: '/dashboard/trend', description: 'Compliance-Trendverlauf laden', service: 'python' },
      { method: 'GET', path: '/reports/summary', description: 'Zusammenfassungsbericht laden', service: 'python' },
      { method: 'GET', path: '/reports/{period}', description: 'Periodenbericht generieren', service: 'python' },
    ],
  },

  {
    id: 'generation',
    name: 'Dokumentengenerierung — Automatische Erstellung',
    service: 'python',
    basePath: '/api/compliance/generation',
    exposure: 'internal',
    endpoints: [
      { method: 'GET', path: '/preview/{doc_type}', description: 'Generierungs-Vorschau laden', service: 'python' },
      { method: 'POST', path: '/apply/{doc_type}', description: 'Dokument generieren und anwenden', service: 'python' },
    ],
  },

  {
    id: 'extraction',
    name: 'Extraktion — Anforderungen aus RAG',
    service: 'python',
    basePath: '/api/compliance',
    exposure: 'internal',
    endpoints: [
      { method: 'POST', path: '/extract-requirements-from-rag', description: 'Anforderungen aus RAG-Korpus extrahieren', service: 'python' },
    ],
  },

  {
    id: 'modules',
    name: 'Module — Compliance-Modul-Verwaltung',
    service: 'python',
    basePath: '/api/compliance/modules',
    exposure: 'internal',
    endpoints: [
      { method: 'GET', path: '/modules', description: 'Module auflisten', service: 'python' },
      { method: 'GET', path: '/modules/overview', description: 'Modul-Uebersicht laden', service: 'python' },
      { method: 'GET', path: '/modules/{module_id}', description: 'Modul laden', service: 'python' },
      { method: 'POST', path: '/modules/seed', description: 'Module einspielen', service: 'python', exposure: 'admin' },
      { method: 'POST', path: '/modules/{module_id}/activate', description: 'Modul aktivieren', service: 'python' },
      { method: 'POST', path: '/modules/{module_id}/deactivate', description: 'Modul deaktivieren', service: 'python' },
      { method: 'POST', path: '/modules/{module_id}/regulations', description: 'Regulierungs-Zuordnung hinzufuegen', service: 'python' },
    ],
  },
]
