{
  "example_id": "manufacturing--tooling-service-prepayments",
  "currency": "USD",
  "amount_unit": "USD cents; illustrative test values, not prices",
  "checks_scope": "Local deterministic model only. Partial failures require individually identified external sub-operations. These are not live concurrency, payment or recovery tests.",
  "steps": [
    {
      "ik": "fixture-1",
      "action": "fund",
      "type": "tooling_service_prepayments_fund",
      "parameters": {
        "source_id": "1",
        "amount": "1000"
      },
      "expected_outcome": "posted",
      "expected_balances": {
        "assets/confirmed-cash": "1000",
        "liabilities/sources:1/available": "1000"
      }
    },
    {
      "ik": "fixture-1",
      "action": "fund",
      "type": "tooling_service_prepayments_fund",
      "parameters": {
        "source_id": "1",
        "amount": "1000"
      },
      "expected_outcome": "replay",
      "expected_balances": {
        "assets/confirmed-cash": "1000",
        "liabilities/sources:1/available": "1000"
      }
    },
    {
      "ik": "fixture-3",
      "action": "reserve",
      "type": "tooling_service_prepayments_reserve",
      "parameters": {
        "source_id": "1",
        "case_id": "1",
        "amount": "700"
      },
      "expected_outcome": "posted",
      "expected_balances": {
        "liabilities/sources:1/available": "300",
        "liabilities/sources:1/cases:1/held": "700"
      }
    },
    {
      "ik": "fixture-4",
      "action": "reserve",
      "type": "tooling_service_prepayments_reserve",
      "parameters": {
        "source_id": "1",
        "case_id": "1",
        "amount": "400"
      },
      "expected_outcome": "condition_rejected",
      "expected_balances": {
        "liabilities/sources:1/available": "300",
        "liabilities/sources:1/cases:1/held": "700"
      }
    },
    {
      "ik": "fixture-5",
      "action": "complete",
      "type": "tooling_service_prepayments_complete",
      "parameters": {
        "source_id": "1",
        "case_id": "1",
        "amount": "500"
      },
      "expected_outcome": "posted",
      "expected_balances": {
        "liabilities/sources:1/cases:1/held": "200",
        "income/cases:1": "500"
      }
    },
    {
      "ik": "fixture-6",
      "action": "complete",
      "type": "tooling_service_prepayments_complete",
      "parameters": {
        "source_id": "1",
        "case_id": "1",
        "amount": "201"
      },
      "expected_outcome": "condition_rejected"
    },
    {
      "ik": "fixture-7",
      "action": "credit_service",
      "type": "tooling_service_prepayments_credit_service",
      "parameters": {
        "source_id": "1",
        "case_id": "1",
        "amount": "100"
      },
      "expected_outcome": "posted",
      "expected_balances": {
        "income/cases:1": "400",
        "liabilities/sources:1/available": "400"
      }
    },
    {
      "ik": "fixture-8",
      "action": "credit_service",
      "type": "tooling_service_prepayments_credit_service",
      "parameters": {
        "source_id": "1",
        "case_id": "1",
        "amount": "401"
      },
      "expected_outcome": "condition_rejected"
    },
    {
      "ik": "fixture-9",
      "action": "release",
      "type": "tooling_service_prepayments_release",
      "parameters": {
        "source_id": "1",
        "case_id": "1",
        "amount": "200"
      },
      "expected_outcome": "posted",
      "expected_balances": {
        "liabilities/sources:1/cases:1/held": "0",
        "liabilities/sources:1/available": "600"
      }
    },
    {
      "ik": "fixture-10",
      "action": "release",
      "type": "tooling_service_prepayments_release",
      "parameters": {
        "source_id": "1",
        "case_id": "1",
        "amount": "1"
      },
      "expected_outcome": "condition_rejected"
    },
    {
      "ik": "fixture-11",
      "action": "reserve_refund",
      "type": "tooling_service_prepayments_reserve_refund",
      "parameters": {
        "source_id": "1",
        "refund_id": "1",
        "amount": "200"
      },
      "expected_outcome": "posted",
      "expected_balances": {
        "liabilities/sources:1/available": "400",
        "liabilities/sources:1/refunds:1/pending": "200"
      }
    },
    {
      "ik": "fixture-12",
      "action": "refund_failed",
      "type": "tooling_service_prepayments_refund_failed",
      "parameters": {
        "source_id": "1",
        "refund_id": "1",
        "amount": "50"
      },
      "expected_outcome": "posted",
      "expected_balances": {
        "liabilities/sources:1/available": "450",
        "liabilities/sources:1/refunds:1/pending": "150"
      }
    },
    {
      "ik": "fixture-13",
      "action": "refund_settled",
      "type": "tooling_service_prepayments_refund_settled",
      "parameters": {
        "source_id": "1",
        "refund_id": "1",
        "amount": "150"
      },
      "expected_outcome": "posted",
      "expected_balances": {
        "liabilities/sources:1/refunds:1/pending": "0",
        "assets/confirmed-cash": "850"
      }
    },
    {
      "ik": "fixture-14",
      "action": "refund_settled",
      "type": "tooling_service_prepayments_refund_settled",
      "parameters": {
        "source_id": "1",
        "refund_id": "1",
        "amount": "1"
      },
      "expected_outcome": "condition_rejected"
    },
    {
      "ik": "fixture-15",
      "action": "reserve",
      "type": "tooling_service_prepayments_reserve",
      "parameters": {
        "source_id": "1",
        "case_id": "1",
        "amount": "0"
      },
      "expected_outcome": "input_rejected"
    }
  ]
}
