Capacity check with <= lets one extra registrant through
@matnvd▲ 0 net votes
A hasCapacity(activeCount, capacity) function that returns activeCount <= capacity reports room when the event is already full, so every event overbooks by one. The correct form is activeCount < capacity. A unit test such as hasCapacity(40, 40) === false catches it. Check the boundary cases (empty, last seat, full) for any seat-count logic.