Add limited registration stock / capacity tracking#39
Merged
p0lar-bear merged 7 commits intoproductionfrom Apr 25, 2026
Merged
Conversation
Adds per-PriceLevel capacity limits with atomic counter-based tracking: - New PriceLevel fields: maxCapacity, remainingSlots, reservedSlots, capacityDisplayThreshold - Slot reservation at checkout (PENDING), confirmation on payment success, release on failure/refund - Capacity checks use select_for_update() to prevent overselling - update_capacity_for_status_change() hooks into all payment/webhook status transitions - Frontend displays remaining slots and sold-out state - Management commands: expire_pending_orders, verify_capacity_counters - Tests: capacity unit tests, concurrency stress tests, benchmarks
|
This branch just needs to be rebased against prod, and we need to make sure that the changes made to ordering.py and payments.py work for paypal's flow since they were made before we finished that branch. I've been bedridden all week so I haven't been able to do it myself. |
…e, fixing CI tests.
Collaborator
|
@p0lar-bear Can you perform a review? |
p0lar-bear
reviewed
Apr 25, 2026
p0lar-bear
left a comment
There was a problem hiding this comment.
Needed to add calls to update_capacity_for_status_changes() to the PayPal-specific stuff in paypal_payments.py and paypal_webhook_handlers.py. Local tests passed.
p0lar-bear
approved these changes
Apr 25, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds per-PriceLevel capacity limits with atomic counter-based tracking: