Overview
The system automatically detects and prevents scheduling conflicts to ensure horses and instructors are not double-booked.Conflict Validation
Automatic Detection
From the README documentation:~/workspace/source/README.md:214-219
Business Rule Enforcement
~/workspace/source/README.md:543
Visual Indicators
Conflict Set Tracking
The calendar uses a conflict set to track and display conflicts:~/workspace/source/src/pages/Calendario.tsx:171-188
Warning Symbol
Cells with conflicts display a warning indicator (⚠️) to alert users:~/workspace/source/README.md:219
Conflict Types
Horse Conflicts
Prevents scheduling the same horse for multiple classes at the same time:- Scenario: Trying to assign Horse A to two classes at 10:00 AM
- Detection: System checks if horse already has a class at that time
- Prevention: Shows warning and prevents double-booking
Instructor Conflicts
Prevents assigning the same instructor to overlapping classes:- Scenario: Trying to assign Instructor B to classes at 10:00 and 10:30 when first class is 60 minutes
- Detection: System checks instructor availability for the full duration
- Prevention: Displays conflict indicator
Time-Based Conflict Detection
30-Minute Classes
For 30-minute classes, conflicts occur when:- Same horse scheduled at exact same time slot
- Same instructor scheduled at exact same time slot
60-Minute Classes
For 60-minute classes (occupying two consecutive slots):~/workspace/source/README.md:269-273
Conflicts occur when:
- Horse scheduled during either time slot (10:00 or 10:30)
- Instructor scheduled during either time slot
Conflict Resolution
User Actions
When a conflict is detected:- Visual Warning - Conflict indicator appears in calendar cell
- Review - User reviews the conflicting classes
- Options:
- Choose different horse
- Choose different instructor
- Select different time slot
- Cancel one of the conflicting classes
Prevention Strategy
The system prevents conflicts by:- Real-time Checking - Validates availability when creating/editing classes
- Visual Feedback - Shows conflicts immediately in calendar view
- Blocking - Can prevent saving classes with conflicts (depending on implementation)
Day View Conflict Visualization
Grid Layout
The day view makes conflicts easily visible:~/workspace/source/README.md:257-261
This layout makes it easy to spot:
- Multiple classes in same horse column at same time
- Same instructor color appearing in multiple columns at same time
Instructor Color Coding
Visual Conflict Detection
Instructor colors help identify conflicts visually:~/workspace/source/src/pages/Calendario.tsx:236-248
Identifying Instructor Conflicts
When the same instructor color appears:- In multiple columns at the same time row = CONFLICT
- In adjacent time rows for a 60-minute class = CONFLICT
Private Horse Protection
Ownership Validation
Prevents conflicts with horse ownership rules:~/workspace/source/README.md:542
This prevents:
- Assigning private horses to non-owners
- Scheduling conflicts with owner’s classes
Conflict Checking Flow
When Creating a Class
- User selects date, time, horse, instructor
- System queries existing classes for that day
- For the selected time slot:
- Check if horse has a class
- Check if instructor has a class
- Account for class duration (30 or 60 minutes)
- If conflict found:
- Add to conflict set
- Display warning indicator
- User decides how to proceed
When Editing a Class
Same process, but excludes the current class being edited from conflict detection.Best Practices
- Use Day View - Best view for identifying conflicts visually
- Check Before Creating - Review calendar before scheduling
- Watch for Colors - Duplicate instructor colors indicate conflicts
- Verify Warnings - Always investigate conflict indicators
- Plan Ahead - Consider instructor and horse availability
- Update Availability - Mark horses as unavailable when needed
- Stagger Classes - Use 30-minute slots to maximize scheduling flexibility
- Communication - Coordinate with instructors about their availability
Conflict Scenarios
Scenario 1: Horse Double-Booking
Scenario 2: Instructor Overlap
Scenario 3: Private Horse Assignment
Future Enhancements
Potential improvements to conflict detection:- Automatic Suggestions - Suggest alternative times/horses/instructors
- Conflict Prevention - Block saving classes with unresolved conflicts
- Batch Conflict Check - Validate entire schedule for conflicts
- Smart Scheduling - AI-powered optimal scheduling
- Waitlist Management - Queue students when no slots available