Implement Event capacity management and Waitlist functionality. #194
Merged
mubarak23 merged 4 commits intoJun 7, 2025
Conversation
Contributor
Author
|
GM @mubarak23 |
Owner
|
@codebestia i will review this PR tonight |
Contributor
Author
|
GM @mubarak23 |
mubarak23
self-requested a review
June 7, 2025 08:12
Owner
|
@codebestia excellent 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
This pull request introduces event capacity management and waitlist functionality to the ChainEvents contract. It allows event owners to set and update the maximum capacity for events, enforces capacity limits during registration, and enables users to join a waitlist when an event is full. Additionally, it provides mechanisms to automatically register users from the waitlist when spots become available.
Key Changes
1. Event Capacity Management
max_capacitytoEventDetailsstruct to track the maximum number of attendees per event.DEFAULT_EVENT_MAX_CAPACITY.update_event_max_capacityallows event owners to update the capacity of their events (with checks for validity and event state).EventCapacityUpdatedevent when capacity is changed.2. Waitlist Functionality
waitlist,waitlist_position, andjoined_waitlistto track waitlisted users per event.join_event_waitlist: Allows users to join the waitlist if the event is full and they are not already registered or on the waitlist.JoinEventWaitlistevent when a user joins the waitlist.3. Registration Logic Updates
max_capacitybefore allowing a user to register.4. Interface & Event Updates
IEventinterface to include new functions for capacity and waitlist management.EventCapacityUpdatedandJoinEventWaitlistfor better indexer support and transparency.5. Error Handling
EVENT_IS_FULL,ALREADY_JOINED_WAITLIST, etc.).Motivation
Backward Compatibility
Additional Notes
Related Issue
Closes #192