import type { SystemInfoConfig } from './types'

export const workflowConfig: SystemInfoConfig = {
  title: 'BPMN Workflow Engine',
  description: 'Camunda 7 basierte Geschaeftsprozess-Automatisierung',
  version: '7.21.0',
  architecture: {
    layers: [
      {
        title: 'Frontend',
        color: '#3b82f6',
        components: ['bpmn-js Editor', 'React Components', 'Python Studio Module']
      },
      {
        title: 'Backend',
        color: '#8b5cf6',
        components: ['FastAPI Proxy', 'Camunda REST API', 'Task Management']
      },
      {
        title: 'BPMN Engine',
        color: '#10b981',
        components: ['Camunda 7', 'Process Executor', 'Job Executor']
      },
      {
        title: 'Datenbank',
        color: '#f59e0b',
        components: ['PostgreSQL', 'Camunda Schema', 'Process History']
      }
    ]
  },
  features: [
    { name: 'BPMN 2.0 Modellierung', status: 'active', description: 'Visueller Prozess-Editor mit bpmn-js' },
    { name: 'Process Deployment', status: 'active', description: 'Prozesse in Camunda deployen' },
    { name: 'Task Management', status: 'active', description: 'User Tasks bearbeiten und delegieren' },
    { name: 'Service Tasks', status: 'active', description: 'Automatische Serviceaufrufe' },
    { name: 'Timer Events', status: 'active', description: 'Zeitgesteuerte Prozessschritte' },
    { name: 'Process History', status: 'planned', description: 'Historische Prozessdaten und Analytics' }
  ],
  roadmap: [
    {
      phase: 'Phase 1: Editor & Deployment',
      priority: 'high',
      items: ['bpmn-js Editor Integration', 'Camunda Docker Setup', 'REST API Proxy', 'Task Inbox']
    },
    {
      phase: 'Phase 2: Consent Workflow',
      priority: 'high',
      items: ['Document Status BPMN', 'DSB Approval Task', 'Scheduled Publishing', 'Notification Tasks']
    },
    {
      phase: 'Phase 3: GDPR Workflows',
      priority: 'medium',
      items: ['DSR Request Processing', 'Deadline Monitoring', 'Data Export Automation', 'Deletion Workflow']
    }
  ],
  technicalDetails: [
    { component: 'BPMN Engine', technology: 'Camunda 7.21.0', description: 'Apache 2.0 Lizenz' },
    { component: 'Editor Library', technology: 'bpmn-js', version: '17.11.1' },
    { component: 'API Port', technology: '8089', description: 'REST API Proxy' },
    { component: 'Datenbank', technology: 'PostgreSQL', description: 'camunda Schema' }
  ],
  privacyNotes: [
    'Prozessdaten werden lokal in PostgreSQL gespeichert',
    'Keine externen Cloud-Dienste fuer BPMN-Engine',
    'Camunda Community Edition unter Apache 2.0 Lizenz',
    'Audit-Trail fuer alle Prozessaktivitaeten'
  ],
  auditInfo: [
    {
      category: 'Camunda Engine',
      items: [
        { label: 'Version', value: '7.21.0', status: 'ok' },
        { label: 'Lizenz', value: 'Apache 2.0', status: 'ok' },
        { label: 'Health Check', value: '/api/bpmn/health', status: 'ok' }
      ]
    },
    {
      category: 'Datenschutz',
      items: [
        { label: 'Datenstandort', value: 'Lokal (PostgreSQL)', status: 'ok' },
        { label: 'Audit-Trail', value: 'Aktiviert', status: 'ok' },
        { label: 'Externe Dienste', value: 'Keine', status: 'ok' }
      ]
    }
  ],
  fullDocumentation: `
<h2>BPMN Workflow Engine - Dokumentation</h2>

<h3>1. Uebersicht</h3>
<p>Die BPMN Workflow Engine basiert auf Camunda 7 (Apache 2.0 Lizenz) und ermoeglicht die Modellierung und Automatisierung von Geschaeftsprozessen.</p>

<h3>2. API-Endpoints</h3>
<table>
  <tr><th>Endpoint</th><th>Methode</th><th>Beschreibung</th></tr>
  <tr><td>/api/bpmn/health</td><td>GET</td><td>Engine Health-Check</td></tr>
  <tr><td>/api/bpmn/process-definition</td><td>GET</td><td>Alle Prozess-Definitionen</td></tr>
  <tr><td>/api/bpmn/process-definition/{key}/start</td><td>POST</td><td>Prozess starten</td></tr>
  <tr><td>/api/bpmn/task</td><td>GET</td><td>Offene Tasks</td></tr>
  <tr><td>/api/bpmn/task/{id}/complete</td><td>POST</td><td>Task abschliessen</td></tr>
  <tr><td>/api/bpmn/deployment/create</td><td>POST</td><td>BPMN deployen</td></tr>
</table>

<h3>3. Camunda starten</h3>
<pre>
# Mit BPMN-Profil starten
docker-compose --profile bpmn up -d camunda

# Web UI oeffnen
open http://localhost:8089/camunda
</pre>

<h3>4. Lizenz</h3>
<p><strong>Apache License 2.0</strong> - Die Camunda Community Edition ist vollstaendig Open Source und darf ohne Einschraenkungen kommerziell genutzt werden.</p>
`,
}
