Saltar al contenido principal

Weekly Availability Properties

This document defines the structure of the weekly availability entity, including all properties and their descriptions.

🔹 Core Properties

PropertyTypeRequiredDescriptionExample
idstringYesUnique identifier for the schedule"550e8400-e29b-41d4-a716-446655440000"
namestringYesName of the schedule"Regular Business Hours"
calendarIdstringYesAssociated calendar identifier"123e4567-e89b-12d3-a456-426614174000"
timezonestringNoIANA timezone name"Europe/Berlin"
serviceIdsstring[]NoAssociated service IDs["123e4567-...", "223e4567-..."]

⚙️ Configuration Structure

The configuration object contains the detailed schedule settings:

🕒 Working Hours

PropertyTypeRequiredDescription
workingHoursobjectYesDay-to-day schedule mapping
{
"workingHours": {
"0": [["09:00", "17:00"]], // Monday
"2": [
// Wednesday
["09:00", "12:30"], // Morning shift
["13:30", "18:00"] // Afternoon shift
]
}
}

📅 Date Overrides

PropertyTypeRequiredDescription
dateOverridesobjectNoSpecial schedules for specific dates
{
"dateOverrides": {
"2025-12-25": [], // Christmas - Closed
"2025-07-04": [["10:00", "14:00"]] // Special holiday hours
}
}

🏖️ Out of Office Periods

PropertyTypeRequiredDescription
outsOfTheOfficestring[][]NoArray of date ranges for unavailability
{
"outsOfTheOffice": [
["2025-08-01", "2025-08-15"], // Summer vacation
["2025-12-24", "2025-12-26"] // Christmas break
]
}

🧩 Complete Example

{
"id": "550e8400-e29b-41d4-a716-446655440000",
"createdAt": "2024-05-09T21:27:28.565Z",
"updatedAt": "2024-09-03T07:31:40.626Z",
"name": "Standard Work Week",
"calendarId": "123e4567-e89b-12d3-a456-426614174000",
"configuration": {
"workingHours": {
"0": [["09:00", "17:00"]],
"1": [["09:00", "17:00"]],
"2": [
["09:00", "12:30"],
["13:30", "17:00"]
],
"3": [["09:00", "17:00"]],
"4": [["09:00", "16:00"]]
},
"dateOverrides": {
"2025-12-25": [],
"2025-12-31": [["09:00", "13:00"]]
},
"outsOfTheOffice": [["2025-07-15", "2025-07-30"]]
},
"serviceIds": [
"123e4567-e89b-12d3-a456-426614174000",
"223e4567-e89b-12d3-a456-426614174111"
]
}

📘 Important Notes

  1. Day Numbering

    • 0 = Monday
    • 1 = Tuesday
    • 2 = Wednesday
    • 3 = Thursday
    • 4 = Friday
    • 5 = Saturday
    • 6 = Sunday
  2. Time Format

    • All times are in 24-hour format ("HH:mm")
    • Times are interpreted in the schedule's timezone
    • Empty array [] indicates day off/closed
  3. Date Format

    • Dates in dateOverrides use "YYYY-MM-DD" format
    • Out of office dates are in UTC timezone
    • Date ranges are inclusive of start and end dates

✅ Common Configurations

  1. Regular Business Hours

    • Monday to Friday, 9 AM to 5 PM
    • Lunch break included or split shifts
    • Weekend days omitted
  2. Split Shifts

    • Morning and afternoon sessions
    • Multiple time ranges per day
    • Custom break periods
  3. Special Schedules

    • Holiday hours
    • Seasonal changes
    • Event-specific times

🔍 Validation Rules

  1. Time Slots

    • Must be in "HH:mm" format
    • End time must be after start time
    • No overlapping time slots within a day
  2. Date Overrides

    • Must be valid dates
    • Can be empty array for closed days
    • Take precedence over regular working hours
  3. Out of Office

    • End date must be after start date
    • Dates must be in chronological order
    • Can overlap with regular working hours