Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/Zapiony/PUCE_UZDI_2026/llms.txt

Use this file to discover all available pages before exploring further.

The adolescente resource is the core entity of the UZDI system. Every case file, socio-educational measure, and contextual record in the platform is anchored to an adolescent profile. It maps directly to the adolescente.adolescente table in PostgreSQL and is populated via TypeORM with eager-loaded catalogue relations (nationality, civil status, ethnicity, canton, and GDO). Base path: /api/v1/adolescente

Role requirements

All endpoints are protected by the RolesGuard. The following roles apply across all five operations:
OperationAllowed roles
GET /api/v1/adolescenteADMINISTRADOR, SUPERADMINISTRADOR, TRABAJADOR_SOCIAL, PSICOLOGO, EDUCADOR, JURIDICO
GET /api/v1/adolescente/:idAll authenticated users
POST /api/v1/adolescenteADMINISTRADOR, SUPERADMINISTRADOR
PATCH /api/v1/adolescente/:idADMINISTRADOR, SUPERADMINISTRADOR
DELETE /api/v1/adolescente/:idADMINISTRADOR, SUPERADMINISTRADOR
A valid JWT must be sent in every request via the Authorization: Bearer <token> header. Obtain a token via POST /api/v1/auth/login before calling any endpoint in this group.

Endpoints

GET /api/v1/adolescente

Returns the full list of adolescent profiles ordered by insertion time. Catalogue associations (nacionalidad, estadoCivil, etnia, canton, gdo) are resolved eagerly and embedded in each object.
curl -X GET https://api.uzdi.puce.edu.ec/api/v1/adolescente \
  -H "Authorization: Bearer <token>"

Response — 200 OK

Returns an array of Adolescente objects.
id
number
Internal primary key (adlc_id in the database).
cedula
string
National identity document number. Unique across all profiles. Maximum 20 characters.
nombre
string
Given name(s) of the adolescent. Maximum 100 characters.
apellido
string
Family name(s) of the adolescent. Maximum 100 characters.
fecha_nac
string (date)
Date of birth in YYYY-MM-DD ISO format.
sexo
string
Biological sex code. One of "M" (Masculino), "F" (Femenino), or "O" (Otro).
nved_nombre
string | null
Educational level name. Free-text, maximum 100 characters. Optional.
hijos
number
Number of children. Integer ≥ 0. Defaults to 0.
reincide
boolean
Recidivism flag. Stored as CHAR(1) ('V'/'F') in PostgreSQL; serialised as a JSON boolean via the BooleanVF transformer. Defaults to false.
fecha_ingr
string (date)
Date the adolescent entered the UZDI system in YYYY-MM-DD format.
hijoPpl
boolean
Indicates whether the adolescent is a child of a person deprived of liberty (PPL). Stored as CHAR(1) ('V'/'F'). Defaults to false.
observaciones
string | null
Free-text observations. Maximum 255 characters. Optional.
nacionalidad
object
Eagerly resolved catalogue reference. Contains id: number and nombre: string.
estadoCivil
object
Eagerly resolved catalogue reference. Contains id: number and nombre: string.
etnia
object
Eagerly resolved catalogue reference. Contains id: number and nombre: string.
canton
object
Eagerly resolved canton reference. Contains id: number and nombre: string.
gdo
object | null
Eagerly resolved GDO (Grado de Organización) reference. Contains id: number and nombre: string. Nullable.
fcCrea
string (timestamp) | null
Server-set creation timestamp. Not writable via POST or PATCH.
fcMod
string (timestamp) | null
Server-set last-modification timestamp. Not writable via POST or PATCH.

POST /api/v1/adolescente

Creates a new adolescent profile. The request body is validated by ValidationPipe (whitelist + forbidNonWhitelisted) and sanitised by SanitizationPipe (DOMPurify). All FK fields must reference existing catalogue rows.
curl -X POST https://api.uzdi.puce.edu.ec/api/v1/adolescente \
  -H "Authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d '{
    "cedula": "1720345678",
    "nombre": "Luis Andrés",
    "apellido": "Mora Vega",
    "fecha_nac": "2007-03-15",
    "sexo": "M",
    "fecha_ingr": "2024-01-10",
    "nacn_id": 1,
    "etcv_id": 2,
    "etna_id": 3,
    "cntn_id": 17,
    "hijos": 0,
    "reincide": false,
    "hijoPpl": false
  }'

Request body

cedula
string
required
National identity document number. 1–20 characters, must be unique.
nombre
string
required
Given name(s). 1–100 characters. HTML is stripped by the sanitisation pipe.
apellido
string
required
Family name(s). 1–100 characters. HTML is stripped by the sanitisation pipe.
fecha_nac
string
required
Date of birth. Must be a valid ISO 8601 date string, e.g. "2007-03-15".
sexo
string
required
Biological sex. Must be exactly one of "M", "F", or "O".
fecha_ingr
string
required
Entry date into the system. Must be a valid ISO 8601 date string, e.g. "2024-01-10".
nacn_id
number
required
Foreign key to the nacionalidad catalogue. Must be an integer.
etcv_id
number
required
Foreign key to the estado_civil catalogue. Must be an integer.
etna_id
number
required
Foreign key to the etnia catalogue. Must be an integer.
cntn_id
number
required
Foreign key to the canton catalogue. Must be an integer.
nved_nombre
string
Educational level name. 0–100 characters. Optional.
hijos
number
Number of children. Integer ≥ 0. Defaults to 0 if omitted.
reincide
boolean
Recidivism flag. Accepts JSON true or false. Defaults to false if omitted.
hijoPpl
boolean
Child-of-PPL flag. Accepts JSON true or false. Defaults to false if omitted.
observaciones
string
Free-text remarks. 0–255 characters. Optional.
gdo_id
number
Foreign key to the gdo catalogue. Integer. Optional — omit if no GDO applies.

Response — 201 Created

Returns the saved Adolescente object with the generated id, all eagerly resolved catalogue relations, and the server-set fcCrea timestamp. Fields are identical to those described in the GET response above.

GET /api/v1/adolescente/:id

Retrieves a single adolescent profile by its numeric primary key.
Path parameterTypeDescription
idnumberThe adlc_id of the adolescent to retrieve.
curl -X GET https://api.uzdi.puce.edu.ec/api/v1/adolescente/42 \
  -H "Authorization: Bearer <token>"

Response — 200 OK

Returns the matching Adolescente object with the same shape as the list response. Returns null if no record is found for the given id (TypeORM findOne behaviour — no 404 is thrown at scaffolding level).

PATCH /api/v1/adolescente/:id

Partially updates an existing adolescent profile. Only fields included in the request body are modified — all other fields retain their current values. The body is validated by UpdateAdolescenteDto, which extends CreateAdolescenteDto with all properties made optional (PartialType).
Path parameterTypeDescription
idnumberThe adlc_id of the adolescent to update.
curl -X PATCH https://api.uzdi.puce.edu.ec/api/v1/adolescente/42 \
  -H "Authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d '{
    "observaciones": "Traslado a UZDI Quito confirmado.",
    "cntn_id": 25
  }'

Request body

All fields from the POST body are accepted but every field is optional. Send only the fields you wish to change. Validation constraints (lengths, allowed values, FK types) remain identical.

Response — 200 OK

Returns a TypeORM UpdateResult object with an affected count indicating how many rows were modified.
The PATCH endpoint returns a TypeORM UpdateResult, not the full updated entity. If you need the updated object, issue a follow-up GET /api/v1/adolescente/:id after a successful PATCH.

DELETE /api/v1/adolescente/:id

Removes an adolescent record from the database. At the current scaffolding stage this executes a hard DELETE via repository.delete(id). A soft-delete / deactivation flag may be introduced when domain business logic is formalised.
Path parameterTypeDescription
idnumberThe adlc_id of the adolescent to remove.
curl -X DELETE https://api.uzdi.puce.edu.ec/api/v1/adolescente/42 \
  -H "Authorization: Bearer <token>"

Response — 200 OK

Returns a TypeORM DeleteResult with an affected count.
Deleting an adolescent record may cascade or violate foreign-key constraints in linked tables (expediente, adolescente_representante, etc.). Ensure all dependent records are removed or reassigned before calling this endpoint in a production environment.

Build docs developers (and LLMs) love