List All Parking Spaces
Returns all parking spaces with their relationships including apartamento.torre.proyecto and apartamento.pisoTorre.Response Fields
Indicates if the request was successful
Array of parking space objects
Get Single Parking Space
Retrieve detailed information about a specific parking space.Path Parameters
The unique identifier of the parking space
Create Parking Space
Create a new parking space.Request Body
Parking space number (max 20 characters, must be globally unique)
Parking type: must be “Vehiculo” or “Moto”
Apartment ID to assign (must exist in apartamento table). Leave null for unassigned parking.
Update Parking Space
Update an existing parking space. Same validation rules as creation, but numero uniqueness check excludes the current record.Path Parameters
The unique identifier of the parking space to update
Request Body
Same as Create Parking Space endpoint.Delete Parking Space
Delete a parking space.Path Parameters
The unique identifier of the parking space to delete
Assign Parking to Apartment
Assign a parking space to an apartment. Fails if already assigned.Path Parameters
The parking space ID
Request Body
Apartment ID to assign (must exist)
Unassign Parking from Apartment
Remove apartment assignment from a parking space.Path Parameters
The parking space ID
Filter Parking Spaces
By Type
Path Parameters
Must be “Vehiculo” or “Moto”
Get Available Only
Returns all unassigned parking spaces (id_apartamento is null).Get Assigned Only
Returns all assigned parking spaces with apartment details.By Apartment
Get all parking spaces assigned to a specific apartment.Path Parameters
The apartment ID
Get Available by Type
Get available parking spaces filtered by type.Path Parameters
Must be “Vehiculo” or “Moto”
Search Parking Spaces
Search parking spaces by number (case-insensitive).Query Parameters
Search term (min 1 character)
Get Parking Space Summary
Get a comprehensive summary of a parking space.Path Parameters
The parking space ID
Get Parking Statistics
Get global statistics across all parking spaces.Create Multiple Parking Spaces
Batch create parking spaces with sequential numbering.Request Body
Prefix for parking numbers (max 10 characters)
Starting number (min: 1)
Ending number (must be >= numero_inicio)
Parking type: “Vehiculo” or “Moto”
The batch creation endpoint skips any parking numbers that already exist and returns them in
numeros_existentes. This allows you to safely re-run the operation.Model Structure
Database Table: parqueaderos
| Field | Type | Nullable | Description |
|---|---|---|---|
id_parqueadero | Integer | No | Primary key |
numero | String(20) | No | Parking number (unique) |
tipo | String(20) | No | ”Vehiculo” or “Moto” |
id_apartamento | Integer | Yes | Foreign key to apartamento |
id_torre | Integer | Yes | Foreign key to torre |
id_proyecto | Integer | Yes | Foreign key to proyecto |
precio | Decimal(18,2) | Yes | Parking price |
Relationships
- BelongsTo:
apartamento(Apartamento) - BelongsTo:
torre(Torre) - BelongsTo:
proyecto(Proyecto)
Business Rules
Parking spaces are identified by a globally unique
numero field. When creating multiple parking spaces, use a consistent prefix (e.g., “P-” for vehicles, “M-” for motorcycles) to maintain organization.