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 Reservas API is the core scheduling surface of the CoworkingBooking platform. It lets clients create new bookings against a coworking space (espacioId) on behalf of a registered user (usuarioId), track each booking’s lifecycle through its estado field, and clean up cancelled or expired records. Every reservation carries three distinct timestamps that together represent the user’s window and the post-session cleaning buffer, all serialised in yyyy-MM-dd HH:mm format.

Base path

All Reservas endpoints are mounted under /reserva (singular).

Endpoints

MethodPathDescription
GET/reserva/pingHealth check — returns the plain-text string "pong"
GET/reserva/allList all reservations
GET/reserva/{id}Retrieve a single reservation by ID
POST/reserva/createCreate a new reservation
PUT/reserva/update/{id}Update the status of a reservation
DELETE/reserva/eliminar/{id}Delete a reservation by ID

The Reserva object

Every endpoint that returns reservation data uses the same shape.
id
integer
Auto-generated primary key for the reservation. Assigned by the database on creation.
usuarioId
integer
ID of the registered user who owns this booking. Corresponds to an existing Usuario record.
espacioId
integer
ID of the coworking space being reserved. Corresponds to an existing Espacio record.
horaInicio
string
Booking start time. Serialised as yyyy-MM-dd HH:mm. Example: "2025-06-10 09:00".
horaFinUsuario
string
The time at which the user’s session ends. Serialised as yyyy-MM-dd HH:mm. Example: "2025-06-10 11:00".
horaFinTotal
string
The absolute end of the reservation slot, including the space’s post-session cleaning buffer (espacio.minutos_limpieza). Serialised as yyyy-MM-dd HH:mm. Example: "2025-06-10 11:30".
estado
string
Current lifecycle status of the reservation. One of confirmada, pendiente, or cancelada.
version
integer
Optimistic-locking counter managed by JPA’s @Version mechanism. Incremented automatically on every successful write. Clients should treat this as opaque.

Estado values

ValueMeaning
confirmadaThe booking has been confirmed and the space is reserved.
pendienteThe booking has been submitted but is awaiting confirmation.
canceladaThe booking has been cancelled and the slot is available again.

Example 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
}
All three timestamp fields (horaInicio, horaFinUsuario, horaFinTotal) are serialised and deserialised using the strict pattern yyyy-MM-dd HH:mm. Submitting a timestamp in any other format (e.g. ISO 8601 with seconds or timezone offset) will cause the request to fail.

Endpoint pages

GET /ping

Health check for the Reservas controller — returns "pong".

GET /all

Retrieve all reservations in the system as a JSON array.

GET /{id}

Fetch a single reservation by its integer ID.

POST /create

Create a new reservation with time windows and status.

PUT /update/{id}

Update the status of an existing reservation.

DELETE /eliminar/{id}

Delete a reservation permanently by its ID.

Build docs developers (and LLMs) love