Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve ticket quantity edge cases #232

Merged

Conversation

grablair
Copy link
Contributor

@grablair grablair commented Sep 15, 2024

Just a variety of QoL changes regarding edge cases for ticket quantities (mostly frontend, one backend change regarding buying fewer than the minimum if there aren't enough tickets to reach the minimum).

  1. Create shared values for all tiers of a given ticket, to ensure mins/maxes are adhered to and the overall maximum won't be exceeded.
    1. If a given tier has less available than the order minimum, incrementing will change the value for that tier to the tickets available. If you then increment another ticket tier, it will increase it only to the level that brings the order value up to the order minimum. (Example: two tiers, 5-ticket minimum. Tier 1 has 3 tickets remaining, and Tier 2 has no limit. If you increment Tier 1 from 0, it will increase to 3. If you then increment Tier 2, it will increase to 2, in order to reach a combined amount of 5)
    2. The overall ticket availability is shared between all tiers of a tiered ticket. (Example: If there are 5 tickets available, and you select 5 of one Tier, it will disable increments for all tiers. If you select 3 from one Tier, and 2 from another, it will disable increments for all tiers, as well)
  2. Modify backend to allow user to buy fewer than the minimum order size if there aren't enough remaining tickets to meet the minimum order size. This only affects orders in which you are buying fewer than the configured minimum order size, AND you are buying all remaining tickets. (Example: if the configured min order size is 5, but there are 3 tickets remaining, you can buy 3 tickets. If the configured minimum order size is 5, the tickets remaining are 3, and you attempt to buy 2 tickets, it should reject the order)

In the below screenshots, there are 18 available tickets overall, only 3 Adult tickets remaining, and unlimited Student / Senior tickets.

Screenshot 2024-09-15 at 12 38 33
Screenshot 2024-09-15 at 12 38 39
Screenshot 2024-09-15 at 12 38 46
Screenshot 2024-09-15 at 12 44 53

Checklist

  • I have read the contributing guidelines.
  • My code is of good quality and follows the coding standards of the project.
  • I have tested my changes, and they work as expected.

Thank you for your contribution! 🎉

1. Create shared values for all tiers of a given ticket, to ensure mins/maxes are adhered
   to and the overall maximum won't be exceeded.
2. Modify backend to allow user to buy < the minimum order size if there aren't enough
   remaining tickets to meet the minimum order size
Copy link
Contributor

github-actions bot commented Sep 15, 2024

All contributors have signed the CLA ✍️ ✅
Posted by the CLA Assistant Lite bot.

@grablair
Copy link
Contributor Author

I have read the CLA Document and I hereby sign the CLA

Copy link
Contributor

@daveearley daveearley left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome! Thanks for creating this. This is a nice UX improvement. I won't have a chance to test this until tomorrow evening PST, but I've left a few minor comments.

Cheers!

@daveearley
Copy link
Contributor

Tested and works as expected. Thanks again @grablair!

@daveearley daveearley merged commit 5fea9fb into HiEventsDev:develop Sep 19, 2024
3 checks passed
@github-actions github-actions bot locked and limited conversation to collaborators Sep 19, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants