join Lottery
fun joinLottery(lotteryId: String, entrantId: String, numberOfGuests: Int, onResult: (Boolean, String) -> Unit)
Registers an entrant for a lottery and adds their entry to the Firestore database.
Checks if registration is open, the entrant has already joined, and the waitlist has available space. Uses a Firestore transaction to prevent duplicate entries.
Parameters
lottery Id
The lotteryId of the lottery to join.
entrant Id
The ID of the entrant joining the lottery.
number Of Guests
The number of guests included in the registration.
on Result
Callback that returns true if registration was successful, false otherwise, along with a message describing the result.