List All Towers
Returns all towers with their relationships including proyecto, estado, pisos, and apartamentos.Response Fields
Indicates if the request was successful
Array of tower objects
Get Single Tower
Retrieve detailed information about a specific tower with all relationships.Path Parameters
The unique identifier of the tower
Response
Returns tower with expanded relationships: proyecto (with ubicacion.ciudad), estado, pisos, and apartamentos (with tipoApartamento and estadoInmueble).Create Tower
Create a new tower within a project.Request Body
Tower name (max 50 characters)
Number of floors (min: 1, max: 32767)
Project ID (must exist in proyectos table)
Status ID (must exist in estados table)
Update Tower
Update an existing tower. Validation rules are the same as creation.Path Parameters
The unique identifier of the tower to update
Request Body
Same as Create Tower endpoint.Delete Tower
Delete a tower. Cannot delete if the tower has associated pisos or apartamentos.Path Parameters
The unique identifier of the tower to delete
Get Towers by Project
Also available at:
/api/proyectos/{id_proyecto}/torresPath Parameters
The project ID to filter by
Get Towers by Status
Retrieve all towers filtered by status.Path Parameters
The status ID to filter by
Search Towers
Search towers by name (case-insensitive).Query Parameters
Search term (min 1 character)
Get Tower Summary
Get a comprehensive summary of a tower with aggregated statistics.Path Parameters
The tower ID
Get Tower Statistics by Project
Get statistics for all towers in a specific project.Path Parameters
The project ID
Nested Resources
Towers serve as parent resources for:- GET
/api/torres/{id_torre}/apartamentos- Get all apartments in a tower - GET
/api/torres/{id_torre}/locales- Get all commercial spaces in a tower - GET
/api/torres/{id_torre}/pisos- Get all floors in a tower
Model Structure
Database Table: torres
| Field | Type | Nullable | Description |
|---|---|---|---|
id_torre | Integer | No | Primary key |
nombre_torre | String(50) | No | Tower name |
numero_pisos | Integer | Yes | Number of floors |
nivel_inicio_prima | Integer | Yes | Floor where premium pricing starts |
id_proyecto | Integer | No | Foreign key to proyectos |
id_estado | Integer | No | Foreign key to estados |
Relationships
- BelongsTo:
proyecto(Proyecto) - BelongsTo:
estado(Estado) - HasMany:
pisos(PisoTorre) - HasMany:
apartamentos(Apartamento) - HasMany:
locales(Local)