{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "#/components/schemas/RecurrencePattern",
  "title": "RecurrencePattern",
  "type": "object",
  "description": "Describes the frequency by which a recurring event repeats.",
  "properties": {
    "type": {
      "type": "string",
      "enum": [
        "daily",
        "weekly",
        "absoluteMonthly",
        "relativeMonthly",
        "absoluteYearly",
        "relativeYearly"
      ],
      "description": "The recurrence pattern type.",
      "example": "daily"
    },
    "interval": {
      "type": "integer",
      "description": "The number of units between occurrences, where units can be in days, weeks, months, or years.",
      "example": 10
    },
    "daysOfWeek": {
      "type": "array",
      "items": {
        "type": "string",
        "enum": [
          "sunday",
          "monday",
          "tuesday",
          "wednesday",
          "thursday",
          "friday",
          "saturday"
        ]
      },
      "description": "A collection of the days of the week on which the event occurs.",
      "example": []
    },
    "dayOfMonth": {
      "type": "integer",
      "description": "The day of the month on which the event occurs.",
      "example": 10
    },
    "month": {
      "type": "integer",
      "description": "The month in which the event occurs (1-12).",
      "example": 10
    },
    "firstDayOfWeek": {
      "type": "string",
      "enum": [
        "sunday",
        "monday",
        "tuesday",
        "wednesday",
        "thursday",
        "friday",
        "saturday"
      ],
      "description": "The first day of the week.",
      "example": "sunday"
    },
    "index": {
      "type": "string",
      "enum": [
        "first",
        "second",
        "third",
        "fourth",
        "last"
      ],
      "description": "The week index for relative monthly and yearly patterns.",
      "example": "first"
    }
  }
}