{
  "$schema": "https://calm.finos.org/release/1.2/meta/calm.json",
  "unique-id": "online-store-checkout",
  "name": "Online store checkout (fictional example)",
  "description": "A fictional online store checkout described in CALM 1.2 and tagged with Blueprint Catalog ids under the Blueprint Catalog CALM Standard. Example only; no real system is described.",
  "metadata": [
    {
      "blueprint-catalog": {
        "catalog-release": "0.31.0",
        "value-stream-stage-ids": [
          "VS-120.10",
          "VS-120.20",
          "VS-120.30"
        ]
      }
    }
  ],
  "nodes": [
    {
      "unique-id": "shopper",
      "node-type": "actor",
      "name": "Shopper",
      "description": "A customer buying on the web store."
    },
    {
      "unique-id": "storefront",
      "node-type": "webclient",
      "name": "Storefront",
      "description": "The web store the shopper browses and checks out in.",
      "metadata": [
        {
          "blueprint-catalog": {
            "business-capability-ids": [
              "BC-670.10.10"
            ]
          }
        }
      ]
    },
    {
      "unique-id": "order-service",
      "node-type": "service",
      "name": "Order Service",
      "description": "Validates and records orders.",
      "metadata": [
        {
          "blueprint-catalog": {
            "business-capability-ids": [
              "BC-670.10"
            ],
            "data-concept-ids": [
              "DC-110"
            ]
          }
        }
      ]
    },
    {
      "unique-id": "inventory-service",
      "node-type": "service",
      "name": "Inventory Service",
      "description": "Checks availability and reserves stock.",
      "metadata": [
        {
          "blueprint-catalog": {
            "business-capability-ids": [
              "BC-670.20"
            ],
            "data-concept-ids": [
              "DC-170"
            ]
          }
        }
      ]
    },
    {
      "unique-id": "payment-service",
      "node-type": "service",
      "name": "Payment Service",
      "description": "Takes card payments through a payment provider.",
      "metadata": [
        {
          "blueprint-catalog": {
            "business-capability-ids": [
              "BC-250.40.40"
            ],
            "data-concept-ids": [
              "DC-200"
            ]
          }
        }
      ]
    },
    {
      "unique-id": "orders-db",
      "node-type": "database",
      "name": "Orders Database",
      "description": "System of record for sales orders.",
      "metadata": [
        {
          "blueprint-catalog": {
            "data-concept-ids": [
              "DC-110"
            ]
          }
        }
      ]
    },
    {
      "unique-id": "inventory-db",
      "node-type": "database",
      "name": "Inventory Database",
      "description": "Stock balances by product and location.",
      "metadata": [
        {
          "blueprint-catalog": {
            "data-concept-ids": [
              "DC-170"
            ]
          }
        }
      ]
    }
  ],
  "relationships": [
    {
      "unique-id": "shopper-uses-storefront",
      "description": "The shopper browses and checks out.",
      "relationship-type": {
        "interacts": {
          "actor": "shopper",
          "nodes": [
            "storefront"
          ]
        }
      }
    },
    {
      "unique-id": "storefront-to-order",
      "description": "Submit the order.",
      "protocol": "HTTPS",
      "relationship-type": {
        "connects": {
          "source": {
            "node": "storefront"
          },
          "destination": {
            "node": "order-service"
          }
        }
      }
    },
    {
      "unique-id": "order-to-inventory",
      "description": "Check availability and reserve stock.",
      "protocol": "HTTPS",
      "relationship-type": {
        "connects": {
          "source": {
            "node": "order-service"
          },
          "destination": {
            "node": "inventory-service"
          }
        }
      }
    },
    {
      "unique-id": "order-to-payment",
      "description": "Authorize the payment.",
      "protocol": "HTTPS",
      "relationship-type": {
        "connects": {
          "source": {
            "node": "order-service"
          },
          "destination": {
            "node": "payment-service"
          }
        }
      }
    },
    {
      "unique-id": "order-to-orders-db",
      "description": "Record the order.",
      "protocol": "JDBC",
      "relationship-type": {
        "connects": {
          "source": {
            "node": "order-service"
          },
          "destination": {
            "node": "orders-db"
          }
        }
      }
    },
    {
      "unique-id": "inventory-to-inventory-db",
      "description": "Read and update stock balances.",
      "protocol": "JDBC",
      "relationship-type": {
        "connects": {
          "source": {
            "node": "inventory-service"
          },
          "destination": {
            "node": "inventory-db"
          }
        }
      }
    }
  ],
  "flows": [
    {
      "unique-id": "place-order",
      "name": "Place an order",
      "description": "From the shopper submitting the basket to a recorded, paid order with stock reserved.",
      "transitions": [
        {
          "relationship-unique-id": "shopper-uses-storefront",
          "sequence-number": 1,
          "description": "Shopper submits the basket."
        },
        {
          "relationship-unique-id": "storefront-to-order",
          "sequence-number": 2,
          "description": "Storefront sends the order for validation."
        },
        {
          "relationship-unique-id": "order-to-inventory",
          "sequence-number": 3,
          "description": "Order Service reserves stock."
        },
        {
          "relationship-unique-id": "order-to-payment",
          "sequence-number": 4,
          "description": "Order Service authorizes payment."
        },
        {
          "relationship-unique-id": "order-to-orders-db",
          "sequence-number": 5,
          "description": "Order Service records the paid order."
        }
      ],
      "metadata": [
        {
          "blueprint-catalog": {
            "business-capability-ids": [
              "BC-670.10",
              "BC-670.20",
              "BC-250.40.40"
            ],
            "value-stream-stage-ids": [
              "VS-120.10",
              "VS-120.20"
            ]
          }
        }
      ]
    }
  ]
}
