[
  {
    "id": "happy-path",
    "name": "Valid order in stock is invoiced, shipped and paid",
    "inputs": {
      "orderId": "SO-1001",
      "orderTotal": 1200,
      "customerRating": "A"
    },
    "mocks": {
      "order-validate": {
        "outputs": {
          "valid": true
        }
      },
      "inventory-check": {
        "outputs": {
          "available": true
        }
      },
      "inventory-reserve": {
        "outputs": {
          "reservationId": "R-77"
        }
      },
      "invoice-create": {
        "outputs": {
          "invoiceId": "INV-9"
        }
      },
      "shipment-create": {
        "outputs": {
          "trackingNumber": "1Z999"
        }
      },
      "order-close": {}
    },
    "expect": {
      "path": [
        "credit-decision",
        "reserve-items",
        "create-invoice",
        "await-payment",
        "order-closed"
      ],
      "variables": {
        "credit": {
          "decision": "approve",
          "termsDays": 30
        },
        "reservationId": "R-77"
      }
    }
  },
  {
    "id": "out-of-stock",
    "name": "Out-of-stock order is cancelled through the error boundary",
    "inputs": {
      "orderId": "SO-1002",
      "orderTotal": 80,
      "customerRating": "B"
    },
    "mocks": {
      "order-validate": {
        "outputs": {
          "valid": true
        }
      },
      "inventory-check": {
        "outputs": {
          "available": false
        }
      },
      "order-cancel": {},
      "customer-notify": {}
    },
    "expect": {
      "path": [
        "out-of-stock",
        "on-out-of-stock",
        "cancel-order",
        "order-cancelled"
      ]
    }
  },
  {
    "id": "credit-declined",
    "name": "Order from a customer rated C is declined",
    "inputs": {
      "orderId": "SO-1003",
      "orderTotal": 5000,
      "customerRating": "C"
    },
    "mocks": {
      "order-validate": {
        "outputs": {
          "valid": true
        }
      },
      "customer-notify": {}
    },
    "expect": {
      "path": [
        "credit-decision",
        "notify-declined",
        "order-declined"
      ]
    }
  }
]
