{
  "id": "mobile-purchase",
  "revision": "5d30a93454eb79a62928dba66a0ff1fcc78f79f081b07b972a19bee696c90b66",
  "regions": [
    {
      "id": "device",
      "label": "Mobile device"
    },
    {
      "id": "edge",
      "label": "Edge services"
    }
  ],
  "nodes": [
    {
      "id": "route",
      "label": "Purchase route",
      "kind": "N12",
      "region": "device",
      "ports": [
        {
          "id": "order",
          "profile": "P11",
          "contract": "OrderRouteV1",
          "polarity": "Offer"
        }
      ]
    },
    {
      "id": "checkout",
      "label": "Checkout logic",
      "kind": "N02",
      "region": "device",
      "ports": [
        {
          "id": "order",
          "profile": "P11",
          "contract": "OrderRouteV1",
          "polarity": "Require"
        },
        {
          "id": "grant",
          "profile": "P20",
          "contract": "PurchaseGrantV1",
          "polarity": "Require"
        },
        {
          "id": "pay",
          "profile": "P02",
          "contract": "ChargeV1",
          "polarity": "Require"
        },
        {
          "id": "commit",
          "profile": "P02",
          "contract": "PurchaseCommitV1",
          "polarity": "Require"
        },
        {
          "id": "intent",
          "profile": "P24",
          "contract": "PurchaseIntentV1",
          "polarity": "Neutral"
        }
      ]
    },
    {
      "id": "session",
      "label": "Principal boundary",
      "kind": "N33",
      "region": "edge",
      "ports": [
        {
          "id": "grant",
          "profile": "P20",
          "contract": "PurchaseGrantV1",
          "polarity": "Offer"
        }
      ]
    },
    {
      "id": "payment",
      "label": "Payment adapter",
      "kind": "N30",
      "region": "edge",
      "ports": [
        {
          "id": "charge",
          "profile": "P02",
          "contract": "ChargeV1",
          "polarity": "Offer"
        },
        {
          "id": "effect",
          "profile": "P24",
          "contract": "ExternalEffectRefV1",
          "polarity": "Neutral"
        }
      ]
    },
    {
      "id": "ledger",
      "label": "Purchase ledger",
      "kind": "N21",
      "region": "edge",
      "ports": [
        {
          "id": "commit",
          "profile": "P02",
          "contract": "PurchaseCommitV1",
          "polarity": "Offer"
        },
        {
          "id": "receipt",
          "profile": "P03",
          "contract": "PurchaseReceiptV1",
          "polarity": "Offer"
        },
        {
          "id": "authority",
          "profile": "P24",
          "contract": "TransactionAuthorityV1",
          "polarity": "Neutral"
        }
      ]
    },
    {
      "id": "events",
      "label": "Receipt outbox",
      "kind": "N24",
      "region": "edge",
      "ports": [
        {
          "id": "receipt",
          "profile": "P03",
          "contract": "PurchaseReceiptV1",
          "polarity": "Require"
        }
      ]
    }
  ],
  "relations": [
    {
      "id": "entry",
      "kind": "H36",
      "incidences": [
        {
          "node": "route",
          "port": "order",
          "role": "provider",
          "ordinal": 0
        },
        {
          "node": "checkout",
          "port": "order",
          "role": "consumer",
          "ordinal": 0
        }
      ]
    },
    {
      "id": "auth",
      "kind": "H23",
      "incidences": [
        {
          "node": "session",
          "port": "grant",
          "role": "provider",
          "ordinal": 0
        },
        {
          "node": "checkout",
          "port": "grant",
          "role": "consumer",
          "ordinal": 0
        }
      ]
    },
    {
      "id": "pay",
      "kind": "H05",
      "incidences": [
        {
          "node": "payment",
          "port": "charge",
          "role": "provider",
          "ordinal": 0
        },
        {
          "node": "checkout",
          "port": "pay",
          "role": "consumer",
          "ordinal": 0
        }
      ]
    },
    {
      "id": "commit",
      "kind": "H05",
      "incidences": [
        {
          "node": "ledger",
          "port": "commit",
          "role": "provider",
          "ordinal": 0
        },
        {
          "node": "checkout",
          "port": "commit",
          "role": "consumer",
          "ordinal": 0
        }
      ]
    },
    {
      "id": "outbox",
      "kind": "H02",
      "incidences": [
        {
          "node": "ledger",
          "port": "receipt",
          "role": "provider",
          "ordinal": 0
        },
        {
          "node": "events",
          "port": "receipt",
          "role": "consumer",
          "ordinal": 0
        }
      ]
    },
    {
      "id": "purchase",
      "kind": "H16",
      "incidences": [
        {
          "node": "ledger",
          "port": "authority",
          "role": "authority",
          "ordinal": 0
        },
        {
          "node": "checkout",
          "port": "intent",
          "role": "intent",
          "ordinal": 1
        },
        {
          "node": "payment",
          "port": "effect",
          "role": "externalEffect",
          "ordinal": 2
        }
      ]
    }
  ]
}
