Package com.example.lottery.util
Class WaitlistPromotionUtil
java.lang.Object
com.example.lottery.util.WaitlistPromotionUtil
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 Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidpromoteOneFromWaitlistIfNeeded(com.google.firebase.firestore.FirebaseFirestore db, String eventId) Checks for available capacity and promotes one waitlisted entrant if possible.
-
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.
-