The materias service maintains the catalog of academic subjects that can be assigned to schedule entries. It validates admin credentials by forwarding theDocumentation 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.
Authorization header to the usuarios service (GET /auth/me) before allowing any write operation.
Base URL: http://localhost:8002
GET /materias/
Returns all subjects in the catalog. No authentication required.Response
An array of subject objects.Auto-assigned primary key.
Subject name, e.g.
"Cálculo I".Unique subject code, e.g.
"MAT101".Credit hours (must be greater than 0).
Associated shift:
MATUTINO, VESPERTINO, or AMBOS.Optional long-form description.
GET /materias/
Returns a single subject by ID. No authentication required.Path parameters
ID of the subject to retrieve.
Response
- 200 — success
- 404 — not found
A single subject object.
POST /materias/
Creates a new subject. RequiresADMIN role.
Headers
Bearer <token> — must decode to rol: ADMIN.Request body
Subject name. Cannot be blank.
Unique subject code. Cannot be blank.
Number of credit hours. Must be greater than 0.
Shift:
MATUTINO, VESPERTINO, or AMBOS.Optional description.
Response
- 201 — created
- 400 — validation error
- 403 — forbidden
Returns the created subject object.
PUT /materias/
Updates an existing subject. Only fields present in the request body are changed; omitted fields retain their current values. RequiresADMIN role.
Path parameters
ID of the subject to update.
Headers
Bearer <token> — must decode to rol: ADMIN.Request body (all fields optional)
New subject name.
New subject code.
New credit count (must be > 0 if provided).
New shift:
MATUTINO, VESPERTINO, or AMBOS.New description. Pass
null to clear it.Response
- 200 — updated
- 404 — not found
Returns the updated subject object.
DELETE /materias/
Deletes a subject from the catalog. RequiresADMIN role.
Path parameters
ID of the subject to delete.
Headers
Bearer <token> — must decode to rol: ADMIN.Response
- 204 — deleted
- 404 — not found
Empty response body.
The
turno field on a subject is used by the schedule generator when matching subjects to teachers. Setting it to MATUTINO ensures the subject is only scheduled in morning slots; AMBOS places no shift restriction.