Schedule generation is the core workflow in Módulo Horario. Given a set of teachers, subjects, classrooms, and an academic period, the system automatically assigns each subject to a time slot, day, classroom, and teacher — producing a complete weekly schedule while respecting shift and availability constraints.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.
Triggering schedule generation requires the ADMIN role. Teachers with the DOCENTE role can view existing schedules but cannot create or generate them.
Prerequisites
Before generating a schedule, make sure all four catalogs are populated:At least one period
A schedule is always generated for a specific academic period. Create the period first on the Periodos page.
Teachers with availability
Each teacher should have availability blocks configured. Without them, the generator falls back to the full workday window.
Subjects in the catalog
Subjects must exist in the materias-service before they can be assigned to time slots.
Classrooms in the catalog
Classrooms must exist in the aulas-service. Each classroom’s capacity is visible in the schedule output.
Constraints respected by the generator
The generation algorithm enforces these rules for every candidate slot:No double-booking for teachers
No double-booking for teachers
A teacher cannot be assigned to two different subjects at the same time on the same day. The algorithm checks all existing and newly created schedule entries before committing each assignment.
Teacher shift constraints
Teacher shift constraints
Each teacher has a shift: MATUTINO (07:00–14:00), VESPERTINO (15:00–22:00), or AMBOS. A teacher assigned to MATUTINO will never be scheduled in an afternoon slot, and vice versa. The validator rejects any manual entry that violates this rule too.
Teacher availability blocks
Teacher availability blocks
Teachers can define specific days and time windows when they are available. The generator only places assignments within those windows. If no availability is configured, the teacher is treated as available for the entire requested workday.
Classroom conflicts
Classroom conflicts
Two different subjects cannot share the same classroom at the same time. The algorithm checks for time overlaps across all slots before assigning a classroom.
Generating a schedule from the UI
Open the Horarios page
Navigate to the Horarios section from the main menu. You must be logged in as ADMIN.
Expand the Generar Horarios Automaticos panel
Click the collapsible panel labeled Generar Horarios Automaticos to reveal the generation form.
Select a period
Choose the academic period from the Periodo dropdown. Only existing periods appear here.
Configure the workday
Set the session duration (minimum 30 minutes), the workday start and end times, and the days to include. The default days are Monday through Friday.
Optionally filter teachers, subjects, and classrooms
Use the multi-select lists to limit generation to specific teachers, subjects, or classrooms. If you leave them empty, the system uses all available records from each catalog service.
Generating via API
Send aPOST request to /horarios/generar with an Authorization header containing an ADMIN token.
docente_ids, materia_ids, or aula_ids causes the service to fetch all available records from the respective catalog microservices automatically.
See the API reference for the full request schema.
Understanding the response
The generation endpoint returns three fields:| Field | Description |
|---|---|
creados | Array of schedule entries that were successfully created, each including teacher name, subject name, classroom name, day, and time. |
materias_sin_asignar | Array of subject IDs that could not be assigned. This happens when no valid slot exists due to availability or conflict constraints. |
mensajes | Human-readable summary messages explaining how many schedules were created and why any subjects were skipped. |