/** SDK_STEPS data array — all compliance SDK steps, ordered by seq. */
import type { SDKStep } from './sdk-flow'

export const SDK_STEPS: SDKStep[] = [
  // PAKET 1: VORBEREITUNG
  {
    id: 'company-profile',
    seq: 100,
    phase: 1,
    package: 'vorbereitung',
    order: 1,
    name: 'Unternehmensprofil',
    nameShort: 'Profil',
    description: 'Gesch\u00e4ftsmodell, Gr\u00f6\u00dfe und Zielm\u00e4rkte erfassen',
    url: '/sdk/company-profile',
    checkpointId: 'CP-PROF',
    prerequisiteSteps: [], isOptional: false,
  },
  {
    id: 'compliance-scope',
    seq: 200,
    phase: 1,
    package: 'vorbereitung',
    order: 2,
    name: 'Compliance Scope',
    nameShort: 'Scope',
    description: 'Umfang und Tiefe Ihrer Compliance-Dokumentation bestimmen',
    url: '/sdk/compliance-scope',
    checkpointId: 'CP-SCOPE',
    prerequisiteSteps: ['company-profile'],
    isOptional: false },
  {
    id: 'use-case-assessment',
    seq: 300,
    phase: 1,
    package: 'vorbereitung',
    order: 3,
    name: 'Anwendungsfall-Erfassung',
    nameShort: 'Anwendung',
    description: 'AI-Anwendungsf\u00e4lle strukturiert dokumentieren',
    url: '/sdk/advisory-board',
    checkpointId: 'CP-UC',
    prerequisiteSteps: ['company-profile'],
    isOptional: false },
  {
    id: 'import',
    seq: 400,
    phase: 1,
    package: 'vorbereitung',
    order: 4,
    name: 'Dokument-Import',
    nameShort: 'Import',
    description: 'Bestehende Dokumente hochladen (Bestandskunden)',
    url: '/sdk/import',
    checkpointId: 'CP-IMP',
    prerequisiteSteps: ['use-case-assessment'],
    isOptional: true,
    visibleWhen: (state) => state.customerType === 'existing',
  },
  {
    id: 'ai-act',
    seq: 350,
    phase: 1,
    package: 'vorbereitung',
    order: 4,
    name: 'AI Act Klassifizierung',
    nameShort: 'AI Act',
    description: 'KI-Risikostufe (nur bei KI-Einsatz)',
    url: '/sdk/ai-act',
    checkpointId: 'CP-AI',
    prerequisiteSteps: ['use-case-assessment'],
    isOptional: true },
  {
    id: 'screening',
    seq: 500,
    phase: 1,
    package: 'vorbereitung',
    order: 5,
    name: 'System Screening',
    nameShort: 'Screening',
    description: 'SBOM + Security-Scan — erfolgt extern im Compliance-Scanner (CERTifAI)',
    url: '/sdk/screening',
    checkpointId: 'CP-SCAN',
    prerequisiteSteps: ['use-case-assessment'],
    isOptional: true,
    // Aus der Navigation genommen: Repo-Scanning (SBOM/SAST/DAST/Vuln) läuft in
    // Sharangs Compliance-Scanner; das Ergebnis wird DORT angezeigt. Unser SDK
    // konsumiert die Findings nur für Cyber-trifft-Safety (CRA/CE/IACE).
    visibleWhen: () => false },
  // Modules entfernt — Regulierungen werden im Scope-Decision-Tab + Dashboard angezeigt
  {
    id: 'source-policy',
    seq: 700,
    phase: 1,
    package: 'vorbereitung',
    order: 7,
    name: 'Quellen-Verwaltung',
    nameShort: 'Quellen',
    description: 'RAG Quellen-Whitelist (Enterprise)',
    url: '/sdk/source-policy',
    checkpointId: 'CP-SPOL',
    prerequisiteSteps: ['use-case-assessment'],
    isOptional: true },

  // PAKET 2: ANALYSE (Assessment) — Requirements → Controls → Risks → Checklist → Report
  {
    id: 'requirements',
    seq: 1000,
    phase: 1,
    package: 'analyse',
    order: 1,
    name: 'Requirements',
    nameShort: 'Anforderungen',
    description: 'Pruefaspekte aus Regulierungen ableiten',
    url: '/sdk/requirements',
    checkpointId: 'CP-REQ',
    prerequisiteSteps: ['compliance-scope'],
    isOptional: false },
  {
    id: 'controls',
    seq: 1100,
    phase: 1,
    package: 'analyse',
    order: 2,
    name: 'Controls',
    nameShort: 'Controls',
    description: 'Technische & organisatorische Massnahmen',
    url: '/sdk/controls',
    checkpointId: 'CP-CTRL',
    prerequisiteSteps: ['requirements'],
    isOptional: false },
  {
    id: 'risks',
    seq: 1200,
    phase: 1,
    package: 'analyse',
    order: 3,
    name: 'Risk Matrix',
    nameShort: 'Risiken',
    description: 'Risikobewertung — wo sind Luecken?',
    url: '/sdk/risks',
    checkpointId: 'CP-RISK',
    prerequisiteSteps: ['controls'],
    isOptional: false },
  {
    id: 'audit-checklist',
    seq: 1300,
    phase: 1,
    package: 'analyse',
    order: 4,
    name: 'Audit Checklist',
    nameShort: 'Checklist',
    description: 'Pruefbare Checkliste generieren',
    url: '/sdk/audit-checklist',
    checkpointId: 'CP-CHK',
    prerequisiteSteps: ['risks'],
    isOptional: false },
  {
    id: 'audit-report',
    seq: 1400,
    phase: 1,
    package: 'analyse',
    order: 5,
    name: 'Audit Report',
    nameShort: 'Report',
    description: 'Zusammenfassender Audit-Report (PDF)',
    url: '/sdk/audit-report',
    checkpointId: 'CP-AREP',
    prerequisiteSteps: ['audit-checklist'],
    isOptional: false },

  // PAKET 3: DOKUMENTATION (Compliance Docs)
  {
    id: 'obligations',
    seq: 2000,
    phase: 2,
    package: 'dokumentation',
    order: 1,
    name: 'Pflichten\u00fcbersicht',
    nameShort: 'Pflichten',
    description: 'NIS2, DSGVO, AI Act Pflichten',
    url: '/sdk/obligations',
    checkpointId: 'CP-OBL',
    prerequisiteSteps: ['audit-report'],
    isOptional: false },
  {
    id: 'dsfa',
    seq: 2100,
    phase: 2,
    package: 'dokumentation',
    order: 2,
    name: 'DSFA',
    nameShort: 'DSFA',
    description: 'Datenschutz-Folgenabsch\u00e4tzung',
    url: '/sdk/dsfa',
    checkpointId: 'CP-DSFA',
    prerequisiteSteps: ['obligations'],
    isOptional: true,
    visibleWhen: (state) => {
      const level = state.complianceScope?.decision?.determinedLevel
      if (level && ['L2', 'L3', 'L4'].includes(level)) return true
      const triggers = state.complianceScope?.decision?.triggeredHardTriggers || []
      return triggers.some(t => t.requiresDSFA)
    },
  },
  {
    id: 'tom',
    seq: 2200,
    phase: 2,
    package: 'dokumentation',
    order: 3,
    name: 'TOMs',
    nameShort: 'TOMs',
    description: 'Technische & Org. Ma\u00dfnahmen',
    url: '/sdk/tom',
    checkpointId: 'CP-TOM',
    prerequisiteSteps: ['obligations'],
    isOptional: false },
  {
    id: 'loeschfristen',
    seq: 2300,
    phase: 2,
    package: 'dokumentation',
    order: 4,
    name: 'L\u00f6schfristen',
    nameShort: 'L\u00f6schfristen',
    description: 'Aufbewahrungsrichtlinien',
    url: '/sdk/loeschfristen',
    checkpointId: 'CP-RET',
    prerequisiteSteps: ['tom'],
    isOptional: false },
  {
    id: 'vvt',
    seq: 2400,
    phase: 2,
    package: 'dokumentation',
    order: 5,
    name: 'Verarbeitungsverzeichnis',
    nameShort: 'VVT',
    description: 'Art. 30 DSGVO Dokumentation',
    url: '/sdk/vvt',
    checkpointId: 'CP-VVT',
    prerequisiteSteps: ['loeschfristen'],
    isOptional: false },

  // PAKET 4: RECHTLICHE TEXTE (Legal Outputs)
  {
    id: 'einwilligungen',
    seq: 3000,
    phase: 2,
    package: 'rechtliche-texte',
    order: 1,
    name: 'Consent-Records',
    nameShort: 'Consent-Records',
    description: 'Datenpunktkatalog & DSI-Generator',
    url: '/sdk/einwilligungen',
    checkpointId: 'CP-CONS',
    prerequisiteSteps: ['vvt'],
    isOptional: false },
  {
    id: 'consent',
    seq: 3100,
    phase: 2,
    package: 'rechtliche-texte',
    order: 2,
    name: 'Rechtliche Vorlagen',
    nameShort: 'Vorlagen',
    description: 'AGB, Datenschutz, Nutzungsbedingungen',
    url: '/sdk/consent',
    checkpointId: 'CP-DOC',
    prerequisiteSteps: ['einwilligungen'],
    isOptional: false },
  {
    id: 'cookie-banner',
    seq: 3200,
    phase: 2,
    package: 'rechtliche-texte',
    order: 3,
    name: 'Cookie Banner',
    nameShort: 'Cookies',
    description: 'Cookie-Consent Generator',
    url: '/sdk/cookie-banner',
    checkpointId: 'CP-COOK',
    prerequisiteSteps: ['consent'],
    isOptional: false },
  {
    id: 'document-generator',
    seq: 3300,
    phase: 2,
    package: 'rechtliche-texte',
    order: 4,
    name: 'Dokumentengenerator',
    nameShort: 'Generator',
    description: 'Rechtliche Dokumente aus Vorlagen erstellen',
    url: '/sdk/document-generator',
    checkpointId: 'CP-DOCGEN',
    prerequisiteSteps: ['cookie-banner'],
    isOptional: true,
    visibleWhen: () => true,
  },
  {
    id: 'workflow',
    seq: 3400,
    phase: 2,
    package: 'rechtliche-texte',
    order: 5,
    name: 'Document Workflow',
    nameShort: 'Workflow',
    description: 'Versionierung & Freigabe-Workflow',
    url: '/sdk/workflow',
    checkpointId: 'CP-WRKF',
    prerequisiteSteps: ['cookie-banner'],
    isOptional: false },

  // PAKET 5: BETRIEB (Operations)
  {
    id: 'evidence',
    seq: 3900,
    phase: 2,
    package: 'betrieb',
    order: 0,
    name: 'Evidence',
    nameShort: 'Nachweise',
    description: 'Nachweise laufend dokumentieren',
    url: '/sdk/evidence',
    checkpointId: 'CP-EVI',
    prerequisiteSteps: ['audit-report'],
    isOptional: false },
  {
    id: 'dsr',
    seq: 4000,
    phase: 2,
    package: 'betrieb',
    order: 1,
    name: 'DSR Portal',
    nameShort: 'DSR',
    description: 'Betroffenenrechte-Portal',
    url: '/sdk/dsr',
    checkpointId: 'CP-DSR',
    prerequisiteSteps: ['workflow'],
    isOptional: false },
  {
    id: 'escalations',
    seq: 4100,
    phase: 2,
    package: 'betrieb',
    order: 2,
    name: 'Escalations',
    nameShort: 'Eskalationen',
    description: 'Management-Workflows',
    url: '/sdk/escalations',
    checkpointId: 'CP-ESC',
    prerequisiteSteps: ['dsr'],
    isOptional: false },
  {
    id: 'vendor-compliance',
    seq: 4200,
    phase: 2,
    package: 'betrieb',
    order: 3,
    name: 'Vendor Compliance',
    nameShort: 'Vendor',
    description: 'Dienstleister-Management',
    url: '/sdk/vendor-compliance',
    checkpointId: 'CP-VEND',
    prerequisiteSteps: ['escalations'],
    isOptional: false },
  {
    id: 'consent-management',
    seq: 4300,
    phase: 2,
    package: 'betrieb',
    order: 4,
    name: 'Consent Verwaltung',
    nameShort: 'Consent Mgmt',
    description: 'Dokument-Lifecycle & DSGVO-Prozesse',
    url: '/sdk/consent-management',
    checkpointId: 'CP-CMGMT',
    prerequisiteSteps: ['vendor-compliance'],
    isOptional: false },
  {
    id: 'email-templates',
    seq: 4350,
    phase: 2,
    package: 'betrieb',
    order: 5,
    name: 'E-Mail-Templates',
    nameShort: 'E-Mails',
    description: 'Benachrichtigungs-Vorlagen verwalten',
    url: '/sdk/email-templates',
    checkpointId: 'CP-EMAIL',
    prerequisiteSteps: ['consent-management'],
    isOptional: false },
  {
    id: 'notfallplan',
    seq: 4400,
    phase: 2,
    package: 'betrieb',
    order: 6,
    name: 'Notfallplan & Breach Response',
    nameShort: 'Notfallplan',
    description: 'Datenpannen-Management nach Art. 33/34 DSGVO',
    url: '/sdk/notfallplan',
    checkpointId: 'CP-NOTF',
    prerequisiteSteps: ['email-templates'],
    isOptional: false },
  {
    id: 'incidents',
    seq: 4500,
    phase: 2,
    package: 'betrieb',
    order: 7,
    name: 'Incident Management',
    nameShort: 'Incidents',
    description: 'Datenpannen erfassen, bewerten und melden (Art. 33/34 DSGVO)',
    url: '/sdk/incidents',
    checkpointId: 'CP-INC',
    prerequisiteSteps: ['notfallplan'],
    isOptional: false },
  {
    id: 'whistleblower',
    seq: 4600,
    phase: 2,
    package: 'betrieb',
    order: 8,
    name: 'Hinweisgebersystem',
    nameShort: 'Whistleblower',
    description: 'Anonymes Meldesystem gemaess HinSchG',
    url: '/sdk/whistleblower',
    checkpointId: 'CP-WB',
    prerequisiteSteps: ['incidents'],
    isOptional: false },
  {
    id: 'academy',
    seq: 4700,
    phase: 2,
    package: 'betrieb',
    order: 9,
    name: 'Compliance Academy',
    nameShort: 'Academy',
    description: 'Mitarbeiter-Schulungen & Zertifikate',
    url: '/sdk/academy',
    checkpointId: 'CP-ACAD',
    prerequisiteSteps: ['whistleblower'],
    isOptional: false },
  {
    id: 'training',
    seq: 4800,
    phase: 2,
    package: 'betrieb',
    order: 10,
    name: 'Training Engine',
    nameShort: 'Training',
    description: 'KI-generierte Schulungsinhalte, Quiz & Medien',
    url: '/sdk/training',
    checkpointId: 'CP-TRAIN',
    prerequisiteSteps: ['academy'],
    isOptional: false },
  {
    id: 'control-library',
    seq: 4900,
    phase: 2,
    package: 'betrieb',
    order: 11,
    name: 'Control Library',
    nameShort: 'Controls',
    description: 'Canonical Security Controls mit Open-Source-Referenzen',
    url: '/sdk/control-library',
    checkpointId: 'CP-CLIB',
    prerequisiteSteps: [],
    isOptional: true,
  },
  {
    id: 'master-controls',
    seq: 4925,
    phase: 2,
    package: 'betrieb',
    order: 11.5,
    name: 'Master Controls',
    nameShort: 'MCs',
    description: '13.588 Master Controls — gruppierte Compliance-Anforderungen nach Thema und Regulierung',
    url: '/sdk/master-controls',
    checkpointId: 'CP-MC',
    prerequisiteSteps: [],
    isOptional: true,
  },
  {
    id: 'control-provenance',
    seq: 4950,
    phase: 2,
    package: 'betrieb',
    order: 12,
    name: 'Control Provenance',
    nameShort: 'Provenance',
    description: 'Herkunftsnachweis: Offene Quellen, Lizenzen, Too-Close-Pruefung',
    url: '/sdk/control-provenance',
    checkpointId: 'CP-CPROV',
    prerequisiteSteps: [],
    isOptional: true,
  },
  {
    id: 'template-rule-editor',
    seq: 5000,
    phase: 2,
    package: 'betrieb',
    order: 13,
    name: 'Empfehlungs-Regeln',
    nameShort: 'Regeln',
    description: 'Editorial-UI fuer profilbasierte Dokument-Empfehlungen (Anwalt/DSB)',
    url: '/sdk/template-rule-editor',
    checkpointId: 'CP-RULES',
    prerequisiteSteps: [],
    isOptional: true,
  },
  {
    id: 'document-library',
    seq: 2500,
    phase: 2,
    package: 'dokumentation',
    order: 99,
    name: 'Document Library',
    nameShort: 'Library',
    description: 'Zentrale Uebersicht aller erzeugten Dokumente, gruppiert nach Empfehlung',
    url: '/sdk/document-library',
    checkpointId: 'CP-DOCLIB',
    prerequisiteSteps: [],
    isOptional: false,
  },
]
