{
  "schema_version": 1,
  "diagram_type": "sequence",
  "meta": {
    "title": "E-mobility permissions entry point",
    "locale": "en",
    "quality_profile": "showcase",
    "column_fit": "spread",
    "viewBox": [920, 480]
  },
  "participants": [
    { "id": "asi", "type": "external", "label": "ASI", "sublabel": "Agent Support Interface" },
    { "id": "kbp", "type": "backend", "label": "KBP", "sublabel": "Kundenberaterportal" },
    { "id": "emobbilling", "type": "external", "label": "EmobBilling", "sublabel": "E-Mobility Billing API" },
    { "id": "emp", "type": "external", "label": "EMP", "sublabel": "e-mobility provider" },
    { "id": "cim", "type": "security", "label": "CIM", "sublabel": "Customer Identity Management" }
  ],
  "messages": [
    { "id": "call-entry-point", "from": "asi", "to": "kbp", "y": 170, "label": "call KBP entry point with APA id / EmobBilling account GUID", "variant": "emphasis" },
    { "id": "get-debitor-id", "from": "kbp", "to": "emobbilling", "y": 210, "label": "get debitor id by APA id / EmobBilling account GUID", "variant": "default" },
    { "id": "return-debitor-id", "from": "emobbilling", "to": "kbp", "y": 238, "label": "debitor id", "variant": "return" },
    { "id": "get-emp-id", "from": "kbp", "to": "emp", "y": 270, "label": "get EMP id by debitor id", "variant": "default" },
    { "id": "return-emp-id", "from": "emp", "to": "kbp", "y": 298, "label": "EMP id", "variant": "return" },
    { "id": "get-permission-id", "from": "kbp", "to": "cim", "y": 330, "label": "get permission id by EMP id", "variant": "security" },
    { "id": "return-permission-id", "from": "cim", "to": "kbp", "y": 358, "label": "permission id", "variant": "return" },
    { "id": "return-to-asi", "from": "kbp", "to": "asi", "y": 390, "label": "return (permissions view opens)", "variant": "return" }
  ],
  "activations": [
    { "participant": "kbp", "from": 170, "to": 396, "type": "backend" },
    { "participant": "emobbilling", "from": 205, "to": 244, "type": "external" },
    { "participant": "emp", "from": 265, "to": 304, "type": "external" },
    { "participant": "cim", "from": 325, "to": 364, "type": "security" }
  ],
  "cards": [
    {
      "dot": "cyan",
      "title": "Entry point",
      "items": [
        "ASI opens KBP with either an APA id or an EmobBilling account GUID",
        "KBP owns the whole flow; ASI only sees the final permissions view"
      ]
    },
    {
      "dot": "violet",
      "title": "Id resolution chain",
      "items": [
        "EmobBilling maps the caller's id to a debitor id",
        "EMP maps the debitor id to an EMP id",
        "CIM resolves the permission id from the EMP id"
      ]
    }
  ]
}
