import type { SystemInfoConfig } from './types'

export const backlogConfig: SystemInfoConfig = {
  title: 'Backlog System-Info',
  description: 'Produkt-Backlog und Feature-Tracking.',
  version: '1.0',
  architecture: {
    layers: [
      { title: 'Backlog UI', components: ['Board View', 'List View', 'Roadmap'], color: '#3b82f6' },
      { title: 'Planning', components: ['Sprint Planning', 'Estimation', 'Prioritization'], color: '#8b5cf6' },
      { title: 'Tracking', components: ['Progress', 'Velocity', 'Burndown'], color: '#10b981' },
      { title: 'Integration', components: ['GitHub', 'Jira', 'Notion'], color: '#f59e0b' },
    ],
  },
  features: [
    { name: 'Feature Tracking', status: 'active', description: 'Anforderungsverwaltung' },
    { name: 'Prioritization', status: 'active', description: 'MoSCoW/RICE Methoden' },
    { name: 'Sprint Planning', status: 'active', description: 'Agile Planung' },
    { name: 'Dependency Tracking', status: 'planned', description: 'Feature-Abhaengigkeiten' },
  ],
  roadmap: [
    { phase: 'Phase 1: Core (Q1)', priority: 'high', items: ['Kanban Board', 'Story Points', 'Labels/Tags', 'Assignees'] },
    { phase: 'Phase 2: Planning (Q2)', priority: 'medium', items: ['Sprint Backlog', 'Velocity Charts', 'Capacity Planning', 'Release Planning'] },
    { phase: 'Phase 3: Intelligence (Q3)', priority: 'low', items: ['Auto-Prioritization', 'Effort Prediction', 'Risk Identification', 'Stakeholder Reports'] },
  ],
  technicalDetails: [
    { component: 'UI', technology: 'React DnD', description: 'Drag & Drop' },
    { component: 'Storage', technology: 'PostgreSQL', description: 'Relational Data' },
    { component: 'Sync', technology: 'GitHub API', description: 'Issue Sync' },
    { component: 'Export', technology: 'CSV/JSON', description: 'Data Export' },
  ],
  auditInfo: [
    {
      category: 'Backlog Status',
      items: [
        { label: 'Offene Items', value: 'Tracking', status: 'ok' },
        { label: 'In Progress', value: 'Tracking', status: 'ok' },
        { label: 'Completed (Sprint)', value: 'Tracking', status: 'ok' },
        { label: 'Backlog Grooming', value: 'Woechentlich', status: 'ok' },
      ],
    },
    {
      category: 'Priorisierung',
      items: [
        { label: 'Must Have', value: 'Tracking', status: 'ok' },
        { label: 'Should Have', value: 'Tracking', status: 'ok' },
        { label: 'Could Have', value: 'Tracking', status: 'ok' },
        { label: 'Wont Have', value: 'Tracking', status: 'ok' },
      ],
    },
    {
      category: 'Integration',
      items: [
        { label: 'GitHub Sync', value: 'Aktiv', status: 'ok' },
        { label: 'Jira Sync', value: 'Optional', status: 'ok' },
        { label: 'Slack Notifications', value: 'Konfigurierbar', status: 'ok' },
        { label: 'Webhooks', value: 'Aktiv', status: 'ok' },
      ],
    },
  ],
  fullDocumentation: `
<h2>Backlog Management System</h2>

<h3>1. Uebersicht</h3>
<p>Das Backlog-Modul verwaltet alle Feature-Anfragen, Bugs und Verbesserungen. Es unterstuetzt agile Methoden wie Scrum und Kanban.</p>

<h3>2. Item-Typen</h3>
<table>
  <tr><th>Typ</th><th>Icon</th><th>Beschreibung</th></tr>
  <tr><td>Epic</td><td>⚡</td><td>Grosses Feature, mehrere Stories</td></tr>
  <tr><td>Story</td><td>📖</td><td>User Story mit Akzeptanzkriterien</td></tr>
  <tr><td>Task</td><td>✓</td><td>Technische Aufgabe</td></tr>
  <tr><td>Bug</td><td>🐛</td><td>Fehlerbericht</td></tr>
  <tr><td>Improvement</td><td>💡</td><td>Verbesserungsvorschlag</td></tr>
</table>

<h3>3. Workflow</h3>
<pre>
┌──────────┐   ┌──────────┐   ┌──────────┐   ┌──────────┐   ┌──────────┐
│ Backlog  │ → │ Selected │ → │ In Dev   │ → │ Review   │ → │ Done     │
└──────────┘   └──────────┘   └──────────┘   └──────────┘   └──────────┘
     │              │              │              │              │
     │              │              │              │              │
  Priorisiert   Sprint       Entwicklung      Code Review    Abgeschlossen
               Planning      & Testing        & QA
</pre>

<h3>4. Item-Struktur</h3>
<pre>
{
  "id": "BP-123",
  "type": "story",
  "title": "Als Nutzer moechte ich...",
  "description": "...",
  "acceptance_criteria": [
    "Gegeben..., Wenn..., Dann..."
  ],
  "priority": "must_have",
  "story_points": 5,
  "labels": ["frontend", "ux"],
  "assignee": "user_id",
  "sprint": "Sprint 12",
  "epic": "BP-100",
  "created_at": "2025-01-14T10:00:00Z",
  "updated_at": "2025-01-14T12:00:00Z"
}
</pre>

<h3>5. Priorisierung (MoSCoW)</h3>
<table>
  <tr><th>Prioritaet</th><th>Beschreibung</th><th>Behandlung</th></tr>
  <tr><td>Must Have</td><td>Unverzichtbar</td><td>Im naechsten Sprint</td></tr>
  <tr><td>Should Have</td><td>Wichtig</td><td>Baldmoeglichst</td></tr>
  <tr><td>Could Have</td><td>Wuenschenswert</td><td>Wenn Zeit</td></tr>
  <tr><td>Wont Have</td><td>Nicht jetzt</td><td>Spaeter evaluieren</td></tr>
</table>

<h3>6. API Endpoints</h3>
<table>
  <tr><th>Endpoint</th><th>Methode</th><th>Beschreibung</th></tr>
  <tr><td>/api/backlog/items</td><td>GET</td><td>Items listen</td></tr>
  <tr><td>/api/backlog/items</td><td>POST</td><td>Neues Item</td></tr>
  <tr><td>/api/backlog/items/{id}</td><td>PATCH</td><td>Item aktualisieren</td></tr>
  <tr><td>/api/backlog/sprints</td><td>GET</td><td>Sprints listen</td></tr>
  <tr><td>/api/backlog/kanban</td><td>GET</td><td>Board-Ansicht</td></tr>
</table>

<h3>7. Sprint Planning</h3>
<pre>
Sprint Planning Flow:

1. Velocity berechnen
   └── Durchschnitt der letzten 3 Sprints

2. Kapazitaet ermitteln
   └── Teamgroesse × Verfuegbarkeit

3. Items auswaehlen
   ├── Priorisierte Items
   ├── Story Points summieren
   └── Kapazitaet nicht ueberschreiten

4. Sprint Goal definieren
   └── Uebergreifendes Ziel

5. Sprint starten
   └── 2 Wochen Timeebox
</pre>

<h3>8. Metriken</h3>
<table>
  <tr><th>Metrik</th><th>Beschreibung</th><th>Ziel</th></tr>
  <tr><td>Velocity</td><td>Story Points/Sprint</td><td>Stabil</td></tr>
  <tr><td>Cycle Time</td><td>Zeit bis Done</td><td>Sinkend</td></tr>
  <tr><td>Lead Time</td><td>Backlog bis Done</td><td>Sinkend</td></tr>
  <tr><td>Burndown</td><td>Remaining Work</td><td>Linear</td></tr>
</table>

<h3>9. GitHub Integration</h3>
<pre>
Sync-Konfiguration:

GitHub Issues → Backlog Items
├── Labels → Typ-Mapping
├── Milestones → Sprints
├── Assignees → Team-Members
└── Comments → Bidirektional

Automatisierung:
├── PR merged → Item nach Done
├── Branch erstellt → Item nach In Dev
└── Review requested → Item nach Review
</pre>

<h3>10. Reporting</h3>
<ul>
  <li><strong>Burndown Chart:</strong> Sprint-Fortschritt</li>
  <li><strong>Velocity Chart:</strong> Trend ueber Sprints</li>
  <li><strong>Cumulative Flow:</strong> WIP-Analyse</li>
  <li><strong>Sprint Report:</strong> Completed vs Planned</li>
</ul>
`,
}
