/**
 * System Info configuration for Audit tab
 */

export const alertsSystemConfig = {
  title: 'Alerts Agent System',
  description: 'Google Alerts & Feed-Ueberwachung mit KI-gestuetzter Relevanzpruefung',
  version: '1.0.0',
  architecture: {
    layers: [
      {
        title: 'Ingestion Layer',
        components: ['RSS Fetcher', 'Email Parser', 'Webhook Receiver', 'APScheduler'],
        color: '#3b82f6',
      },
      {
        title: 'Processing Layer',
        components: ['Deduplication', 'Rule Engine', 'LLM Relevance Scorer'],
        color: '#8b5cf6',
      },
      {
        title: 'Action Layer',
        components: ['Email Actions', 'Webhook Actions', 'Slack Actions'],
        color: '#22c55e',
      },
      {
        title: 'Storage Layer',
        components: ['PostgreSQL', 'Valkey Cache'],
        color: '#f59e0b',
      },
    ],
  },
  features: [
    { name: 'RSS Feed Parsing', status: 'active' as const, description: 'Google Alerts und andere RSS/Atom Feeds' },
    { name: 'LLM Relevance Scoring', status: 'active' as const, description: 'KI-basierte Relevanzpruefung mit Few-Shot Learning' },
    { name: 'Rule Engine', status: 'active' as const, description: 'Regelbasierte Filterung mit Conditions' },
    { name: 'Email Actions', status: 'active' as const, description: 'E-Mail-Benachrichtigungen bei Matches' },
    { name: 'Webhook Actions', status: 'active' as const, description: 'HTTP Webhooks fuer Integrationen' },
    { name: 'Slack Actions', status: 'active' as const, description: 'Slack Block Kit Nachrichten' },
    { name: 'Email Parsing', status: 'planned' as const, description: 'Google Alerts per E-Mail empfangen' },
    { name: 'Microsoft Teams', status: 'planned' as const, description: 'Teams Adaptive Cards' },
  ],
  roadmap: [
    {
      phase: 'Phase 1 (Completed)',
      priority: 'high' as const,
      items: ['PostgreSQL Persistenz', 'Repository Pattern', 'Alembic Migrations'],
    },
    {
      phase: 'Phase 2 (Completed)',
      priority: 'high' as const,
      items: ['Topic CRUD API', 'APScheduler Integration', 'Email Parser'],
    },
    {
      phase: 'Phase 3 (Completed)',
      priority: 'medium' as const,
      items: ['Rule Engine', 'Condition Operators', 'Rule API'],
    },
    {
      phase: 'Phase 4 (Completed)',
      priority: 'medium' as const,
      items: ['Action Dispatcher', 'Email/Webhook/Slack Actions'],
    },
    {
      phase: 'Phase 5 (Current)',
      priority: 'high' as const,
      items: ['Studio Frontend', 'Admin Frontend', 'Audit & Documentation'],
    },
  ],
  technicalDetails: [
    { component: 'Backend', technology: 'FastAPI', version: '0.100+', description: 'Async REST API' },
    { component: 'ORM', technology: 'SQLAlchemy', version: '2.0', description: 'Async ORM mit PostgreSQL' },
    { component: 'Scheduler', technology: 'APScheduler', version: '3.x', description: 'AsyncIO Scheduler' },
    { component: 'HTTP Client', technology: 'httpx', description: 'Async HTTP fuer Webhooks' },
    { component: 'Feed Parser', technology: 'feedparser', version: '6.x', description: 'RSS/Atom Parsing' },
    { component: 'LLM Gateway', technology: 'Ollama/vLLM/Claude', description: 'Multi-Provider LLM' },
  ],
  privacyNotes: [
    'Alle Daten werden in Deutschland gespeichert (PostgreSQL)',
    'Keine personenbezogenen Daten in Alerts (nur URLs und Snippets)',
    'LLM-Verarbeitung kann on-premise mit Ollama/vLLM erfolgen',
    'DSGVO-konforme Datenverarbeitung',
  ],
  auditInfo: [
    {
      category: 'Datenbank',
      items: [
        { label: 'Tabellen', value: '4 (topics, items, rules, profiles)', status: 'ok' as const },
        { label: 'Indizes', value: 'URL-Hash, Topic-ID, Status', status: 'ok' as const },
        { label: 'Backups', value: 'PostgreSQL pg_dump', status: 'ok' as const },
      ],
    },
    {
      category: 'API Sicherheit',
      items: [
        { label: 'Authentifizierung', value: 'Bearer Token (geplant)', status: 'warning' as const },
        { label: 'Rate Limiting', value: 'Nicht implementiert', status: 'warning' as const },
        { label: 'Input Validation', value: 'Pydantic Models', status: 'ok' as const },
      ],
    },
    {
      category: 'Logging & Monitoring',
      items: [
        { label: 'Structured Logging', value: 'Python logging', status: 'ok' as const },
        { label: 'Metriken', value: 'Stats Endpoint', status: 'ok' as const },
        { label: 'Health Checks', value: '/api/alerts/health', status: 'ok' as const },
      ],
    },
  ],
  fullDocumentation: `
    <h3>Alerts Agent - Entwicklerdokumentation</h3>
    <h4>API Endpoints</h4>
    <ul>
      <li><code>GET /api/alerts/inbox</code> - Alerts auflisten</li>
      <li><code>POST /api/alerts/ingest</code> - Alert hinzufuegen</li>
      <li><code>GET /api/alerts/topics</code> - Topics auflisten</li>
      <li><code>POST /api/alerts/topics</code> - Topic erstellen</li>
      <li><code>GET /api/alerts/rules</code> - Regeln auflisten</li>
      <li><code>POST /api/alerts/rules</code> - Regel erstellen</li>
      <li><code>GET /api/alerts/profile</code> - Profil abrufen</li>
      <li><code>PUT /api/alerts/profile</code> - Profil aktualisieren</li>
    </ul>
    <h4>Architektur</h4>
    <p>Der Alerts Agent verwendet ein Pipeline-basiertes Design:</p>
    <ol>
      <li><strong>Ingestion</strong>: RSS Feeds werden periodisch abgerufen</li>
      <li><strong>Deduplication</strong>: SimHash-basierte Duplikaterkennung</li>
      <li><strong>Scoring</strong>: LLM-basierte Relevanzpruefung</li>
      <li><strong>Rules</strong>: Regelbasierte Filterung und Aktionen</li>
      <li><strong>Actions</strong>: Email/Webhook/Slack Benachrichtigungen</li>
    </ol>
  `,
}
