{
  "schema_version": 2,
  "diagram_type": "workflow",
  "meta": {
    "title": "Entry-point PIN validation",
    "locale": "en",
    "quality_profile": "showcase"
  },
  "lanes": [
    {
      "id": "gate",
      "label": "Entry-point call and checks"
    },
    {
      "id": "outcome",
      "label": "Outcome"
    },
    {
      "id": "pin",
      "label": "PIN validation view"
    }
  ],
  "mainPath": [
    "call",
    "param",
    "default_url",
    "expert",
    "pin_view",
    "ask_digits",
    "pin_valid",
    "open_url"
  ],
  "nodes": [
    {
      "id": "call",
      "lane": "gate",
      "col": 0,
      "type": "external",
      "label": "Client call",
      "sublabel": "ASI or other client"
    },
    {
      "id": "param",
      "lane": "gate",
      "col": 1,
      "type": "security",
      "label": "PIN param set?",
      "sublabel": "pinvalidationrequired"
    },
    {
      "id": "default_url",
      "lane": "gate",
      "col": 2,
      "type": "security",
      "label": "Default URL?",
      "sublabel": "entry-point context"
    },
    {
      "id": "expert",
      "lane": "gate",
      "col": 3,
      "type": "security",
      "label": "Expert agent?",
      "sublabel": "expert roles"
    },
    {
      "id": "skip",
      "lane": "gate",
      "col": 4,
      "type": "security",
      "label": "Skip PIN?",
      "sublabel": "expert decides"
    },
    {
      "id": "pin_view",
      "lane": "pin",
      "col": 3,
      "type": "frontend",
      "label": "Show PIN view",
      "sublabel": "customer actions"
    },
    {
      "id": "ask_digits",
      "lane": "pin",
      "col": 4,
      "type": "backend",
      "label": "Ask 2 digits",
      "sublabel": "validate input"
    },
    {
      "id": "pin_valid",
      "lane": "pin",
      "col": 5,
      "type": "security",
      "label": "PIN valid?",
      "sublabel": "2 of current PIN"
    },
    {
      "id": "url_view",
      "lane": "outcome",
      "col": 2,
      "type": "frontend",
      "label": "URL view",
      "sublabel": "choose entry point"
    },
    {
      "id": "open_url",
      "lane": "outcome",
      "col": 5,
      "type": "frontend",
      "label": "Open KBP URL",
      "sublabel": "requested URL, end"
    }
  ],
  "edges": [
    {
      "id": "e_call",
      "from": "call",
      "to": "param",
      "label": "request",
      "variant": "emphasis",
      "role": "main"
    },
    {
      "id": "e_param_yes",
      "from": "param",
      "to": "default_url",
      "label": "yes",
      "variant": "emphasis",
      "role": "main"
    },
    {
      "id": "e_param_no",
      "from": "param",
      "to": "open_url",
      "label": "no: open directly",
      "role": "branch"
    },
    {
      "id": "e_default_yes",
      "from": "default_url",
      "to": "expert",
      "label": "yes",
      "variant": "emphasis",
      "role": "main"
    },
    {
      "id": "e_default_no",
      "from": "default_url",
      "to": "url_view",
      "label": "no",
      "role": "branch"
    },
    {
      "id": "e_expert_no",
      "from": "expert",
      "to": "pin_view",
      "label": "no",
      "variant": "emphasis",
      "role": "main"
    },
    {
      "id": "e_expert_yes",
      "from": "expert",
      "to": "skip",
      "label": "yes",
      "role": "branch"
    },
    {
      "id": "e_skip_no",
      "from": "skip",
      "to": "pin_view",
      "label": "no",
      "role": "branch"
    },
    {
      "id": "e_skip_yes",
      "from": "skip",
      "to": "open_url",
      "label": "yes: skip",
      "role": "branch"
    },
    {
      "id": "e_view_ask",
      "from": "pin_view",
      "to": "ask_digits",
      "label": "ask customer",
      "variant": "emphasis",
      "role": "main"
    },
    {
      "id": "e_ask_valid",
      "from": "ask_digits",
      "to": "pin_valid",
      "label": "check",
      "variant": "emphasis",
      "role": "main"
    },
    {
      "id": "e_valid_no",
      "from": "pin_valid",
      "to": "ask_digits",
      "label": "no: retry",
      "role": "return"
    },
    {
      "id": "e_valid_yes",
      "from": "pin_valid",
      "to": "open_url",
      "label": "yes",
      "variant": "emphasis",
      "role": "main"
    }
  ],
  "cards": [
    {
      "dot": "cyan",
      "title": "Entry-point contexts",
      "items": [
        "ASI is the main caller when it did no PIN check",
        "Separate URLs: Default/EnWiCore, E-Mobility, Permission, Auftragserfassung"
      ]
    },
    {
      "dot": "amber",
      "title": "Expert roles (may skip)",
      "items": [
        "UserForderungsmanagement, AdminForderungsmanagement",
        "UserRechnungsmanagement, UserRechtsabteilung",
        "UserLeadmanagement"
      ]
    },
    {
      "dot": "emerald",
      "title": "PIN view actions",
      "items": [
        "Send customer-portal link for self-service",
        "Send current PIN via SMS",
        "Generate PIN and send to customer",
        "Ask customer for 2 digits of the current PIN"
      ]
    }
  ]
}
