Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/gcapella0/agente-inteligente-expedientes/llms.txt

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

The expedientes section covers two pages: a paginated list for browsing and searching all docente dossiers, and a full-detail view for reviewing documents, OCR output, and validation state for a single docente.

Dossier list — expedientes.html

The list page is the main entry point for dossier management. On load it calls GET /docentes/buscar?limit=20 and displays results in a table with cursor-based pagination.

Search and filters

ControlBehaviour
Search barQueries GET /docentes/buscar?q=<text> — matches against apellido, nombre, and cédula. Debounced 300 ms.
Estado filterFilters by status: activo, inactivo, or retirado. Sent as &status=<value>.
Completitud filterClient-side filter applied after the API response: baja (< 50 %), media (50–80 %), alta (> 80 %).
Limpiar buttonResets all three filters and re-fetches from page 1.

Pagination

Pagination is cursor-based (not page-number based). The API returns a cursor_siguiente token when more records exist. The UI maintains a cursorStack array so “Anterior” / “Siguiente” buttons can navigate back and forward without re-fetching all records.

Table columns

Each row shows: Cédula (monospaced), Nombre (nombres + apellidos), Departamento, Completitud (colour-coded badge), and an Acciones cell with Ver, Editar, and Eliminar links. Clicking Ver navigates to /ui/expediente.html?cedula=<cédula>. Clicking Eliminar shows a confirm() dialog and calls DELETE /expedientes/{cedula} on confirmation.

Dossier detail — expediente.html

Loaded via URL parameter ?cedula=XXXXXXXX. On init the page fetches both GET /expediente/{cedula} (docente + documents) and GET /validacion/expediente/{cedula} (validation summary) in parallel.

Header and KPI cards

The header shows full name, cédula, department, and sede. Four metric cards display:
  • Completitud — percentage score rounded to the nearest integer.
  • Documentos — count of uploaded documents out of the 10 required (e.g. 7/10).
  • Validación — overall validation state badge: apto (green), requiere_atencion (yellow), or critico (red).
  • Último updatefecha_actualizacion formatted as a locale date string.
Any validation alerts returned by the validation endpoint are shown in an amber banner below the KPI row.

Required documents (10 total)

The completeness percentage is based on how many of these document types are present in the dossier:
cedula_identidad            partida_nacimiento
rif                         titulo_bachiller
certificado_notas_bachillerato  titulo_universitario
certificado_notas_pregrado  fondo_negro_titulo
acta_grado                  resolucion_nombramiento

Documents table

Columns: Tipo (monospaced), Formato (uppercased extension), Tamaño (human-readable KB/MB), Estado (validation badge), and Acciones. Actions per row:
ButtonAction
Ver OCROpens the document viewer modal for this document.
EstadoOpens the validation-state picker modal.
EliminarShows confirm() and calls DELETE /documentos/{documento_id}.

Document viewer modal

The viewer modal has two tabs:

Documento

Renders the file inline. JPG/JPEG/PNG files are displayed as <img> tags. PDFs show an “Abrir PDF” link (opens in new tab) and a “Descargar” link. Unknown formats show a plain download link. All URLs include ?token=<jwt> for authenticated access via the /archivo endpoint.

JSON OCR

Shows the raw OCR output as pretty-printed JSON, including procesado, motor, confianza_promedio, paginas, idioma_detectado, campos_extraidos, and texto_completo. Useful for debugging extraction quality.
The document viewer uses <img src> for images and a plain <a href> link for PDFs, both passing the JWT token as a ?token= query parameter to the /archivo endpoint. This avoids CORS issues that arise when browsers load media resources outside of the fetch API — native image and PDF rendering cannot attach Authorization headers.

Validation state management

Click Estado on any document row to open the state picker. Available states:
  • pendiente — default, no review performed yet
  • aprobado — document reviewed and accepted
  • rechazado — document rejected
  • requiere_revision — flagged for further review
Saving calls PATCH /documentos/{documento_id}/validacion with { "estado": "<value>" }.

Export

The header area includes an Exportar dropdown that links directly to the API export endpoint with ?formato=json, ?formato=xml, or ?formato=csv. These are plain <a href> links served by GET /expedientes/{cedula}/exportar.

Editing a dossier

Both expedientes.html (list) and expediente.html (detail) provide an edit modal.

From the detail page

Click the Editar button in the header. The modal contains 11 fields arranged in a responsive grid:
Field nameType
nombrestext
apellidostext
email_personalemail
email_institucionalemail
telefono_principaltext
telefono_secundariotext
direccion_completatextarea
departamentotext
sedetext
estado_civiltext
nacionalidadtext
Saving submits PUT /expedientes/{cedula} with only the non-empty fields in the request body, then reloads the dossier data.

From the list page

The quick edit modal in expedientes.html covers a subset of 6 fields: nombres, apellidos, email, teléfono, departamento, and sede. It also calls PUT /expedientes/{cedula}.

Build docs developers (and LLMs) love