{
  "id": "distributed-saga",
  "revision": "8b8092117f03ae98324ad886acabb4bd540beea323873fcd1649648aa2cf210b",
  "regions": [
    {
      "id": "control",
      "label": "Control plane"
    },
    {
      "id": "data",
      "label": "Data plane"
    }
  ],
  "nodes": [
    {
      "id": "coordinator",
      "label": "Durable saga coordinator",
      "kind": "N06",
      "region": "control",
      "ports": [
        {
          "id": "stock",
          "profile": "P02",
          "contract": "ReservationV1",
          "polarity": "Require"
        },
        {
          "id": "payment",
          "profile": "P02",
          "contract": "ChargeV1",
          "polarity": "Require"
        },
        {
          "id": "dispatch",
          "profile": "P02",
          "contract": "DispatchV1",
          "polarity": "Require"
        },
        {
          "id": "authority",
          "profile": "P20",
          "contract": "OrderGrantV1",
          "polarity": "Require"
        },
        {
          "id": "state",
          "profile": "P02",
          "contract": "SagaCommitV1",
          "polarity": "Require"
        },
        {
          "id": "step",
          "profile": "P24",
          "contract": "SagaStepRefV1",
          "polarity": "Neutral"
        }
      ]
    },
    {
      "id": "approve",
      "label": "Order approval",
      "kind": "N33",
      "region": "control",
      "ports": [
        {
          "id": "grant",
          "profile": "P20",
          "contract": "OrderGrantV1",
          "polarity": "Offer"
        }
      ]
    },
    {
      "id": "stock",
      "label": "Stock service",
      "kind": "N19",
      "region": "data",
      "ports": [
        {
          "id": "reserve",
          "profile": "P02",
          "contract": "ReservationV1",
          "polarity": "Offer"
        },
        {
          "id": "release",
          "profile": "P24",
          "contract": "CompensationRefV1",
          "polarity": "Neutral"
        }
      ]
    },
    {
      "id": "payment",
      "label": "Payment service",
      "kind": "N19",
      "region": "data",
      "ports": [
        {
          "id": "charge",
          "profile": "P02",
          "contract": "ChargeV1",
          "polarity": "Offer"
        },
        {
          "id": "refund",
          "profile": "P24",
          "contract": "CompensationRefV1",
          "polarity": "Neutral"
        }
      ]
    },
    {
      "id": "dispatch",
      "label": "Dispatch service",
      "kind": "N19",
      "region": "data",
      "ports": [
        {
          "id": "submit",
          "profile": "P02",
          "contract": "DispatchV1",
          "polarity": "Offer"
        },
        {
          "id": "cancel",
          "profile": "P24",
          "contract": "CompensationRefV1",
          "polarity": "Neutral"
        }
      ]
    },
    {
      "id": "journal",
      "label": "Saga journal",
      "kind": "N21",
      "region": "control",
      "ports": [
        {
          "id": "commit",
          "profile": "P02",
          "contract": "SagaCommitV1",
          "polarity": "Offer"
        }
      ]
    }
  ],
  "relations": [
    {
      "id": "stock",
      "kind": "H05",
      "incidences": [
        {
          "node": "stock",
          "port": "reserve",
          "role": "provider",
          "ordinal": 0
        },
        {
          "node": "coordinator",
          "port": "stock",
          "role": "consumer",
          "ordinal": 0
        }
      ]
    },
    {
      "id": "pay",
      "kind": "H05",
      "incidences": [
        {
          "node": "payment",
          "port": "charge",
          "role": "provider",
          "ordinal": 0
        },
        {
          "node": "coordinator",
          "port": "payment",
          "role": "consumer",
          "ordinal": 0
        }
      ]
    },
    {
      "id": "ship",
      "kind": "H05",
      "incidences": [
        {
          "node": "dispatch",
          "port": "submit",
          "role": "provider",
          "ordinal": 0
        },
        {
          "node": "coordinator",
          "port": "dispatch",
          "role": "consumer",
          "ordinal": 0
        }
      ]
    },
    {
      "id": "grant",
      "kind": "H23",
      "incidences": [
        {
          "node": "approve",
          "port": "grant",
          "role": "provider",
          "ordinal": 0
        },
        {
          "node": "coordinator",
          "port": "authority",
          "role": "consumer",
          "ordinal": 0
        }
      ]
    },
    {
      "id": "journal",
      "kind": "H05",
      "incidences": [
        {
          "node": "journal",
          "port": "commit",
          "role": "provider",
          "ordinal": 0
        },
        {
          "node": "coordinator",
          "port": "state",
          "role": "consumer",
          "ordinal": 0
        }
      ]
    },
    {
      "id": "compensation",
      "kind": "H17",
      "incidences": [
        {
          "node": "coordinator",
          "port": "step",
          "role": "coordinator",
          "ordinal": 0
        },
        {
          "node": "stock",
          "port": "release",
          "role": "stock",
          "ordinal": 1
        },
        {
          "node": "payment",
          "port": "refund",
          "role": "payment",
          "ordinal": 2
        },
        {
          "node": "dispatch",
          "port": "cancel",
          "role": "dispatch",
          "ordinal": 3
        }
      ]
    }
  ]
}
