{
  "schema_version": 1,
  "mode": "flow",
  "template_type": "flow",
  "style": 11,
  "semantic_profile": "event-transit",
  "diagram_type": "event_stream",
  "line_code": "LINE A · EVENT METRO",
  "quality_profile": "showcase",
  "width": 1172,
  "height": 720,
  "title": "Checkout Event Line",
  "subtitle": "topics as rails, processors as stations, branches only at declared junctions",
  "topics": [
    { "id": "checkout.events", "color": "#e4475b" },
    { "id": "checkout.dlq", "color": "#c62828" }
  ],
  "containers": [
    {
      "id": "checkout-stream",
      "x": 35,
      "y": 140,
      "width": 1102,
      "height": 410,
      "label": "checkout.events",
      "subtitle": "12 partitions · retention 72 h",
      "header_prefix": "LINE A",
      "header_separator": " · "
    }
  ],
  "nodes": [
    {
      "id": "checkout-api",
      "kind": "transit_terminal",
      "transit_role": "producer",
      "topic_id": "checkout.events",
      "station_order": 0,
      "x": 60,
      "y": 258,
      "width": 150,
      "height": 78,
      "label": "Checkout API",
      "sublabel": "producer",
      "rail_color": "#e4475b",
      "badge": "P12"
    },
    {
      "id": "schema-gate",
      "kind": "transit_station",
      "transit_role": "station",
      "topic_id": "checkout.events",
      "station_order": 1,
      "operation": "validate envelope",
      "x": 278,
      "y": 258,
      "width": 150,
      "height": 78,
      "label": "Schema Gate",
      "sublabel": "validate",
      "rail_color": "#e4475b",
      "badge": "v3"
    },
    {
      "id": "fraud-score",
      "kind": "transit_station",
      "transit_role": "station",
      "topic_id": "checkout.events",
      "station_order": 2,
      "operation": "score risk",
      "x": 496,
      "y": 258,
      "width": 150,
      "height": 78,
      "label": "Fraud Score",
      "sublabel": "enrich",
      "rail_color": "#e4475b",
      "badge": "p95 32ms"
    },
    {
      "id": "order-router",
      "kind": "transit_junction",
      "transit_role": "junction",
      "topic_id": "checkout.events",
      "station_order": 3,
      "operation": "route accepted orders",
      "x": 714,
      "y": 258,
      "width": 150,
      "height": 78,
      "label": "Order Router",
      "sublabel": "junction",
      "rail_color": "#e4475b",
      "badge": "fan-out"
    },
    {
      "id": "fulfilment",
      "kind": "transit_terminal",
      "transit_role": "consumer",
      "topic_id": "checkout.events",
      "station_order": 4,
      "consumer_group": "fulfilment-v2",
      "x": 932,
      "y": 258,
      "width": 180,
      "height": 78,
      "label": "Fulfilment",
      "sublabel": "consumer group",
      "rail_color": "#e4475b",
      "badge": "lag 14"
    },
    {
      "id": "checkout-dlq",
      "kind": "transit_terminal",
      "transit_role": "dlq",
      "topic_id": "checkout.dlq",
      "x": 496,
      "y": 430,
      "width": 150,
      "height": 78,
      "label": "Checkout DLQ",
      "sublabel": "manual replay",
      "stroke": "#c62828",
      "badge": "7 events"
    },
    {
      "id": "order-state",
      "kind": "transit_terminal",
      "transit_role": "state_store",
      "topic_id": "checkout.events",
      "x": 714,
      "y": 430,
      "width": 150,
      "height": 78,
      "label": "Order State",
      "sublabel": "materialized view",
      "rail_color": "#00897b",
      "badge": "RocksDB"
    }
  ],
  "arrows": [
    { "id": "rail-01", "source": "checkout-api", "target": "schema-gate", "source_port": "right", "target_port": "left", "flow": "control", "transit_type": "rail", "topic_id": "checkout.events", "motion_role": "topic-rail", "motion_stage": 1, "motion_order": 0 },
    { "id": "rail-12", "source": "schema-gate", "target": "fraud-score", "source_port": "right", "target_port": "left", "flow": "control", "transit_type": "rail", "topic_id": "checkout.events", "motion_role": "topic-rail", "motion_stage": 2, "motion_order": 0 },
    { "id": "rail-23", "source": "fraud-score", "target": "order-router", "source_port": "right", "target_port": "left", "flow": "control", "transit_type": "rail", "topic_id": "checkout.events", "motion_role": "topic-rail", "motion_stage": 3, "motion_order": 0 },
    { "id": "rail-34", "source": "order-router", "target": "fulfilment", "source_port": "right", "target_port": "left", "flow": "control", "transit_type": "rail", "topic_id": "checkout.events", "motion_role": "topic-rail", "motion_stage": 4, "motion_order": 0 },
    { "id": "to-dlq", "source": "fraud-score", "target": "checkout-dlq", "source_port": "bottom", "target_port": "top", "flow": "feedback", "transit_type": "dead_letter", "topic_id": "checkout.dlq", "motion_role": "dead-letter", "motion_stage": 5, "motion_order": 0, "dashed": true },
    { "id": "materialize", "source": "order-router", "target": "order-state", "source_port": "bottom", "target_port": "top", "flow": "write", "transit_type": "state", "topic_id": "checkout.events", "motion_role": "state-project", "motion_stage": 5, "motion_order": 1 }
  ],
  "legend_orientation": "horizontal",
  "legend_x": 48,
  "legend_y": 610,
  "legend_locked": true,
  "legend": [
    { "flow": "control", "label": "topic rail" },
    { "flow": "write", "label": "state projection" },
    { "flow": "feedback", "label": "dead-letter route" }
  ],
  "footer": "Style 11 · Event Transit · ordinary edges remain the semantic rails",
  "footer_x": 48,
  "footer_y": 695
}
