LotteryController

class LotteryController(val lotteryRepository: LotteryRepository)

Handles lottery creation, retrieval, and registration.

Constructors

Link copied to clipboard
constructor(lotteryRepository: LotteryRepository)

Properties

Link copied to clipboard

Repository for lottery data.

Functions

Link copied to clipboard
suspend fun addLottery(lottery: Lottery)

Adds a lottery to the repository.

Link copied to clipboard
fun getLotteriesForCampsite(campsiteId: String, filter: LotteryFilter = LotteryFilter.ACTIVE): List<Lottery>

Gets the lotteries of a campsite that match a filter.

Link copied to clipboard

Retrieves the first lottery accepting registrations for the specified campsite.

Link copied to clipboard
fun joinLotteryEntry(lotteryId: String, entrantId: String, numberOfGuests: Int, onResult: (Boolean, String) -> Unit)

Submits a user's entry to a campsite lottery.