{
  "schema_version": 1,
  "diagram_type": "sequence",
  "meta": {
    "title": "iSpeed.my — Market Feed & Subscription Flow",
    "subtitle": "Market feed subscription and CBOE agreement generation",
    "output": "ispeed-market-feed-subscription.html",
    "viewBox": [1080, 620],
    "column_fit": "spread",
    "animation": "trace",
    "quality_profile": "showcase",
    "views": [
      { "id": "entitlement", "label": "Entitlement", "focus": ["user", "app", "mobile-api", "vbroker"], "note": "Subscription status from the session" },
      { "id": "subscribe", "label": "Subscribe", "focus": ["app", "mobile-api", "vbroker-ft", "jasper"], "note": "Market-feed subscribe and CBOE PDF" },
      { "id": "full-flow", "label": "Full Flow", "focus": ["user", "app", "mobile-api", "vbroker", "vbroker-ft", "jasper"], "note": "Complete subscription lifecycle" }
    ]
  },
  "participants": [
    { "id": "user", "type": "external", "label": "User", "sublabel": "Trader" },
    { "id": "app", "type": "frontend", "label": "React Native App", "sublabel": "Expo SDK 56" },
    { "id": "mobile-api", "type": "backend", "label": "Mobile API", "sublabel": "rt-mx-mobile-api" },
    { "id": "vbroker", "type": "backend", "label": "VBroker API", "sublabel": "session entitlement" },
    { "id": "vbroker-ft", "type": "backend", "label": "VBroker-FT", "sublabel": "/subscription" },
    { "id": "jasper", "type": "external", "label": "Jaspersoft", "sublabel": "CBOE agreement PDF" }
  ],
  "segments": [
    { "from": 150, "to": 295, "label": "Entitlement" },
    { "from": 305, "to": 565, "label": "Subscribe" }
  ],
  "messages": [
    { "id": "mf1", "from": "user", "to": "app", "y": 160, "label": "Open market feed", "variant": "default" },
    { "id": "mf2", "from": "app", "to": "mobile-api", "y": 190, "label": "GetSubscriptionStatus", "variant": "emphasis" },
    { "id": "mf3", "from": "mobile-api", "to": "vbroker", "y": 220, "label": "session entitlement", "variant": "security" },
    { "id": "mf4", "from": "vbroker", "to": "mobile-api", "y": 250, "label": "status", "variant": "return" },
    { "id": "mf5", "from": "mobile-api", "to": "app", "y": 280, "label": "status + toSubscribe", "variant": "return" },
    { "id": "mf6", "from": "app", "to": "user", "y": 310, "label": "Show plans", "variant": "return" },
    { "id": "mf7", "from": "user", "to": "app", "y": 340, "label": "Subscribe MarketFeedUS (tpin)", "variant": "default" },
    { "id": "mf8", "from": "app", "to": "mobile-api", "y": 370, "label": "MarketFeedSubscription", "variant": "emphasis" },
    { "id": "mf9", "from": "mobile-api", "to": "vbroker-ft", "y": 400, "label": "/subscription/market_feed/add", "variant": "default" },
    { "id": "mf10", "from": "vbroker-ft", "to": "jasper", "y": 430, "label": "generate CBOE agreement", "variant": "dashed" },
    { "id": "mf11", "from": "jasper", "to": "vbroker-ft", "y": 460, "label": "agreement PDF", "variant": "return" },
    { "id": "mf12", "from": "vbroker-ft", "to": "mobile-api", "y": 490, "label": "subscription + doc", "variant": "return" },
    { "id": "mf13", "from": "mobile-api", "to": "app", "y": 520, "label": "subscribed", "variant": "return" }
  ],
  "activations": [
    { "participant": "app", "from": 155, "to": 530, "type": "frontend" },
    { "participant": "mobile-api", "from": 185, "to": 505, "type": "backend" },
    { "participant": "vbroker", "from": 215, "to": 260, "type": "backend" },
    { "participant": "vbroker-ft", "from": 395, "to": 500, "type": "backend" },
    { "participant": "jasper", "from": 425, "to": 470, "type": "external" }
  ],
  "cards": [
    {
      "dot": "emerald",
      "title": "Service Options",
      "items": [
        "vb_service_option: MarketDepth, MarketFeedUS, MarketFeedHK",
        "Monthly amount and promo dates",
        "Subscriptions in vb_customer_svc_sub"
      ]
    },
    {
      "dot": "violet",
      "title": "CBOE Agreement",
      "items": [
        "Generated for MarketFeedUS subscribers",
        "Rendered by Jaspersoft, stored in vb_customer_svc_sub_doc",
        "File <loginName>_CBOE_Agreement_<timestamp>.pdf"
      ]
    },
    {
      "dot": "cyan",
      "title": "Gating",
      "items": [
        "isSubscribedForService gates depth access",
        "TPIN required to subscribe",
        "SubcriptionBursaByPass config can bypass Bursa depth"
      ]
    }
  ]
}
