{
  "schema_version": 1,
  "diagram_type": "sequence",
  "meta": {
    "title": "iSpeed.my — Share Servicing Flow",
    "subtitle": "Buying power, share pickup, and trade transactions",
    "output": "ispeed-share-servicing.html",
    "viewBox": [1080, 650],
    "column_fit": "spread",
    "animation": "trace",
    "quality_profile": "showcase",
    "views": [
      { "id": "buying-power", "label": "Buying Power", "focus": ["user", "app", "mobile-api", "vbroker"], "note": "Order limit and account balance" },
      { "id": "pickup", "label": "Share Pickup", "focus": ["web", "web-api", "vbroker"], "note": "Claim trade entitlements" },
      { "id": "full-flow", "label": "Full Flow", "focus": ["user", "app", "web", "mobile-api", "web-api", "vbroker"], "note": "Complete share servicing lifecycle" }
    ]
  },
  "participants": [
    { "id": "user", "type": "external", "label": "User", "sublabel": "Trader" },
    { "id": "app", "type": "frontend", "label": "React Native App", "sublabel": "order screen" },
    { "id": "web", "type": "frontend", "label": "Back Office", "sublabel": "web app" },
    { "id": "mobile-api", "type": "backend", "label": "Mobile API", "sublabel": "rt-mx-mobile-api" },
    { "id": "web-api", "type": "backend", "label": "Web API", "sublabel": "rt-mx-web-api" },
    { "id": "vbroker", "type": "backend", "label": "VBroker API", "sublabel": "/account" }
  ],
  "segments": [
    { "from": 150, "to": 325, "label": "Buying Power" },
    { "from": 335, "to": 445, "label": "Share Pickup" },
    { "from": 455, "to": 600, "label": "Trade Transactions" }
  ],
  "messages": [
    { "id": "ss1", "from": "user", "to": "app", "y": 160, "label": "Open order screen", "variant": "default" },
    { "id": "ss2", "from": "app", "to": "mobile-api", "y": 190, "label": "ViewOrderLimit (40010)", "variant": "emphasis" },
    { "id": "ss3", "from": "mobile-api", "to": "vbroker", "y": 220, "label": "/order/check_limit", "variant": "default" },
    { "id": "ss4", "from": "vbroker", "to": "mobile-api", "y": 250, "label": "buying power", "variant": "return" },
    { "id": "ss5", "from": "mobile-api", "to": "app", "y": 280, "label": "max order power", "variant": "return" },
    { "id": "ss6", "from": "app", "to": "user", "y": 310, "label": "Show max quantity", "variant": "return" },
    { "id": "ss7", "from": "user", "to": "web", "y": 340, "label": "Back-office share pickup", "variant": "default" },
    { "id": "ss8", "from": "web", "to": "web-api", "y": 370, "label": "SharePickup", "variant": "emphasis" },
    { "id": "ss9", "from": "web-api", "to": "vbroker", "y": 400, "label": "/account/outstanding/pickup", "variant": "default" },
    { "id": "ss10", "from": "vbroker", "to": "web-api", "y": 430, "label": "pickup status", "variant": "return" },
    { "id": "ss11", "from": "web", "to": "web-api", "y": 460, "label": "ViewTradeTransactions", "variant": "emphasis" },
    { "id": "ss12", "from": "web-api", "to": "vbroker", "y": 490, "label": "/account/trade/transactions", "variant": "default" },
    { "id": "ss13", "from": "vbroker", "to": "web-api", "y": 520, "label": "trade history", "variant": "return" },
    { "id": "ss14", "from": "web-api", "to": "web", "y": 550, "label": "results", "variant": "return" }
  ],
  "activations": [
    { "participant": "app", "from": 155, "to": 315, "type": "frontend" },
    { "participant": "mobile-api", "from": 185, "to": 285, "type": "backend" },
    { "participant": "web", "from": 335, "to": 555, "type": "frontend" },
    { "participant": "web-api", "from": 365, "to": 555, "type": "backend" },
    { "participant": "vbroker", "from": 215, "to": 255, "type": "backend" }
  ],
  "cards": [
    {
      "dot": "emerald",
      "title": "Two Buying-Power Paths",
      "items": [
        "11640 account balance via /account/account_enquiry",
        "40010 order limit via /order/check_limit",
        "Order screen uses 40010 for max quantity"
      ]
    },
    {
      "dot": "violet",
      "title": "Share Pickup",
      "items": [
        "sp_update_pickup_nocontra stored procedure",
        "Pre-checks availability, ownership, and limits",
        "Tables vb_trade_tran, vb_customer_acct_bal"
      ]
    },
    {
      "dot": "rose",
      "title": "CDS Transfer-In",
      "items": [
        "GetCDSShareTransferInService is unwired (dead config)",
        "Live CDS path is /cds/confirm and /cds/cdstransfer",
        "Table vb_asset_tran"
      ]
    }
  ]
}
