Skip to content

Add limited registration stock / capacity tracking#39

Merged
p0lar-bear merged 7 commits intoproductionfrom
12-limited-registration-stock-rebase
Apr 25, 2026
Merged

Add limited registration stock / capacity tracking#39
p0lar-bear merged 7 commits intoproductionfrom
12-limited-registration-stock-rebase

Conversation

@canadabirdie
Copy link
Copy Markdown
Collaborator

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

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
@p0lar-bear
Copy link
Copy Markdown

p0lar-bear commented Apr 20, 2026

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.

@p0lar-bear p0lar-bear added type:enhancement New feature or request priority:0-highest Critical work that needs to be done ASAP. status:in-progress Being worked on by someone. labels Apr 20, 2026
@p0lar-bear p0lar-bear requested review from anadon and p0lar-bear April 20, 2026 01:17
@p0lar-bear p0lar-bear linked an issue Apr 20, 2026 that may be closed by this pull request
@p0lar-bear p0lar-bear added this to the 2026 Pre-Registration milestone Apr 20, 2026
@anadon
Copy link
Copy Markdown
Collaborator

anadon commented Apr 24, 2026

@p0lar-bear Can you perform a review?

Copy link
Copy Markdown

@p0lar-bear p0lar-bear left a comment

Choose a reason for hiding this comment

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

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 p0lar-bear self-requested a review April 25, 2026 22:51
@p0lar-bear p0lar-bear merged commit e857a81 into production Apr 25, 2026
7 checks passed
@p0lar-bear p0lar-bear deleted the 12-limited-registration-stock-rebase branch April 25, 2026 22:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

priority:0-highest Critical work that needs to be done ASAP. status:in-progress Being worked on by someone. type:enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support limited stock of registrations

3 participants