Oro\Bundle\UserBundle\Entity\User:
    constraints:
        - Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity: username
        - Oro\Bundle\UserBundle\Validator\Constraints\UniqueUserEmail: ~
        - Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity:
              fields: [ usernameLowercase ]
              message: 'oro.user.message.user_username_exists'
        - Oro\Bundle\UserBundle\Validator\Constraints\UserAuthenticationFields: ~
    properties:
        username:
            - NotBlank: ~
            - Length:
                min: 3
                max: 255
                allowEmptyString: false
        email:
            - NotBlank: ~
            - Length:
                min: 6
                max: 255
                allowEmptyString: false
                groups: [UserForm, Registration]
            - Email:        ~
        plainPassword:
            - NotBlank:
                groups:     [Registration, ResetPassword]
            - Oro\Bundle\UserBundle\Validator\Constraints\PasswordComplexity:
                groups:     [Registration, ResetPassword, Default]
        enabled:
            - NotNull:      ~
        userRoles:
            - Count:
                min:        1
                minMessage: "You must select at least {{ limit }} role"
                groups:     [Roles]
        firstName:
            - NotBlank:     ~
            - Length:
                max:        100
        lastName:
            - NotBlank:     ~
            - Length:
                max:        100
        birthday:
            - Type:
                type: DateTimeInterface
                message: oro.user.user.birthday.type.message
                payload:
                    jsValidation:
                        type: Date
            - LessThanOrEqual:
                value: now UTC
                message: The birth date cannot be in the future.
        emails:
            - Valid: ~

Oro\Bundle\UserBundle\Entity\Role:
    constraints:
        - Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity: label
    properties:
        role:
            - Length:
                max: 30
        label:
            - NotBlank: ~
            - Length:
                max: 30
        users:
            - Oro\Bundle\UserBundle\Validator\Constraints\UserWithoutRole: ~

Oro\Bundle\UserBundle\Entity\Group:
    constraints:
        - Oro\Bundle\OrganizationBundle\Validator\Constraints\OrganizationUniqueEntity: name
    properties:
        name:
            - NotBlank: ~
            - Length:
                max: 30

Oro\Bundle\UserBundle\Entity\Email:
    properties:
        user:
            - NotBlank: ~
        email:
            - Email: ~
