An Expediente is the central dossier that ties an adolescent to a specific infraction and the resulting socio-educational measure. It records the assigned UZDI, the measure start and end dates, the current workflow state, and any attached documents. Every adolescent may have multiple expedientes over time — one per distinct judicial event.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.
Accessing the Module
- Route:
/app/expedientes - Sidebar group: Gestión
- Access: All authenticated roles can view, search, create, edit, and delete case files.
Table Features
The view loads the full expediente list fromGET /api/v1/expediente on mount. Filtering and pagination are applied client-side.
| Feature | Detail |
|---|---|
| Rows per page | 7 (PAGE_SIZE = 7) |
| Search | Matches on adolescent name, expediente code (EXP-YYYY-NNNN), or infraction name |
| Filter — Estado | Dropdown: Todos / En proceso / Atraso / Incomparecencia |
| Columns | N.º Expediente · Adolescente (name + cédula) · Infracción · Medida · UZDI · Inicio medida · Estado · Acciones |
The Estado filter values are constrained by a DDL
CHECK constraint on the expediente table. Only three values are valid: 'En proceso', 'Atraso', and 'Incomparecencia'. No other string will pass backend validation.Auto-Generated Expediente Numbering
Expediente codes are not stored in the database. They are computed client-side byexpedienteService.getAll() from the record’s numeric id and the year of fecha_inicio_medida:
| Segment | Source | Example |
|---|---|---|
EXP | Literal prefix | EXP |
YYYY | fecha_inicio_medida.substring(0, 4) | 2024 |
NNNN | Database id zero-padded to 4 digits | 0042 |
If no
fecha_inicio_medida is set the year defaults to the current calendar year. The code is display-only — search, filter, and sorting use it but the API receives the raw id.Status Lifecycle
| Estado | Badge color | Meaning |
|---|---|---|
En proceso | .badge.green | Measure is active and on track |
Atraso | .badge.amber | Adolescent is behind the schedule defined by the measure |
Incomparecencia | .badge.red | Adolescent failed to appear at a required appointment |
estado value from the dropdown.
Creating an Expediente
Click 'Nuevo expediente'
Click the Nuevo expediente button (top-right toolbar). A
md-size modal opens with two sections: Vínculos del expediente and Fechas de medida.Fill the form
Section 1 — Vínculos del expediente
Section 2 — Fechas de medida
The Crear expediente button is disabled while any required field (
| Field | Type | Required | Notes |
|---|---|---|---|
| Adolescente | Select | ✅ | Loaded from adolescenteService.getAll(); shows name + cédula (adlc_id) |
| Estado | Select | ✅ | En proceso / Atraso / Incomparecencia (estado) |
| UZDI | Select | ✅ | Loaded from GET /api/v1/uzdi catalogue (uzdi_id) |
| Infracción | Select | ✅ | Loaded from GET /api/v1/infraccion catalogue (infc_id) |
| Medida socioeducativa | Select | ✅ | Loaded from GET /api/v1/medida-socioeducativa catalogue (mdso_id) |
| Field | Type | Required | Notes |
|---|---|---|---|
| Fecha inicio | Date picker | ✅ | Start of the measure period (fecha_inicio_medida) |
| Fecha fin | Date picker | ❌ | End date; leave blank if open-ended (fecha_fin_medida) |
adlc_id, uzdi_id, infc_id, mdso_id, estado, fecha_inicio_medida) has a falsy value.Editing an Expediente
Click the edit icon
Click the pencil icon in the Acciones column. The modal opens pre-filled with the existing values extracted from
row._raw.Modify fields
All form fields are editable, including
estado. Use this to transition the workflow state (e.g., from En proceso → Atraso).Document Management
TheExpedienteForm standalone component (used outside the main table view) includes a drag-and-drop document attachment zone:
Closing an Expediente
To close a case file, edit the expediente and changeestado to the appropriate terminal state. There is currently no dedicated “Close” button — the state transition is performed through the standard edit modal.
A future release will add a dedicated Cerrar expediente confirmation modal that sets
estado to a closed value and stamps a fecha_cierre timestamp. For now, use the edit flow to update the state manually.Deleting an Expediente
Click the delete icon
Click the ban icon in the Acciones column. A small confirmation modal opens showing the adolescent name and expediente code.
Service Layer Reference
All HTTP calls are delegated toexpedienteService (src/services/expediente.service.ts):
getAll() maps raw DTOs into display rows and computes:
codigo— theEXP-YYYY-NNNNdisplay codeadol— full adolescent name (nombre + apellido)tono— badge color class derived fromestadoinicio/fin— dates formatted asDD/MM/YYYY
_raw for the edit pre-fill logic and the upcoming-reviews sort in the Dashboard.
Valid Estado Values (DDL Constraint)
ValidationPipe with a 400 Bad Request response.