OroCRM\Bundle\ContactBundle\Entity\Contact:
    properties:
        firstName:
            - NotBlank: ~
            - Length:
                max: 100
        lastName:
            - NotBlank: ~
            - Length:
                max: 100
        gender:
            - Choice:
                choices: [male, female]
        birthday:
            - Date: ~
        organization:
            - NotBlank: ~
        addresses:
            - Oro\Bundle\FormBundle\Validator\Constraints\ContainsPrimary:
                message: One of addresses must be set as primary.
            - Oro\Bundle\AddressBundle\Validator\Constraints\UniqueAddressTypes: ~
        emails:
            - Oro\Bundle\FormBundle\Validator\Constraints\ContainsPrimary:
                message: One of emails must be set as primary.
        phones:
            - Oro\Bundle\FormBundle\Validator\Constraints\ContainsPrimary:
                message: One of phones must be set as primary.

OroCRM\Bundle\ContactBundle\Entity\Group:
    constraints:
        - Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity: label
    properties:
        label:
            - NotBlank: ~
            - Length:
                min: 3
                max: 255
        organization:
            - NotBlank: ~

# Prevent required values for all child of AbstractAddress
OroCRM\Bundle\ContactBundle\Entity\ContactAddress:
    properties:
        street:
            - NotBlank: ~
        city:
            - NotBlank: ~
        postalCode:
            - NotBlank: ~
    constraints:
        - Callback:
            methods: [isRegionValid]
