Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Limit

Test Cases for "Per Day," "Per PAX," and "Per Booking" Limits with Checkbox Selection

General Logic:

  • Users can select one, two, or all three limit types using checkboxes.
  • Each selected limit must have a value of at least 1 (no zero or negative values allowed).
  • If multiple limits apply, the strictest limit takes priority (whichever is reached first).
  • If no checkboxes are selected, the add-on is unrestricted.

Test Cases

ScenarioInputExpected Output
User selects only Per Day limitPer Day = 5
The add-on is limited to 5 purchases per day.
No limit per PAX or per booking.
User selects only Per PAX limitPer PAX = 2
Each guest (PAX) can purchase a max of 2 add-ons.
No daily or per booking limit.
User selects only Per Booking limitPer Booking = 3
Each booking can include a max of 3 add-ons, regardless of people number.
No daily or per PAX limit.
User selects Per Day & Per PAXPer Day = 10
Per PAX = 2
The system allows 10 add-ons per day.
Each guest (PAX) can purchase up to 2 add-ons.
If 5 guests book, they can buy up to 10 add-ons max (5 × 2), but no more due to the Per Day limit.
User selects Per Day & Per BookingPer Day = 10
Per Booking = 5
The system allows 10 add-ons per day.
Each booking can purchase a max of 5 add-ons.
If 3 bookings are made, the third booking can only purchase remaining available add-ons (up to 10 total).
User selects Per PAX & Per BookingPer PAX = 2
Per Booking = 5
Each guest (PAX) can buy up to 2 add-ons.
Each booking can include a max of 5 add-ons total.
If a booking has 3 guests, they can buy only 5 add-ons max, even though (3 × 2) = 6 would normally be allowed.
User selects all three optionsPer Day = 10
Per PAX = 2
Per Booking = 5
The strictest limit applies first.
The system allows 10 add-ons per day.
Each guest (PAX) can buy up to 2 add-ons. - Each booking can include a max of 5 add-ons total. - If 2 bookings of 3 guests each are made, each guest can get 2 add-ons, but the system stops at 10 add-ons total.
User deselects all checkboxesPer Day
Per PAX
Per Booking
The add-on is unlimited (no restrictions).
User tries to enter 0 or a negative number in any fieldAny limit = 0 or -5Show error: "Limit must be at least 1."
User enters a large number in Per Day, but low Per PAXPer Day = 50
Per PAX = 1
The system allows up to 50 add-ons per day.
Each guest can only purchase 1 add-on max.
If 50 guests book, all add-ons will be sold out.
User sets Per PAX higher than Per BookingPer PAX = 3
Per Booking = 2
Each guest can buy up to 3 add-ons, but the system restricts each booking to only 2 add-ons total.
Show warning: "Per Booking limit must be greater than or equal to Per PAX limit."
User modifies limits mid-dayBefore:
Per Day = 10

After:
Per Day = 5
If 5 add-ons were already purchased that day, no more add-ons can be bought.
Booking crosses the midnight resetPer Day = 20The daily limit resets at 00:00, allowing 20 more add-ons.
Per PAX limit exceeded, but Per Day limit allows morePer PAX = 1
Per Day = 10
A guest trying to buy 2 add-ons cannot proceed, even if the daily limit isn’t reached.

Error Handling

ScenarioExpected Behavior
User enters 0 or a negative valueShow an error: "Limit must be at least 1."
User tries to purchase more than the Per Day limitShow message: "Maximum add-ons per day reached. Try again tomorrow."
User tries to purchase more than the Per PAX limitShow message: "You can only purchase X add-ons per person."
User tries to purchase more than the Per Booking limitShow message: "Maximum add-ons per booking is X."
User sets Per Booking limit lower than Per PAX limitPrevent saving and show a warning.
User changes a limit after add-ons are purchasedSystem should adjust limits but not affect existing purchases.