Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/Renzo717/Aula-Virtual-Universidad-Radiolocucion/llms.txt

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

The admin role is the highest-privilege account in NuestraVoz. Administrators are responsible for the full operational lifecycle of the platform: creating and managing user accounts across all four roles, building the academic catalogue of careers and subjects, assigning students to programmes, approving incoming teacher registrations, and monitoring platform health through the dashboard and audit log. Admin accounts can only be created by another admin — they are never self-registered.

User Management

Admins have exclusive access to all routes under /api/users (except the search endpoint, which is also available to preceptors).

Listing and searching users

GET /api/users?search=garcia&rol=docente&page=1&limit=20
Returns a paginated list of profiles. Supports filtering by free-text search across nombre, apellido, email, and dni, and by rol. The response includes total, page, and limit for pagination.

Creating a user

POST /api/users
Content-Type: application/json

{
  "nombre": "Lucía",
  "apellido": "Fernández",
  "email": "lucia@universidad.edu",
  "password": "secreto123",
  "dni": "38123456",
  "celular": "1155556666",
  "rol": "preceptor"
}
Validated against createUserSchema. The admin can assign any of the four roles, and all accounts created this way are immediately set to status: 'activo'. DNI uniqueness is enforced — attempting to reuse a DNI returns 400 Ya existe un usuario registrado con ese DNI.

Editing a user

PATCH /api/users/:id
Content-Type: application/json

{
  "status": "activo",
  "nombre": "Lucía",
  "email": "lucia.new@universidad.edu",
  "password": "nuevopass456"
}
All fields from updateUserSchema are optional. Passing "password" updates the Supabase Auth credential as well as the profile row. Changing "email" simultaneously updates Supabase Auth.

Approving or rejecting a docente

When a teacher self-registers, their account lands with status: 'pendiente'. To approve:
PATCH /api/users/:id
Content-Type: application/json

{ "status": "activo" }
To reject or deactivate:
DELETE /api/users/:id
The DELETE endpoint performs a soft-delete — it sets status: 'inactivo' rather than removing the row, and logs an alerta-state audit entry.
A docente with status: 'pendiente' cannot log in. The login route explicitly checks for this condition and returns 403 Tu cuenta de docente está pendiente de aprobación. Approve the account before the teacher attempts to access the platform.

User statistics

GET /api/users/stats
Returns a quick count of total users, active users, and students. The dashboard reads this alongside the main stats endpoint.

Career and Subject Management

Admins are the only role that can create, update, and soft-delete careers and subjects. Preceptors share PATCH /api/carreras/materias/:id but cannot create or delete.

Career CRUD

POST /api/carreras
Content-Type: application/json

{
  "nombre": "Locución Integral",
  "codigo": "LI-2024",
  "tipo": "grado",
  "anio": 1,
  "descripcion": "Carrera de grado de tres años."
}
tipo accepts "grado" or "posgrado". anio is an integer between 1 and 3. A PATCH /api/carreras/:id updates any subset of these fields. DELETE /api/carreras/:id cascades: all child subjects are also soft-deleted (activa: false).

Subject CRUD

POST /api/carreras/materias
Content-Type: application/json

{
  "carrera_id": "uuid-of-carrera",
  "nombre": "Fonética y Dicción",
  "promocional": false,
  "docente_id": "uuid-of-docente",
  "horarios": [
    { "dia": "lunes", "inicio": "18:00", "fin": "20:00" }
  ],
  "zoom_url": "https://zoom.us/j/12345678"
}
horarios is an array of HorarioCursado objects. The API auto-generates a human-readable horario display string via formatHorarios. Deleting a single subject:
DELETE /api/carreras/materias/:id
Deletion is a soft-delete: activa is set to false. The subject and its data remain in the database for audit and grade-history purposes.

Enrolment Management

Admins can create enrolments for any student via the shared inscripciones routes (also accessible to preceptors). See the Preceptor role page for the full API reference since the endpoints are identical.

Dashboard

The admin dashboard is powered by two endpoints consumed by DashboardPage.tsx:

Platform statistics

GET /api/dashboard/stats
Returns a DashboardStats object:
// packages/shared/src/types.ts
export interface DashboardStats {
  cursosActivos: number;      // total active materias (activa = true)
  carrerasActivas: number;    // active careers
  tareasPendientes: number;   // activities with estado = 'pendiente'
  totalUsuarios: number;
  usuariosActivos: number;
  totalEstudiantes: number;
}

Recent activity (audit log)

GET /api/dashboard/actividad
Returns the last 10 AuditoriaLog entries across all modules. Each entry includes the acting user’s name, the accion string, the modulo, and an AuditoriaEstado:
export type AuditoriaEstado = 'completado' | 'procesado' | 'revision' | 'alerta';
The UI renders each entry with a colour-coded chip: green for completado, blue for procesado, yellow for revision, and red for alerta.
Audit entries are written automatically by every mutating route. You do not need to call the audit API directly — operations such as creating users, approving accounts, enrolling students, and entering grades all produce log entries automatically.

Final Grades

Admins can view and update final grades for any subject using the same endpoints available to docentes and preceptors. The assertDocenteMateria helper in apps/api/src/lib/finales.ts grants access when req.user.rol is 'admin', bypassing the docente-assignment check entirely.
GET  /api/finales/materia/:materiaId
PUT  /api/finales/materia/:materiaId
See the Teacher role page for the complete grade schema and bulk upsert format.

Grade Bulletins

An admin can download the grade bulletin PDF for any student:
GET /api/boletin/:estudianteId
The bulletin includes a summary (BoletinAlumnoResumen) and one row per enrolled subject (BoletinMateriaFila) with nota, nota_recuperatorio, libre, and regular flags.

Summary of Admin-Only Endpoints

MethodEndpointAction
GET/api/usersList all users (paginated, filterable)
GET/api/users/statsUser count statistics
POST/api/usersCreate a user with any role
PATCH/api/users/:idUpdate user fields, role, status, or password
DELETE/api/users/:idDeactivate a user (soft-delete)
POST/api/carrerasCreate a career
PATCH/api/carreras/:idUpdate career metadata
DELETE/api/carreras/:idDeactivate career and all its subjects
POST/api/carreras/materiasCreate a subject
DELETE/api/carreras/materias/:idDeactivate a subject
GET/api/dashboard/statsPlatform-wide statistics
GET/api/dashboard/actividadLast 10 audit log entries

Build docs developers (and LLMs) love