ParkingSlotRepository

An interface representing a parking slot repository for accessing and manipulating parking slot data.

Functions

Link copied to clipboard
abstract suspend fun freeParkingSlot(id: String): Either<AppError, Unit>

Frees the parking slot identified by id

Link copied to clipboard
abstract suspend fun getCurrentParkingSlot(): Either<AppError, ParkingSlot?>

Finds the parking slot currently occupied by the user

Link copied to clipboard
abstract suspend fun getParkingSlot(id: String): Either<AppError, ParkingSlot>

Finds a parking slot identified by id

Link copied to clipboard
abstract suspend fun getParkingSlots(center: GeoPosition, radius: Double): Either<AppError, List<ParkingSlot>>

Finds all the parking slots in a radius of radius meters from center

Link copied to clipboard
abstract suspend fun incrementParkingSlotOccupation(id: String, stopEnd: Instant): Either<AppError, Unit>

Increments the occupation of a parking slot identified by id

Link copied to clipboard
abstract suspend fun occupyParkingSlot(id: String, stopEnd: Instant): Either<AppError, Unit>

Occupies a parking slot identified by id