Package-level declarations

Types

Link copied to clipboard
data class AvailabilitySchedule(var availableDates: List<String> = emptyList(), var bookedDates: List<String> = emptyList())

Represents the availability schedule for a set of dates.

Link copied to clipboard
data class Campsite(val campsiteId: String = "", val ownerId: String = "", val campsiteName: String = "", val description: String = "", val address: String = "", val latitude: Double = 0.0, val longitude: Double = 0.0, val maxOccupancy: Int = 1, val rulesPolicies: String = "", val amenities: List<String> = emptyList(), val tags: List<String> = emptyList(), val imageIds: List<String> = emptyList(), val rating: Float = 0.0f, val ratingCount: Int = 0, val availability: AvailabilitySchedule = AvailabilitySchedule(), var active: Boolean = true)

Represents a campsite listing.

Link copied to clipboard
data class Image(val imageId: String = "", val uploaderUserId: String = "", val url: String = "")

Represents an image uploaded by a user which stores its unique ID, the user ID of the uploader, and its download URL (for now).

Link copied to clipboard
data class Lottery(val lotteryId: String = "", val campsiteIds: List<String> = emptyList(), val ownerId: String = "", val registrationStart: Date = Date(), val registrationEnd: Date = Date(), val bookingStart: Date = Date(), val bookingEnd: Date = Date(), val numberOfWinners: Int = 1, val waitlistCapacity: Int = 1, val entryIds: List<String> = emptyList(), val status: LotteryStatus = LotteryStatus.OPEN)

Represents a lottery run by the campsite owner.

Link copied to clipboard

The current status of a campsite lottery.

Link copied to clipboard
class Message(val messageId: String = "", val content: String = "", val senderId: String = "", val recipientId: String = "", var timestamp: Timestamp = Timestamp.now())

Represents a message sent between users.

Link copied to clipboard
data class Reservation(val reservationId: String = "", val campsiteId: String = "", val entrantId: String = "", val ownerId: String = "", val startDate: String = "", val endDate: String = "", val guests: Int = 1, val status: ReservationStatus = ReservationStatus.PENDING, val ruleConfirmed: Boolean = false)

Represents a reservation made by an entrant for a campsite.

Link copied to clipboard

The current status of a campsite reservation.

Link copied to clipboard
open class User(val deviceId: String = "", var name: String = "", var email: String = "", var phone: String = "", var profilePictureImageId: String = "", var role: UserRole = UserRole.ENTRANT, var notificationsEnabled: Boolean = true)

Represents every user that uses the app.

Link copied to clipboard

Defines the roles available to users in the application.

Link copied to clipboard
data class WaitlistEntry(val entryId: String = "", val entrantId: String = "", val lotteryId: String = "", val joinedAt: Date = Date(), val numberOfGuests: Int = 1, var status: WaitlistStatus = WaitlistStatus.IN_WAITLIST)

Represents an entrant's waitlist entry.

Link copied to clipboard

Represents the possible statuses of waitlist entry.

Functions

Link copied to clipboard

Draws lottery winners and losers

Link copied to clipboard
fun generateQR(content: String, width: Int, height: Int): Bitmap?

Generates a QR code from the given content.

Link copied to clipboard
fun goToPage(navController: NavController, qrContent: String)

Navigates to a campsite details page using QR code content.

Link copied to clipboard
fun scanAndGoToPage(context: Context, navController: NavController)

Launches the Google Play Services QR code scanner and navigates to the corresponding campsite details page