Overview
Provider hours define when individual providers (doctors, stylists, therapists, etc.) are available to take appointments.Provider hours must intersect with clinic hours. Providers cannot work when the clinic is closed.
Clinic Hours vs Provider Hours
The system uses an intersection-based hierarchy:- System fetches clinic hours for the requested weekday
- System fetches provider hours for the same weekday
- System calculates intersection (overlap) of both periods
- Appointments can only be booked during the intersected time
Visual Example
Scenario: Monday availability for Provider AExample: Provider Outside Clinic Hours
Scenario: Provider B tries to work before clinic opensCritical Rule: Clinic Closed = No Provider Availability
Example:Step-by-Step: Configure Provider Hours

1
Navigate to Provider Settings
Go to Proveedores > [Select Provider] > Horarios de Trabajo (Providers > [Provider] > Work Hours).
2
Select Weekday
Choose the day of the week (1=Monday, 7=Sunday).
3
Configure Time Period
Enter opening and closing times in 24-hour format (HH:MM).
Example (Provider works mornings only):

- Opening:
09:00 - Closing:
13:00
4
Save Configuration
Click Guardar (Save).The system will:
- Validate no overlaps with other periods for this provider/weekday
- Validate time range (close > open)
- Calculate intersection with clinic hours
- Invalidate availability cache automatically
Example: Multiple Providers with Different Schedules
Clinic Hours (Monday): 08:00-20:00 Provider Configurations:| Provider | Period 1 | Period 2 | Available Slots |
|---|---|---|---|
| Dr. Smith | 09:00-13:00 | Not configured | 09:00-13:00 (mornings only) |
| Dr. Jones | Not configured | 15:00-19:00 | 15:00-19:00 (afternoons only) |
| Dr. Brown | 09:00-13:00 | 15:00-19:00 | 09:00-13:00 + 15:00-19:00 (split shift) |
| Dr. Wilson | Not configured | Not configured | 08:00-20:00 (full clinic hours) |
Slot Generation by Provider
Service Duration: 30 minutes Dr. Smith (mornings only):When a provider has no hours configured, the system uses clinic hours as the default.
Multiple Periods for Providers
Providers can have multiple non-contiguous time periods per day, just like clinics.Example: Provider with Split Shift
Scenario: Provider C works split shift (morning + afternoon) Configuration (Monday):- Period 1: 09:00-13:00 (morning)
- Period 2: 15:00-19:00 (afternoon)
- Gap: 13:00-15:00 (lunch break)
- Morning: 09:00, 09:30, …, 12:30
- Afternoon: 15:00, 15:30, …, 18:30
- NO slots: 08:00-09:00, 13:00-15:00, 19:00-20:00
Edge Cases and Intersection Logic
Provider works outside clinic hours
Provider works outside clinic hours
Scenario: Provider hours extend beyond clinic hoursExample:
- Clinic: 08:00-18:00
- Provider: 07:00-20:00
Provider has no hours configured
Provider has no hours configured
Scenario: Provider hours not configured for a specific weekdayBehavior: System uses clinic hours as the default.Example:
- Clinic (Monday): 09:00-20:00
- Provider (Monday): Not configured
Clinic closed, provider has hours
Clinic closed, provider has hours
Scenario: Clinic closed (no hours), but provider has hours configuredExample:
- Clinic (Sunday): Not configured (closed)
- Provider (Sunday): 10:00-14:00
Multiple providers, different days off
Multiple providers, different days off
Scenario: Providers have different availability patternsExample:
- Provider A: Works Mon-Fri only
- Provider B: Works Tue-Sat only
- Provider C: Works Sat-Sun only
| Day | Provider A | Provider B | Provider C |
|---|---|---|---|
| Mon | ✅ 09:00-17:00 | ❌ | ❌ |
| Tue | ✅ 09:00-17:00 | ✅ 09:00-17:00 | ❌ |
| Sat | ❌ | ✅ 10:00-14:00 | ✅ 10:00-14:00 |
| Sun | ❌ | ❌ | ✅ 10:00-14:00 |
What Happens When You Save Provider Hours?
When you configure provider hours, the system:- Validates no overlaps with existing periods for this provider/weekday
- Validates time range (close > open)
- Saves to database (
work_hourstable withprovider_id) - Invalidates availability cache for this provider
- Recalculates available slots based on intersection with clinic hours
Cache invalidation is automatic. Availability updates immediately.
Visual Summary: Intersection Examples
Example 1: Provider Within Clinic Hours
Example 2: Provider Extends Beyond Clinic Hours
Example 3: Provider with Split Shift (Multiple Periods)
Example 4: Clinic Closed (No Intersection)
Best Practices
Default behavior: If a provider has no hours configured for a specific day, the system defaults to clinic hours for that day.
Common Questions
Can a provider work when the clinic is closed?
Can a provider work when the clinic is closed?
No. Clinic hours are the operational constraint. Provider hours cannot override clinic closure.Example:
- Clinic (Sunday): Closed
- Provider (Sunday): 10:00-14:00 configured
What happens if I don't configure provider hours?
What happens if I don't configure provider hours?
The system uses clinic hours as the default.Example:
- Clinic (Monday): 09:00-20:00
- Provider (Monday): Not configured
Can multiple providers have different hours for the same day?
Can multiple providers have different hours for the same day?
Yes. Each provider can have independent hours.Example (Monday):
- Provider A: 09:00-13:00 (mornings)
- Provider B: 15:00-19:00 (afternoons)
- Provider C: 09:00-20:00 (full day)
Can I edit provider hours without affecting clinic hours?
Can I edit provider hours without affecting clinic hours?
Yes. Provider hours are independent from clinic hours (except for intersection validation).Editing provider hours:
- Does NOT affect clinic hours
- Does NOT affect other providers
- Only affects the specific provider