feat: #76 Add event capacity and waitlist management - #145
Merged
manoahLinks merged 2 commits intoMar 28, 2026
Merged
Conversation
…ve#76) Implement waitlist functionality for sold-out events in the event_manager Soroban contract. New public functions: - join_waitlist(buyer, event_id): join the ordered waitlist for a sold-out event; returns the 1-based queue position. Guards: event must be sold out and not cancelled; duplicate joins are rejected. - get_waitlist_position(event_id, buyer): query position (0 = not listed) - get_waitlist(event_id): return the full ordered waitlist - return_ticket(buyer, event_id, tier_index): allow a ticket holder to return their ticket before the event ends, receive a refund from escrow, and automatically promote the next waitlisted user Automatic promotion: When return_ticket frees a slot, the head of the waitlist is dequeued and a waitlist_promoted event is emitted so the promoted user knows the slot is available. They call purchase_ticket to complete the purchase at their convenience. Waitlist clearing on cancellation: cancel_event now emits a waitlist_cleared event (with count) when there are waitlisted users, so frontends can notify them. New storage keys: - DataKey::Waitlist(u32): Vec<Address> ordered waitlist per event New error variants: - EventNotSoldOut = 21 - AlreadyOnWaitlist = 22 - EventCanceled = 23 Events emitted: - waitlist_joined (event_id, buyer, position) - waitlist_promoted (event_id, promoted_buyer) - waitlist_cleared (event_id, count) on cancel - ticket_returned (event_id, buyer, tier_index, refund_amount) Also includes the base cleanup from crowdpass-live#75 (resolves pre-existing merge-conflict artifacts in lib.rs/test.rs) since upstream main has not yet merged that PR. Test results: 50 passed; 0 failed
|
@jayteemoney Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
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.
Summary
event_managerSoroban contractreturn_ticketso individual buyers can return tickets before an event ends, triggering automatic promotioncancel_eventnow emits awaitlist_clearednotification so frontends can alert waitlisted usersRequirements fulfilled
DataKey::Waitlist(u32)→Vec<Address>per eventjoin_waitlist(event_id)return_ticketfrees a slot and callstry_promote_from_waitlistwaitlist_joined,waitlist_promoted,waitlist_cleared,ticket_returnedget_waitlist_position(event_id, buyer)returns position or 0New public functions
join_waitlist(buyer, event_id)get_waitlist_position(event_id, buyer)get_waitlist(event_id)return_ticket(buyer, event_id, tier_index)New storage / errors / events
Storage:
DataKey::Waitlist(u32)— orderedVec<Address>per eventErrors:
EventNotSoldOut = 21,AlreadyOnWaitlist = 22,EventCanceled = 23Events:
waitlist_joined,waitlist_promoted,waitlist_cleared,ticket_returnedTest results
Closes #76