{
  "id": "type-h02",
  "revision": "4b66899f268b83097c6229b7e3703a03a33c96d372bd81ac42526b6741571377",
  "regions": [
    {
      "id": "storage",
      "label": "Storage",
      "parent": null
    },
    {
      "id": "common-logic",
      "label": "Common logic",
      "parent": null
    }
  ],
  "nodes": [
    {
      "id": "lines",
      "label": "Invoice line snapshot",
      "kind": "N21",
      "region": "storage",
      "ports": [
        {
          "id": "snapshot",
          "profile": "P01",
          "contract": "InvoiceLineItemsV1",
          "polarity": "Offer"
        }
      ]
    },
    {
      "id": "discount",
      "label": "Discount policy",
      "kind": "N31",
      "region": "common-logic",
      "ports": [
        {
          "id": "policy",
          "profile": "P01",
          "contract": "DiscountPolicyV1",
          "polarity": "Offer"
        }
      ]
    },
    {
      "id": "subtotal",
      "label": "Subtotal calculation",
      "kind": "N01",
      "region": "common-logic",
      "ports": [
        {
          "id": "lines",
          "profile": "P01",
          "contract": "InvoiceLineItemsV1",
          "polarity": "Require"
        },
        {
          "id": "policy",
          "profile": "P01",
          "contract": "DiscountPolicyV1",
          "polarity": "Require"
        },
        {
          "id": "value",
          "profile": "P01",
          "contract": "InvoiceSubtotalV1",
          "polarity": "Offer"
        }
      ]
    },
    {
      "id": "tax",
      "label": "Tax calculation",
      "kind": "N01",
      "region": "common-logic",
      "ports": [
        {
          "id": "subtotal",
          "profile": "P01",
          "contract": "InvoiceSubtotalV1",
          "polarity": "Require"
        },
        {
          "id": "value",
          "profile": "P01",
          "contract": "InvoiceTaxV1",
          "polarity": "Offer"
        }
      ]
    },
    {
      "id": "invoice",
      "label": "Invoice assembly",
      "kind": "N01",
      "region": "common-logic",
      "ports": [
        {
          "id": "subtotal",
          "profile": "P01",
          "contract": "InvoiceSubtotalV1",
          "polarity": "Require"
        },
        {
          "id": "tax",
          "profile": "P01",
          "contract": "InvoiceTaxV1",
          "polarity": "Require"
        },
        {
          "id": "save",
          "profile": "P02",
          "contract": "StoreInvoiceReceiptV1",
          "polarity": "Require"
        }
      ]
    },
    {
      "id": "store",
      "label": "Invoice authority",
      "kind": "N21",
      "region": "storage",
      "ports": [
        {
          "id": "save",
          "profile": "P02",
          "contract": "StoreInvoiceReceiptV1",
          "polarity": "Offer"
        }
      ]
    }
  ],
  "relations": [
    {
      "id": "lines",
      "kind": "H02",
      "incidences": [
        {
          "node": "lines",
          "port": "snapshot",
          "role": "source",
          "ordinal": 0
        },
        {
          "node": "subtotal",
          "port": "lines",
          "role": "target",
          "ordinal": 0
        }
      ]
    },
    {
      "id": "policy",
      "kind": "H02",
      "incidences": [
        {
          "node": "discount",
          "port": "policy",
          "role": "source",
          "ordinal": 0
        },
        {
          "node": "subtotal",
          "port": "policy",
          "role": "target",
          "ordinal": 0
        }
      ]
    },
    {
      "id": "subtotal",
      "kind": "H02",
      "incidences": [
        {
          "node": "subtotal",
          "port": "value",
          "role": "source",
          "ordinal": 0
        },
        {
          "node": "tax",
          "port": "subtotal",
          "role": "target",
          "ordinal": 0
        },
        {
          "node": "invoice",
          "port": "subtotal",
          "role": "target",
          "ordinal": 1
        }
      ]
    },
    {
      "id": "tax",
      "kind": "H02",
      "incidences": [
        {
          "node": "tax",
          "port": "value",
          "role": "source",
          "ordinal": 0
        },
        {
          "node": "invoice",
          "port": "tax",
          "role": "target",
          "ordinal": 0
        }
      ]
    },
    {
      "id": "save",
      "kind": "H05",
      "incidences": [
        {
          "node": "invoice",
          "port": "save",
          "role": "caller",
          "ordinal": 0
        },
        {
          "node": "store",
          "port": "save",
          "role": "callee",
          "ordinal": 0
        }
      ]
    }
  ]
}
