Oro\Bundle\CalendarBundle\Entity\CalendarEvent:
    constraints:
        - Oro\Bundle\CalendarBundle\Validator\Constraints\RecurringCalendarEventException: ~
        - Oro\Bundle\CalendarBundle\Validator\Constraints\UniqueUid: ~
        - Oro\Bundle\CalendarBundle\Validator\Constraints\EventAttendees: ~
    properties:
        uid:
            - Oro\Bundle\FormBundle\Validator\Constraints\UnchangeableField: ~
            - Length:
                  max: 36
        title:
            - NotBlank:     ~
            - Length:
                max: 255
        start:
            - Type:
                  type: DateTimeInterface
                  message: oro.calendar.calendar_event.start.type.message
                  payload:
                      jsValidation:
                          type: DateTime
            - NotBlank:     ~
            - Oro\Bundle\CalendarBundle\Validator\Constraints\DateEarlierThan: end
        end:
            - Type:
                  type: DateTimeInterface
                  message: oro.calendar.calendar_event.end.type.message
                  payload:
                      jsValidation:
                          type: DateTime
            - NotBlank: ~
        attendees:
            - Valid: ~
        recurrence:
            - Valid: ~
        reminders:
            - Valid: ~
            - Oro\Bundle\CalendarBundle\Validator\Constraints\ReminderStartDate: ~
        organizerEmail:
            - Email: ~
            - Length:
                max: 255
            - Oro\Bundle\FormBundle\Validator\Constraints\UnchangeableField: ~
        organizerDisplayName:
            - Length:
                max: 255
            - Oro\Bundle\FormBundle\Validator\Constraints\UnchangeableField: ~
        organizerUser:
            - Oro\Bundle\FormBundle\Validator\Constraints\UnchangeableField: ~

Oro\Bundle\CalendarBundle\Entity\CalendarProperty:
    properties:
        targetCalendar:
            - NotBlank:     ~
        calendarAlias:
            - NotBlank:     ~
            - Length:
                max: 32
        calendar:
            - NotBlank:     ~
        backgroundColor:
            - Length:
                max: 7

Oro\Bundle\CalendarBundle\Entity\SystemCalendar:
    properties:
        name:
            - NotBlank:     ~
            - Length:
                max: 255

Oro\Bundle\CalendarBundle\Entity\Attendee:
    constraints:
        - Oro\Bundle\CalendarBundle\Validator\Constraints\Attendee: ~
    properties:
        email:
            - Email: ~
            - Length:
                max: 255
        displayName:
            - Length:
                max: 255

Oro\Bundle\CalendarBundle\Entity\Recurrence:
    constraints:
        - Oro\Bundle\CalendarBundle\Validator\Constraints\Recurrence: ~
    properties:
        # Properties section doesn't contain rules dependentent from recurrence actual values
        # in the recurrence, e.g. recurrenceType, dayOfMonth, interval, endTime.
        # All dynamic rules should be placed into Oro\Bundle\CalendarBundle\Validator\Constraints\Recurrence
        instance:
            - Type:
                type: integer
            - Range:
                min: 1
                max: 5
        dayOfWeek:
            - Type:
                type: array
        dayOfMonth:
            - Type:
                type: integer
            - Range:
                min: 1
                max: 31
        monthOfYear:
            - Type:
                type: integer
            - Range:
                min: 1
                max: 12
        startTime:
            - Type:
                type: DateTimeInterface
                message: oro.calendar.recurrence.start_time.type.message
                payload:
                    jsValidation:
                        type: DateTime
        endTime:
            - Type:
                  type: DateTimeInterface
                  message: oro.calendar.recurrence.end_time.type.message
                  payload:
                      jsValidation:
                          type: DateTime
        occurrences:
            - Type:
                type: integer
            - Range:
                min: 1
                max: 999
        timeZone:
            - Type:
                type: string
            - Choice: {callback: [\DateTimeZone, listIdentifiers]}
