ReservationRepository

Handles the data in the Firestore database for the Reservation class.

Constructors

Link copied to clipboard
constructor()

Properties

Link copied to clipboard

Cached reservations synchronized with Firestore.

Functions

Link copied to clipboard
fun addReservation(reservation: Reservation)

Adds a new reservation to the Firestore database.

Link copied to clipboard
fun deleteReservation(reservation: Reservation)

Deletes a reservation from the Firestore database.

Link copied to clipboard
fun getReservation(reservationId: String): Reservation?

Gets a Reservation object from the database given its reservationId.

Link copied to clipboard

Gets all the Reservation objects for a specific Campsite given its campsiteId.

Link copied to clipboard

Gets all the Reservation objects for a specific Entrant given its entrantId.

Link copied to clipboard
fun updateReservation(updatedReservation: Reservation)

Saves a reservation to Firestore, creating it if absent.