{
  "fixtureId": "fixture-lab-equipment-loan",
  "contractName": "canLoanEquipment(stockMap, itemCode, hasSafetyClearance)",
  "lessonIds": [
    "build-lab-equipment-loan-checker"
  ],
  "invalidInputPolicy": "stockMap must be a plain object with integer values >= 0, itemCode a non-empty string, and hasSafetyClearance boolean; else INVALID_LOAN_INPUT.",
  "cases": [
    {
      "caseId": "lel-in-stock",
      "kind": "typical",
      "input": {
        "stockMap": {
          "OSC-1": 2,
          "METER-2": 0
        },
        "itemCode": "OSC-1",
        "hasSafetyClearance": true
      },
      "expected": true,
      "reason": "Available equipment with safety clearance approves."
    },
    {
      "caseId": "lel-zero-stock",
      "kind": "boundary",
      "input": {
        "stockMap": {
          "OSC-1": 2,
          "METER-2": 0
        },
        "itemCode": "METER-2",
        "hasSafetyClearance": true
      },
      "expected": false,
      "reason": "Zero stock declines loan."
    },
    {
      "caseId": "lel-missing-key",
      "kind": "boundary",
      "input": {
        "stockMap": {
          "OSC-1": 2
        },
        "itemCode": "LASER-9",
        "hasSafetyClearance": true
      },
      "expected": false,
      "reason": "Missing key defaults safely to 0 stock and declines.",
      "catchesBug": "Catches uncaught missing-key crashes."
    },
    {
      "caseId": "lel-no-clearance",
      "kind": "typical",
      "input": {
        "stockMap": {
          "OSC-1": 2
        },
        "itemCode": "OSC-1",
        "hasSafetyClearance": false
      },
      "expected": false,
      "reason": "Without safety clearance, loan is declined even when in stock.",
      "catchesBug": "Catches forgetting clearance check."
    },
    {
      "caseId": "lel-invalid-empty-code",
      "kind": "invalid",
      "input": {
        "stockMap": {
          "OSC-1": 2
        },
        "itemCode": "",
        "hasSafetyClearance": true
      },
      "expectedError": "INVALID_LOAN_INPUT",
      "reason": "Empty itemCode is invalid input."
    }
  ]
}
