interface BookingManager
Manages user bookings on the units
abstract fun createBooking(unit: IotUnit, startsAt: Long, endsAt: Long?): LiveData<SimpleResponse<Booking>>
Create a booking for the given unit. startsAt and endsAt are defined in epoch in milliseconds. endsAt is an optional parameter because some units can have an open ended booking. |
|
abstract fun deleteBooking(booking: Booking): LiveData<SimpleResponse<Void>>
Deletes an existing booking. That call is used for bookings that haven't started. |
|
abstract fun endBookingNow(booking: Booking): LiveData<SimpleResponse<Void>>
Ends an existing booking. That call is used for currently ongoing bookings. |
|
abstract fun getMyBookings(): LiveData<SimpleResponse<List<Booking>>>
Get a LiveData for the logged user existing bookings. Those can be for either DOOR or LOCKER_BOX types. |
|
abstract fun getSchedules(from: LocalDate, to: LocalDate, iotUnit: IotUnit? = null): LiveData<SimpleResponse<List<Schedule>>>
Get a LiveData with the schedule for the supplied iotUnit, or if null, for all IotUnit the user has access to on the requested periods. |