{
  "schema_version": 1,
  "diagram_type": "sequence",
  "meta": {
    "title": "iSpeed.my — Back-Office Batch & Integration Flow",
    "subtitle": "Scheduled file exchange, FIX N2N, reconciliation, and sanctions",
    "output": "ispeed-back-office-batch.html",
    "viewBox": [1080, 620],
    "column_fit": "spread",
    "animation": "trace",
    "quality_profile": "showcase",
    "views": [
      { "id": "files", "label": "File Exchange", "focus": ["scheduler", "integration", "sftp", "db"], "note": "Download and load KIBB/CFT batch files" },
      { "id": "fix", "label": "FIX & Reconciliation", "focus": ["integration", "n2n", "db"], "note": "N2N FIX, reconciliation, FRA, sanctions" },
      { "id": "full-flow", "label": "Full Flow", "focus": ["scheduler", "integration", "sftp", "db", "n2n"], "note": "Complete back-office batch lifecycle" }
    ]
  },
  "participants": [
    { "id": "scheduler", "type": "cloud", "label": "Quartz Scheduler", "sublabel": "vbroker-integration" },
    { "id": "integration", "type": "backend", "label": "Integration Service", "sublabel": "vbroker-integration" },
    { "id": "sftp", "type": "external", "label": "SFTP Hosts", "sublabel": "KIBB / MSIL / N2N" },
    { "id": "db", "type": "database", "label": "PostgreSQL", "sublabel": "vb_* / fra_*" },
    { "id": "n2n", "type": "external", "label": "N2N Gateway", "sublabel": "FIX 4.4" }
  ],
  "segments": [
    { "from": 150, "to": 295, "label": "File Exchange" },
    { "from": 305, "to": 565, "label": "FIX & Reconciliation" }
  ],
  "messages": [
    { "id": "b1", "from": "scheduler", "to": "integration", "y": 160, "label": "trigger batch job", "variant": "default" },
    { "id": "b2", "from": "integration", "to": "sftp", "y": 190, "label": "download CA / CFT / KIBB files", "variant": "dashed" },
    { "id": "b3", "from": "sftp", "to": "integration", "y": 220, "label": "file batch", "variant": "return" },
    { "id": "b4", "from": "integration", "to": "db", "y": 250, "label": "insert KIBB batch tables", "variant": "default" },
    { "id": "b5", "from": "db", "to": "integration", "y": 280, "label": "batch loaded", "variant": "return" },
    { "id": "b6", "from": "integration", "to": "n2n", "y": 310, "label": "FIX N1 / N2 messages", "variant": "emphasis" },
    { "id": "b7", "from": "n2n", "to": "integration", "y": 340, "label": "FIX response (10119)", "variant": "return" },
    { "id": "b8", "from": "integration", "to": "db", "y": 370, "label": "reconcile n2nexp_*", "variant": "default" },
    { "id": "b9", "from": "integration", "to": "sftp", "y": 400, "label": "upload contract / contra", "variant": "dashed" },
    { "id": "b10", "from": "integration", "to": "db", "y": 430, "label": "Sungard / CA reconciliation", "variant": "default" },
    { "id": "b11", "from": "integration", "to": "db", "y": 460, "label": "sanctions screening", "variant": "default" },
    { "id": "b12", "from": "db", "to": "integration", "y": 490, "label": "results", "variant": "return" },
    { "id": "b13", "from": "integration", "to": "scheduler", "y": 520, "label": "batch complete", "variant": "return" }
  ],
  "activations": [
    { "participant": "integration", "from": 155, "to": 530, "type": "backend" },
    { "participant": "sftp", "from": 185, "to": 410, "type": "external" },
    { "participant": "db", "from": 245, "to": 500, "type": "database" },
    { "participant": "n2n", "from": 305, "to": 350, "type": "external" }
  ],
  "cards": [
    {
      "dot": "emerald",
      "title": "File Suite",
      "items": [
        "cft001/002/003, scotrs, dssscrps, recon, contract",
        "SFTP codes FtpSvrKibb / MSIL / N2N",
        "Downloaded via vbroker-external relay"
      ]
    },
    {
      "dot": "violet",
      "title": "FIX N2N",
      "items": [
        "Customer info tag 35=N1, inventory N2",
        "Driven by RabbitMQ MQServer4/5",
        "Responses reconcile by tag 10119"
      ]
    },
    {
      "dot": "rose",
      "title": "Compliance",
      "items": [
        "MOHA / UN sanctions screening",
        "Sungard AM/PM discrepancy emails",
        "FRA export to postgresfra"
      ]
    }
  ]
}
