[
  {
    "id": "paid-in-full",
    "name": "The customer pays in full and the invoice is closed",
    "inputs": {
      "invoiceId": "INV-100",
      "amountDue": 480
    },
    "mocks": {
      "invoice-send": {},
      "ledger-apply-payment": {
        "outputs": {
          "balance": 0
        }
      },
      "ledger-close-invoice": {}
    },
    "expect": {
      "path": [
        "send-invoice",
        "await-payment",
        "apply-payment",
        "close-invoice",
        "invoice-paid"
      ],
      "variables": {
        "outstanding": 0,
        "reminders": 0
      }
    }
  },
  {
    "id": "small-balance-written-off",
    "name": "A 2.40 shortfall is written off",
    "inputs": {
      "invoiceId": "INV-101",
      "amountDue": 480
    },
    "mocks": {
      "invoice-send": {},
      "ledger-apply-payment": {
        "outputs": {
          "balance": 2.4
        }
      },
      "ledger-write-off": {},
      "ledger-close-invoice": {}
    },
    "expect": {
      "path": [
        "apply-payment",
        "write-off",
        "close-invoice",
        "invoice-paid"
      ]
    }
  }
]
