{
  "fixtureId": "fixture-waitlist-promoter",
  "contractName": "promoteWaitlist(waitlist, openSeats)",
  "lessonIds": [
    "build-event-waitlist-promoter"
  ],
  "invalidInputPolicy": "waitlist must be an array of { name: string, eligible: boolean } and openSeats an integer >= 0; else INVALID_WAITLIST_INPUT.",
  "cases": [
    {
      "caseId": "wlp-filter-then-take",
      "kind": "typical",
      "input": {
        "waitlist": [
          {
            "name": "Ana",
            "eligible": true
          },
          {
            "name": "Bo",
            "eligible": false
          },
          {
            "name": "Cem",
            "eligible": true
          },
          {
            "name": "Dara",
            "eligible": true
          }
        ],
        "openSeats": 2
      },
      "expected": [
        "Ana",
        "Cem"
      ],
      "reason": "Skips ineligible Bo and promotes first two eligible students in order.",
      "catchesBug": "Catches slicing before filtering ineligible entries."
    },
    {
      "caseId": "wlp-zero-seats",
      "kind": "boundary",
      "input": {
        "waitlist": [
          {
            "name": "Ana",
            "eligible": true
          }
        ],
        "openSeats": 0
      },
      "expected": [],
      "reason": "Zero open seats returns an empty promotion list."
    },
    {
      "caseId": "wlp-empty-waitlist",
      "kind": "boundary",
      "input": {
        "waitlist": [],
        "openSeats": 3
      },
      "expected": [],
      "reason": "Empty waitlist safely returns empty list."
    },
    {
      "caseId": "wlp-more-seats-than-eligible",
      "kind": "boundary",
      "input": {
        "waitlist": [
          {
            "name": "Ana",
            "eligible": true
          },
          {
            "name": "Bo",
            "eligible": false
          }
        ],
        "openSeats": 5
      },
      "expected": [
        "Ana"
      ],
      "reason": "Promotes only available eligible students without padding."
    },
    {
      "caseId": "wlp-invalid-neg-seats",
      "kind": "invalid",
      "input": {
        "waitlist": [
          {
            "name": "Ana",
            "eligible": true
          }
        ],
        "openSeats": -1
      },
      "expectedError": "INVALID_WAITLIST_INPUT",
      "reason": "Negative openSeats is invalid."
    },
    {
      "caseId": "wlp-invalid-after-capacity",
      "kind": "invalid",
      "input": {
        "waitlist": [
          {
            "name": "Ana",
            "eligible": true
          },
          {
            "name": "Cem",
            "eligible": "yes"
          }
        ],
        "openSeats": 1
      },
      "expectedError": "INVALID_WAITLIST_INPUT",
      "reason": "Validate all entries before selecting eligible names, even after filling the last seat."
    }
  ]
}
