{
  // Teil 17: Sequenzdiagramme — Modell mit Dynamic Views für Checkout-Flow
  "specification": {
    "elements": {
      "actor":   { "notation": "Actor" },
      "system":  { "notation": "Software System", "container": true },
      "service": { "notation": "Service",          "container": true },
      "queue":   { "notation": "Queue" }
    },
    "relationships": {
      "uses":  { "notation": "uses"  },
      "async": { "notation": "async", "dashed": true }
    }
  },
  "model": {
    "customer": { "kind": "actor", "title": "Customer" },
    "shop": {
      "kind": "system", "title": "Online Shop",
      "children": {
        "frontend":     { "kind": "service", "title": "Web Frontend",   "technology": "React" },
        "api":          { "kind": "service", "title": "REST API",        "technology": "Go"    },
        "authservice":  { "kind": "service", "title": "Auth Service",    "technology": "Go"    },
        "paymentservice":{ "kind": "service","title": "Payment Service", "technology": "Go"    }
      }
    },
    "eventbus": { "kind": "queue", "title": "Event Bus", "technology": "Kafka" }
  },
  "relationships": [
    { "from": "customer",              "to": "shop",                    "label": "kauft ein",      "kind": "uses"  },
    { "from": "shop.frontend",         "to": "shop.api",                "label": "POST /orders",   "kind": "uses"  },
    { "from": "shop.api",              "to": "shop.authservice",        "label": "validate token", "kind": "uses"  },
    { "from": "shop.api",              "to": "shop.paymentservice",     "label": "charge(amount)", "kind": "uses"  },
    { "from": "shop.api",              "to": "eventbus",                "label": "order.created",  "kind": "async" }
  ],
  "dynamicViews": [
    {
      "key":   "checkout-flow",
      "title": "Checkout-Flow",
      "steps": [
        { "index": 1, "from": "shop.frontend",      "to": "shop.api",          "label": "POST /orders",      "type": "sync"   },
        { "index": 2, "from": "shop.api",            "to": "shop.authservice",  "label": "validate token",    "type": "sync"   },
        { "index": 3, "from": "shop.authservice",    "to": "shop.api",          "label": "200 OK",            "type": "return" },
        { "index": 4, "from": "shop.api",            "to": "shop.paymentservice","label": "charge(amount)",   "type": "sync"   },
        { "index": 5, "from": "shop.paymentservice", "to": "shop.api",          "label": "OK",                "type": "return" },
        { "index": 6, "from": "shop.api",            "to": "eventbus",          "label": "order.created",     "type": "async"  },
        { "index": 7, "from": "shop.api",            "to": "shop.frontend",     "label": "201 Created",       "type": "return" }
      ]
    }
  ],
  "views": {
    "context":    { "title": "System Context", "include": ["customer", "shop", "eventbus"] },
    "services":   { "title": "Service View",   "scope": "shop", "include": ["shop.*", "eventbus"] }
  }
}
