Oro\Bundle\UserBundle\Entity\User:
    constraints:
        - Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity: username
        - Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity: email
        - Oro\Bundle\UserBundle\Validator\Constraints\UserAuthenticationFieldsConstraint: ~
    properties:
        username:
            - NotBlank:     ~
            - Length:
                min:        3
                max:        255
        email:
            - NotBlank:     ~
            - Length:
                min:        6
                max:        255
            - Email:        ~
        plainPassword:
            - NotBlank:
                groups:     [Registration]
            - Length:
                min:        2
        enabled:
            - NotNull:      ~
        roles:
            - Count:
                min:        1
                minMessage: "You must select at least {{ limit }} role"
                groups:     [Roles]
        firstName:
            - NotBlank:     ~
            - Length:
                max:        100
        lastName:
            - NotBlank:     ~
            - Length:
                max:        100
        birthday:
            - Date:         ~
        organization:
            - NotBlank: ~

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

Oro\Bundle\UserBundle\Entity\Group:
    constraints:
        - Oro\Bundle\OrganizationBundle\Validator\Constraints\OrganizationUniqueEntity: name
    properties:
        name:
            - NotBlank:     ~
            - Length:
                max:        30
        organization:
            - NotBlank: ~
#        roles:
#            - Count:
#                min:        1
#                minMessage: "You must select at least {{ limit }} role"

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