Skip to content

Neeraj Add Event Waitlist to Improve Event Cards in event Database Design Page Backend#2118

Open
Neeraj-Kondaveeti wants to merge 2 commits intodevelopmentfrom
Neeraj_Add_Event_Waitlist_Feature_Backend
Open

Neeraj Add Event Waitlist to Improve Event Cards in event Database Design Page Backend#2118
Neeraj-Kondaveeti wants to merge 2 commits intodevelopmentfrom
Neeraj_Add_Event_Waitlist_Feature_Backend

Conversation

@Neeraj-Kondaveeti
Copy link
Copy Markdown
Contributor

@Neeraj-Kondaveeti Neeraj-Kondaveeti commented Mar 24, 2026

Description

image image

Related PRS (if any):

To test this backend PR you need to checkout the OneCommunityGlobal/HighestGoodNetworkApp#5057 frontend PR.

Main changes explained:

  • Added waitlist support to event model
    • Introduced waitlist array with userId and timestamp
  • Implemented waitlist APIs
    • POST /events/:eventId/waitlist → Join waitlist
    • DELETE /events/:eventId/waitlist → Leave waitlist
  • Auto-promotion logic
    • Added autoPromoteFromWaitlist helper
    • Promotes users in FIFO order
    • Supports multiple promotions when multiple spots are available
  • Waitlist position tracking
    • Returns correct position when user joins waitlist
    • Calculates user’s position dynamically in getEvents
  • Notification system (simulated)
    • Added sendWaitlistNotification abstraction
    • Triggered when users are promoted from waitlist
  • Improved validation and safety
    • Prevent duplicate waitlist entries
    • Validate userId format
    • Prevent invalid removals
    • Removed unsafe logging of user-controlled data (SonarQube compliance)

How to test:

  1. check into current branch
  2. do npm install and ... to run this PR locally
  3. Clear site data/cache
  4. log as admin user
  5. Test out the following queries in Postman to verify the data is being manipulated correctly and updates the database:
  6. While testing the queries in postman make sure you set this in the body section:
    • {
      "userId": "67b88b03056564426e51bb7b"
      }

You can test out adding multiple users by fetching the user ID using GET method. You should be able to see a change in the position of the user in the waitlist.

Screenshots or videos of changes:

image image image image image

@Neeraj-Kondaveeti Neeraj-Kondaveeti added the Do Not Review Do not review or look at code without full context label Mar 24, 2026
@sonarqubecloud
Copy link
Copy Markdown

Copy link
Copy Markdown

@Anusha-Gali Anusha-Gali left a comment

Choose a reason for hiding this comment

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

Hi Neeraj,

I have reviewed your PR locally and the API responses are as per requirement.

Image Image Image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants