TheDocumentation 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.
medida-socioeducativa resource is the catalogue of socio-educational measure types defined by the UZDI programme. Each record names a type of measure and optionally specifies its standard duration in months. Individual measure assignments to adolescents are recorded in the expediente (case file) resource — which references this catalogue via the mdso_id foreign key. The frontend derives a display code MED-{id padded to 4 digits} from each record’s primary key, and renders progress bars with colour thresholds to visualise compliance.
Base path: /api/v1/medida-socioeducativa
Role requirements
| Operation | Allowed roles |
|---|---|
GET /api/v1/medida-socioeducativa | ADMINISTRADOR, SUPERADMINISTRADOR, TRABAJADOR_SOCIAL, PSICOLOGO, EDUCADOR, JURIDICO |
GET /api/v1/medida-socioeducativa/:id | All authenticated users |
POST /api/v1/medida-socioeducativa | ADMINISTRADOR, SUPERADMINISTRADOR |
PATCH /api/v1/medida-socioeducativa/:id | ADMINISTRADOR, SUPERADMINISTRADOR |
DELETE /api/v1/medida-socioeducativa/:id | ADMINISTRADOR, 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.Endpoints
GET /api/v1/medida-socioeducativa
Returns the full catalogue of socio-educational measure types. The frontend maps each record to aMED-{id} display code and uses duracion_meses to compute progress percentages against the active expediente’s fecha_inicio_medida.
Response — 200 OK
Returns an array ofMedidaSocioeducativa catalogue objects.
Internal primary key (
mdso_id in the database). The frontend uses this value to derive the display code MED-{id padded to 4 digits}.Full descriptive name of the measure type, e.g.
"Libertad Asistida" or "Internamiento de Fin de Semana". Maximum 255 characters.Standard duration of the measure in months. Integer ≥ 1. Nullable — if
null, no standard duration is defined for this measure type.Server-set creation timestamp. Not writable via POST or PATCH.
Server-set last-modification timestamp. Not writable via POST or PATCH.
POST /api/v1/medida-socioeducativa
Creates a new measure type in the catalogue. Once created, the record can be referenced byexpediente records via its id (mdso_id).
Request body
Full name of the measure type. 1–255 characters. HTML is stripped by the global
SanitizationPipe before validation.Standard duration in whole months. Integer ≥ 1. Optional — omit if the measure type has no fixed duration. This value is used by the frontend’s progress calculation:
elapsed months / duracion_meses × 100.Response — 201 Created
Returns the savedMedidaSocioeducativa object with the generated id and the server-set fcCrea timestamp.
GET /api/v1/medida-socioeducativa/:id
Retrieves a single measure type record by its numeric primary key.| Path parameter | Type | Description |
|---|---|---|
id | number | The mdso_id of the measure type to retrieve. |
Response — 200 OK
Returns the matchingMedidaSocioeducativa object with the same shape as the list response. Returns null if no record is found for the given id.
PATCH /api/v1/medida-socioeducativa/:id
Partially updates an existing measure type. Both fields are optional — send only what you need to change. The body is validated byUpdateMedidaSocioeducativaDto, a PartialType of CreateMedidaSocioeducativaDto.
| Path parameter | Type | Description |
|---|---|---|
id | number | The mdso_id of the measure type to update. |
Request body
Updated measure type name. 1–255 characters. Optional.
Updated standard duration in months. Integer ≥ 1. Optional.
Response — 200 OK
Returns a TypeORMUpdateResult with an affected count.
DELETE /api/v1/medida-socioeducativa/:id
Removes a measure type from the catalogue.| Path parameter | Type | Description |
|---|---|---|
id | number | The mdso_id of the measure type to remove. |
Response — 200 OK
Returns a TypeORMDeleteResult with an affected count.
Progress calculation and revision date tracking
Theduracion_meses field on each measure type is the primary input to the progress bar logic rendered in MedidasView. The frontend computes elapsed progress as:
| Progress range | Badge colour |
|---|---|
| 0 – 49 % | Green |
| 50 – 79 % | Amber |
| 80 – 100 % | Red |
expediente entity’s fecha_inicio_medida and fecha_fin_medida fields. The dashboard Próximas Revisiones table queries these dates to generate urgency-colour-coded alerts. Neither the progress percentage nor revision dates are stored as columns — they are computed at read time from the catalogue duracion_meses value and the case file’s date fields.
If
duracion_meses is null, the frontend renders the measure duration as "—" and no progress bar is displayed for affiliated expedientes.