Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/devdavco/backend_1/llms.txt

Use this file to discover all available pages before exploring further.

The GET /reserva/{id} endpoint looks up a single reservation by its primary key and returns the complete Reserva object. Use this endpoint when you need detailed information about one specific booking rather than scanning the full list. The service layer calls orElseThrow internally, so supplying an ID that does not exist in the database will result in a 500 error rather than a 404.

Path parameters

id
integer
required
The integer primary key of the reservation to retrieve. Must correspond to an existing record in the reservas table.

Request

curl -X GET http://localhost:8080/reserva/7 \
  -H "Accept: application/json"

Response

Returns 200 OK with a single Reserva object.
{
  "id": 7,
  "usuarioId": 3,
  "espacioId": 2,
  "horaInicio": "2025-06-10 09:00",
  "horaFinUsuario": "2025-06-10 11:00",
  "horaFinTotal": "2025-06-10 11:30",
  "estado": "confirmada",
  "version": 1
}

Response fields

id
integer
Unique auto-generated identifier for the reservation.
usuarioId
integer
ID of the user who made the booking.
espacioId
integer
ID of the coworking space that was reserved.
horaInicio
string
Start time of the reservation in yyyy-MM-dd HH:mm format.
horaFinUsuario
string
The time the user’s session ends, in yyyy-MM-dd HH:mm format.
horaFinTotal
string
Absolute end of the reserved slot including the post-session cleaning buffer, in yyyy-MM-dd HH:mm format.
estado
string
Current status of the reservation. One of confirmada, pendiente, or cancelada.
version
integer
Optimistic-locking version counter managed by JPA’s @Version annotation.
If no reservation with the supplied id exists, the service throws a RuntimeException (“Reserva no encontrada con ID: ”), which Spring Boot surfaces as an HTTP 500 Internal Server Error. Validate that the ID exists (e.g. via GET /reserva/all) before calling this endpoint if you want to avoid unhandled errors on the client side.

Build docs developers (and LLMs) love