Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/Luisanchez0/modulo_Horario/llms.txt

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

These four endpoints form the manual CRUD surface for schedule entries. Each entry ties a teacher, subject, and classroom to a day and time slot within a given academic period. The service validates that all referenced IDs exist in their respective upstream services before writing to the database. Base URL: http://localhost:8004

GET /horarios

Returns every schedule entry stored in the database, enriched with human-readable names fetched from the catalog services. No authentication is required.

Response

id
integer
Auto-assigned primary key.
docente_id
integer
Foreign key to the teacher record.
materia_id
integer
Foreign key to the subject record.
aula_id
integer
Foreign key to the classroom record.
periodo_id
integer
Foreign key to the academic period.
dia
string
Day of the week, normalised to upper-case Spanish: LUNES, MARTES, MIERCOLES, JUEVES, VIERNES, SABADO.
hora_inicio
string
Start time in HH:MM format.
hora_fin
string
End time in HH:MM format.
docente_nombre
string | null
Teacher’s display name (resolved from usuarios-service; null if upstream is unavailable).
docente_correo
string | null
Teacher’s email address.
materia_nombre
string | null
Subject name.
materia_codigo
string | null
Subject code.
materia_turno
string | null
Subject’s assigned shift.
aula_nombre
string | null
Classroom name.
aula_capacidad
integer | null
Classroom capacity.
curl -s http://localhost:8004/horarios

POST /horarios

Creates a single schedule entry. Requires ADMIN role. The service validates that the referenced teacher, subject, and classroom IDs exist, that the period exists, and that the requested time slot is compatible with the teacher’s shift (turno).

Headers

Authorization
string
required
Bearer <token> — must decode to rol: ADMIN.

Request body

docente_id
integer
required
ID of an existing teacher in the usuarios service.
materia_id
integer
required
ID of an existing subject in the materias service.
aula_id
integer
required
ID of an existing classroom in the aulas service.
periodo_id
integer
required
ID of an existing academic period.
dia
string
required
Day of the week. Accepted values (case-insensitive): LUNES, MARTES, MIERCOLES, JUEVES, VIERNES, SABADO.
hora_inicio
string
required
Start time in HH:MM format (e.g. "08:00").
hora_fin
string
required
End time in HH:MM format. Must be after hora_inicio.
id
integer
Optional explicit primary key. If omitted, one is assigned automatically. Returns 409 if the ID already exists.

Response

Returns the full HorarioRead object including resolved catalog names.
curl -s -X POST http://localhost:8004/horarios \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer eyJ..." \
  -d '{
    "docente_id": 3,
    "materia_id": 5,
    "aula_id": 2,
    "periodo_id": 1,
    "dia": "MARTES",
    "hora_inicio": "10:00",
    "hora_fin": "12:00"
  }'

PUT /horarios/

Replaces an existing schedule entry in full. The body has the same shape as POST /horarios. Requires ADMIN role.

Path parameters

horario_id
integer
required
ID of the entry to update.

Headers

Authorization
string
required
Bearer <token> — must decode to rol: ADMIN.

Request body

Same fields as POST /horarios (all required except id, which is taken from the path).

Response

Returns the updated HorarioRead object.
curl -s -X PUT http://localhost:8004/horarios/7 \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer eyJ..." \
  -d '{
    "docente_id": 3,
    "materia_id": 5,
    "aula_id": 2,
    "periodo_id": 1,
    "dia": "JUEVES",
    "hora_inicio": "14:00",
    "hora_fin": "16:00"
  }'

DELETE /horarios/

Deletes a schedule entry. Returns 204 No Content on success. Requires ADMIN role.

Path parameters

horario_id
integer
required
ID of the entry to delete.

Headers

Authorization
string
required
Bearer <token> — must decode to rol: ADMIN.

Response

Empty response body.
curl -s -X DELETE http://localhost:8004/horarios/7 \
  -H "Authorization: Bearer eyJ..."
All write endpoints return 502 Bad Gateway if the usuarios, materias, or aulas services are unreachable at the time of the request.

Build docs developers (and LLMs) love