Class WaitlistPromotionUtil

java.lang.Object
com.example.lottery.util.WaitlistPromotionUtil

public class WaitlistPromotionUtil extends Object
Utility to handle automatic promotion of entrants from the waitlist when a spot opens up.

Reuses project-wide status transition logic (InvitationFlowUtil) and notification patterns.

  • Constructor Details

    • WaitlistPromotionUtil

      public WaitlistPromotionUtil()
  • Method Details

    • promoteOneFromWaitlistIfNeeded

      public static void promoteOneFromWaitlistIfNeeded(com.google.firebase.firestore.FirebaseFirestore db, String eventId)
      Checks for available capacity and promotes one waitlisted entrant if possible. Uses a Firestore transaction to prevent race conditions when multiple declines happen concurrently.
      Parameters:
      db - The Firestore instance.
      eventId - The ID of the event to check.