Skip to main content

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

Tipos de Proyecto (project types) define the categories for public works projects such as “INFRAESTRUCTURA VIAL” (road infrastructure) or “EDUCACIÓN” (education). This catalog provides reference data for classifying projects.

Get All Project Types

Retrieves a list of all project types in the system.

Authentication

This endpoint requires authentication using a Bearer token.

Response

id
number
required
Unique identifier for the project type
nombre
string
required
Name of the project type (max 150 characters, unique)
activo
boolean
required
Status flag indicating if the project type is active (default: true)

Example Request

curl --request GET \
  --url http://localhost:3000/catalogos/tipo-proyecto \
  --header 'Authorization: Bearer YOUR_TOKEN'

Example Response

[
  {
    "id": 1,
    "nombre": "INFRAESTRUCTURA VIAL",
    "activo": true
  },
  {
    "id": 2,
    "nombre": "EDUCACIÓN",
    "activo": true
  },
  {
    "id": 3,
    "nombre": "SALUD",
    "activo": true
  },
  {
    "id": 4,
    "nombre": "DEPORTES Y RECREACIÓN",
    "activo": true
  }
]

Get Project Type by ID

Retrieves a single project type by its unique identifier.

Authentication

This endpoint requires authentication using a Bearer token.

Path Parameters

id
number
required
The unique identifier of the project type to retrieve

Response

Returns a single project type object with the following fields:
id
number
required
Unique identifier for the project type
nombre
string
required
Name of the project type
activo
boolean
required
Status flag indicating if the project type is active

Example Request

curl --request GET \
  --url http://localhost:3000/catalogos/tipo-proyecto/1 \
  --header 'Authorization: Bearer YOUR_TOKEN'

Example Response

{
  "id": 1,
  "nombre": "INFRAESTRUCTURA VIAL",
  "activo": true
}

Error Responses

statusCode
number
HTTP status code (404 if project type not found)
message
string
Error message describing what went wrong
{
  "statusCode": 404,
  "message": "Project type not found"
}

Create Project Type

Creates a new project type in the system.

Authentication

This endpoint requires authentication using a Bearer token.

Request Body

nombre
string
required
Name of the project type (max 150 characters, must be unique)
activo
boolean
Status flag (defaults to true if not provided)

Validation Rules

  • nombre is required and must be a non-empty string
  • nombre must be unique across all project types
  • activo is optional and defaults to true

Example Request

curl --request POST \
  --url http://localhost:3000/catalogos/tipo-proyecto \
  --header 'Authorization: Bearer YOUR_TOKEN' \
  --header 'Content-Type: application/json' \
  --data '{
    "nombre": "INFRAESTRUCTURA HIDRÁULICA",
    "activo": true
  }'

Example Response

{
  "id": 5,
  "nombre": "INFRAESTRUCTURA HIDRÁULICA",
  "activo": true
}

Error Response

{
  "statusCode": 400,
  "message": [
    "nombre should not be empty",
    "nombre must be a string"
  ],
  "error": "Bad Request"
}

Update Project Type

Updates an existing project type.

Authentication

This endpoint requires authentication using a Bearer token.

Path Parameters

id
number
required
The unique identifier of the project type to update

Request Body

All fields are optional. Only include fields you want to update.
nombre
string
Name of the project type (must be unique if provided)
activo
boolean
Status flag

Example Request

curl --request PATCH \
  --url http://localhost:3000/catalogos/tipo-proyecto/5 \
  --header 'Authorization: Bearer YOUR_TOKEN' \
  --header 'Content-Type: application/json' \
  --data '{
    "activo": false
  }'

Example Response

{
  "id": 5,
  "nombre": "INFRAESTRUCTURA HIDRÁULICA",
  "activo": false
}

Delete Project Type

Deletes a project type from the system.

Authentication

This endpoint requires authentication using a Bearer token.

Path Parameters

id
number
required
The unique identifier of the project type to delete
Deleting a project type that is referenced by existing projects may fail due to foreign key constraints. Consider setting activo to false instead.

Example Request

curl --request DELETE \
  --url http://localhost:3000/catalogos/tipo-proyecto/5 \
  --header 'Authorization: Bearer YOUR_TOKEN'

Example Response

{
  "message": "Project type deleted successfully"
}

Build docs developers (and LLMs) love