Documentation Index
Fetch the complete documentation index at: https://mintlify.com/LizandroCanul/back_sdo/llms.txt
Use this file to discover all available pages before exploring further.
Overview
These endpoints allow users to manage their favorite obras (public works projects). Users can add obras to their favorites, remove them, and retrieve their complete list of favorites with pagination.Add Favorite
Path Parameters
The user’s unique identifier. Must match the authenticated user’s ID.
The ID of the obra to add to favorites.
Authentication
Requires a valid JWT token. The authenticated user’s ID must match the:id parameter.
Response
Unique identifier for the favorite record
The user’s ID
The obra’s ID
Timestamp when the favorite was added
Example Response
201 Created
400 Bad Request - Already in Favorites
403 Forbidden
404 Not Found
Authorization Rules
- The authenticated user’s
userIdmust match the:idpath parameter - Admins do NOT have special privileges for this endpoint
- The user must exist in the database
- The obra cannot already be in the user’s favorites (checked via unique constraint)
/home/daytona/workspace/source/src/users/users.controller.ts:81
Remove Favorite
Path Parameters
The user’s unique identifier. Must match the authenticated user’s ID.
The ID of the obra to remove from favorites.
Authentication
Requires a valid JWT token. The authenticated user’s ID must match the:id parameter.
Response
Confirmation message: “Obra removida de favoritas”
Example Response
200 Success
403 Forbidden
404 Not Found
Authorization Rules
- The authenticated user’s
userIdmust match the:idpath parameter - Admins do NOT have special privileges for this endpoint
- The obra must exist in the user’s favorites to be removed
/home/daytona/workspace/source/src/users/users.controller.ts:94
Get User Favorites
Path Parameters
The user’s unique identifier
Query Parameters
Number of items per page (optional)
Page number (optional, 1-indexed)
Authentication
Requires a valid JWT token. The authenticated user must be either:- The owner of the favorites (user.userId === id)
- An admin (can view any user’s favorites)
Response
Array of full obra objects with all related data
Pagination metadata
Example Response
200 Success
403 Forbidden
404 Not Found
Authorization Rules
- Admin users: Can view any user’s favorites
- Regular users: Can only view their own favorites (user.userId === id)
- Mismatch: If a regular user tries to view another user’s favorites, returns 403 Forbidden
/home/daytona/workspace/source/src/users/users.controller.ts:109
Related Data
The response includes full obra objects with the following TypeORM relations loaded:obra.municipio- Municipality where the obra is locatedobra.dependencia- Government department managing the obraobra.ejercicioFiscal- Fiscal year of the obraobra.estatusObra- Current status of the obraobra.tipoProyecto- Type/category of the project
createdAt in descending order (newest first).