Overview
The scheduling system implements comprehensive rules to prevent conflicts, ensure resource availability, and maintain operational constraints.Time Constraints
Operating Hours
Business Hours: 09:00 - 18:30 Time Slot Grid:- Increment: 30 minutes
- First slot: 09:00
- Last slot start: 18:00 (for 30-min classes) or 17:30 (for 60-min classes)
- Hard deadline: Classes must end by 18:30
Class Duration Rules
Available Durations:- 30 minutes (default)
- 60 minutes
- Occupies 1 time slot
- Example: Class at 10:00 occupies only 10:00 slot
- Occupies 2 consecutive time slots
- Example: Class at 10:00 occupies 10:00 and 10:30 slots
- Both slots are clickable in calendar (open same details)
- Visual border indicates continuation
Resource Conflict Detection
Horse Conflict
Rule: A horse cannot have overlapping classes Detection Logic:- ⚠️ Warning icon in conflicted cell
- Highlighted border
- Tooltip: “Conflicto: Este caballo ya tiene una clase a esta hora”
Instructor Conflict
Rule: An instructor cannot have overlapping classes Detection Logic:- Shows warning when conflict detected
- Allows creation with confirmation (instructor can handle multiple)
- Less strict than horse conflict
Overlap Detection Algorithm
Two time ranges overlap if:| Class A | Class B | Overlap? | Reason |
|---|---|---|---|
| 10:00-10:30 | 10:30-11:00 | ❌ No | Adjacent, not overlapping |
| 10:00-10:30 | 10:15-10:45 | ✅ Yes | Partial overlap |
| 10:00-11:00 | 10:30-11:00 | ✅ Yes | B contained in A |
| 10:00-10:30 | 11:00-11:30 | ❌ No | Completely separate |
| 10:00-11:00 | 09:30-10:30 | ✅ Yes | Partial overlap |
Calendar Operations
Copy Classes
Feature: Copy entire week’s schedule to another week Parameters:- Source day (any day in source week)
- Target day (any day in target week)
- Number of weeks to copy
- Checks for conflicts in target week
- Confirms before overwriting
- Shows summary of classes to be copied
Delete Classes in Range
Feature: Delete multiple classes between two dates Parameters:- Start date (inclusive)
- End date (inclusive)
- Requires user confirmation
- Shows count of classes to be deleted
- Cannot be undone (warn user)
Cancel Full Day
Feature: Cancel all classes on a specific day Parameters:- Day to cancel
- Cancellation reason (optional)
- Lluvia (Rain)
- Feriado (Holiday)
- Mantenimiento (Maintenance)
- Evento Especial (Special Event)
- Emergencia (Emergency)
- Otro (Other - with custom text)
- Only affects
PROGRAMADAclasses - Leaves
COMPLETADA,CANCELADA, etc. unchanged - Records reason in observations
- Requires confirmation
Class Assignment Rules
Student Assignment
Regular Class:- Student must be active (
activo: true) - Student must exist in system
- Student can be any active student
- Option 1: New person (not in system)
- Provide first and last name
- Create
PersonaPruebarecord - Set
esPrueba: true - Set
alumnoId: null
- Option 2: Existing inactive student
- Student must be inactive (
activo: false) - Student must not have classes in that specialty
- Student must not have had trial class in that specialty
- Set
esPrueba: true
- Student must be inactive (
- Automatically assigns
alumnoId: 1(placeholder) - No student selection needed
- Used for free riding sessions
Horse Assignment
School Horse (ESCUELA):
- ✅ Can be assigned to any student
- ✅ Can be used for trial classes
- ✅ Multiple students can use (at different times)
PRIVADO):
- ⚠️ Can only be assigned to owner
- ⚠️ System validates ownership
- ❌ Cannot be used by other students
- ❌ Validation error if mismatch
Instructor Assignment
Requirements:- Instructor must be active (
activo: true) - Instructor should not have conflict (warning, not blocking)
- Each instructor has assigned color
- Class cells show instructor’s color as background
- Helps visual identification in calendar
Availability Rules
Horse Availability
Rule: Horse must be marked as available (disponible: true)
Behavior:
- Unavailable horses don’t appear in selection dropdowns
- Existing classes with unavailable horses remain valid
- Useful for horses in maintenance, injured, etc.
Student Quota
Monitoring: Track classes used vs. contracted Calculation (useClasesRestantes):
- Normal:
clasesRestantes > 2 - Warning:
clasesRestantes <= 2 && clasesRestantes > 0 - Over quota:
clasesRestantes <= 0
- Shows warning when near limit
- Allows over-quota with confirmation
- Does not block scheduling
- Trial classes don’t count