Skip to main content

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:
Priority: Clinic Hours → Provider Hours
How it works:
  1. System fetches clinic hours for the requested weekday
  2. System fetches provider hours for the same weekday
  3. System calculates intersection (overlap) of both periods
  4. Appointments can only be booked during the intersected time

Visual Example

Scenario: Monday availability for Provider A
Clinic Hours (Monday):   08:00 ━━━━━━━━━━━━━━━━━━━━━━━━━━ 20:00

Provider A Hours:              09:00 ━━━━━━━━━━━━━ 17:00

Intersection (Available):      09:00 ━━━━━━━━━━━━━ 17:00 ✅
Result: Provider A can take appointments from 09:00-17:00 (intersection).

Example: Provider Outside Clinic Hours

Scenario: Provider B tries to work before clinic opens
Clinic Hours (Monday):        08:00 ━━━━━━━━━━━━━━━━━━━━━━━ 20:00

Provider B Hours:        07:00 ━━━━━━━━ 10:00

Intersection (Available):     08:00 ━━━━━ 10:00 ✅
Result: Provider B can only work 08:00-10:00 (intersection starts when clinic opens).
Time before clinic opens (07:00-08:00) is ignored, even if configured in provider hours.

Critical Rule: Clinic Closed = No Provider Availability

If the clinic is closed on a specific day (no clinic-level work hours configured), NO appointments can be booked that day, regardless of provider availability.
Example:
Sunday (7):
  Clinic Hours: NOT CONFIGURED (closed)
  Provider A Hours: 10:00-14:00 (configured)

Result: NO appointments can be booked ❌
Why: The system enforces clinic hours as the operational constraint. Provider hours cannot override clinic closure.

Step-by-Step: Configure Provider Hours

Selector de proveedor para configurar horarios individuales
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).
Formulario de configuración de horarios para proveedor específico
Example (Provider works mornings only):
  • Opening: 09:00
  • Closing: 13:00
You can create multiple periods for the same provider and weekday. See Multiple Periods.
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:
ProviderPeriod 1Period 2Available Slots
Dr. Smith09:00-13:00Not configured09:00-13:00 (mornings only)
Dr. JonesNot configured15:00-19:0015:00-19:00 (afternoons only)
Dr. Brown09:00-13:0015:00-19:0009:00-13:00 + 15:00-19:00 (split shift)
Dr. WilsonNot configuredNot configured08:00-20:00 (full clinic hours)

Slot Generation by Provider

Service Duration: 30 minutes Dr. Smith (mornings only):
Available: 09:00-13:00
Slots: 09:00, 09:30, 10:00, 10:30, 11:00, 11:30, 12:00, 12:30
Dr. Jones (afternoons only):
Available: 15:00-19:00
Slots: 15:00, 15:30, 16:00, 16:30, 17:00, 17:30, 18:00, 18:30
Dr. Brown (split shift):
Available: 09:00-13:00 + 15:00-19:00
Slots:
  Morning: 09:00, 09:30, ..., 12:30
  Afternoon: 15:00, 15:30, ..., 18:30
NO slots in gap: 13:00-15:00 ✅
Dr. Wilson (no provider hours configured):
Available: 08:00-20:00 (defaults to clinic hours)
Slots: 08:00, 08:30, 09:00, ..., 19:00, 19:30
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)
Clinic Hours (Monday): 08:00-20:00 Intersection:
Clinic:    08:00 ━━━━━━━━━━━━━━━━━━━━━━━━━━ 20:00
Provider:        09:00 ━━━━━ 13:00  15:00 ━━━━━ 19:00

Result:          09:00 ━━━━━ 13:00  15:00 ━━━━━ 19:00 ✅
Available Slots:
  • 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
See Multiple Periods Per Day for detailed configuration.

Edge Cases and Intersection Logic

Scenario: Provider hours extend beyond clinic hoursExample:
  • Clinic: 08:00-18:00
  • Provider: 07:00-20:00
Intersection: 08:00-18:00 ✅ (clinic hours only)Why: Provider cannot work when clinic is closed.
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
Result: Provider available 09:00-20:00 ✅
Scenario: Clinic closed (no hours), but provider has hours configuredExample:
  • Clinic (Sunday): Not configured (closed)
  • Provider (Sunday): 10:00-14:00
Result: NO appointments can be booked ❌Why: Clinic closure overrides provider availability.
Scenario: Providers have different availability patternsExample:
  • Provider A: Works Mon-Fri only
  • Provider B: Works Tue-Sat only
  • Provider C: Works Sat-Sun only
Result: At least one provider available every day (if clinic is open).Configuration:
DayProvider AProvider BProvider 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:
  1. Validates no overlaps with existing periods for this provider/weekday
  2. Validates time range (close > open)
  3. Saves to database (work_hours table with provider_id)
  4. Invalidates availability cache for this provider
  5. 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

Clinic:    08:00 ━━━━━━━━━━━━━━━━━━━━━━━━━━ 20:00
Provider:        09:00 ━━━━━━━━━━━━━ 17:00

Available:       09:00 ━━━━━━━━━━━━━ 17:00 ✅

Example 2: Provider Extends Beyond Clinic Hours

Clinic:          08:00 ━━━━━━━━━━━━━━━━━━━━ 18:00
Provider:  06:00 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 20:00

Available:       08:00 ━━━━━━━━━━━━━━━━━━━━ 18:00 ✅

Example 3: Provider with Split Shift (Multiple Periods)

Clinic:    08:00 ━━━━━━━━━━━━━━━━━━━━━━━━━━ 20:00
Provider:        09:00 ━━━━━ 13:00  15:00 ━━━━━ 19:00

Available:       09:00 ━━━━━ 13:00  15:00 ━━━━━ 19:00 ✅

Example 4: Clinic Closed (No Intersection)

Clinic:    [CLOSED - No hours configured]
Provider:  10:00 ━━━━━━━━━━━━━━ 14:00

Available: [CLOSED - No appointments] ❌

Best Practices

Configure clinic hours first: Always set up clinic-level hours before configuring provider hours. Provider hours are validated against clinic hours.
Use multiple periods for provider flexibility: If a provider works split shifts, configure multiple periods (e.g., 09:00-13:00 + 15:00-19:00).
Don’t rely on provider hours to override clinic closure: If the clinic is closed, providers cannot work. Configure clinic hours for all operational days.
Default behavior: If a provider has no hours configured for a specific day, the system defaults to clinic hours for that day.

Common Questions

No. Clinic hours are the operational constraint. Provider hours cannot override clinic closure.Example:
  • Clinic (Sunday): Closed
  • Provider (Sunday): 10:00-14:00 configured
Result: NO appointments can be booked ❌
The system uses clinic hours as the default.Example:
  • Clinic (Monday): 09:00-20:00
  • Provider (Monday): Not configured
Result: Provider available 09:00-20:00 ✅
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)
All configurations are valid and independent.
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

Next Steps