Oro\Bundle\DotmailerBundle\Entity\DotmailerTransport:
    properties:
        username:
            - NotBlank: ~
            - Length:
                max: 255
                maxMessage: "Your username cannot be longer than {{ limit }} characters long"
        password:
            - NotBlank:
                groups: [Create]
            - Length:
                min: 8
                max: 255

Oro\Bundle\DotmailerBundle\Entity\AddressBook:
    constraints:
        - Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity:
            fields: [ channel, name ]
            message: oro.dotmailer.validators.address_book.unique_entity.message
    properties:
        channel:
            - NotBlank: ~
        name:
            - NotBlank: ~
            - Length:
                max: 255
        owner:
            - NotBlank: ~

Oro\Bundle\DotmailerBundle\Entity\Campaign:
    properties:
        channel:
            - NotBlank: ~
        name:
            - NotBlank: ~
            - Length:
                max: 255
        subject:
            - Length:
                max: 255
        fromName:
            - Length:
                max: 255
        fromAddress:
            - Length:
                max: 255
        replyToAddress:
            - Length:
                max: 255
        owner:
            - NotBlank: ~

Oro\Bundle\DotmailerBundle\Entity\Contact:
    properties:
        channel:
            - NotBlank: ~
        owner:
            - NotBlank: ~
        email:
            - NotBlank: ~

Oro\Bundle\DotmailerBundle\Entity\Activity:
    properties:
        channel:
            - NotBlank: ~
        contact:
            - NotBlank: ~
        campaign:
            - NotBlank: ~
        owner:
            - NotBlank: ~

Oro\Bundle\DotmailerBundle\Entity\CampaignSummary:
    properties:
        channel:
            - NotBlank: ~
        campaign:
            - NotBlank: ~
        owner:
            - NotBlank: ~

Oro\Bundle\DotmailerBundle\Entity\DataField:
    constraints:
        - Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity:
            fields: [channel, name]
            errorPath: name
            message: "Field with such name already exists in this Dotmailer integration"
    properties:
        channel:
            - NotBlank: ~
        owner:
            - NotBlank: ~
        name:
            - NotBlank: ~
            - Length:
                max: 20
            - Regex:
                pattern: '/^[a-z_\-0-9]+$/i'
                message: "Must consist of alphnumeric characters only, with hyphens and underscores if required"
        type:
            - NotBlank: ~
        visibility:
            - NotBlank: ~

Oro\Bundle\DotmailerBundle\Entity\DataFieldMapping:
    constraints:
        - Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity:
            fields: [channel, entity]
            errorPath: entity
            message: oro.dotmailer.validators.data_field_mapping.unique_entity.message
    properties:
        channel:
            - NotBlank: ~
        owner:
            - NotBlank: ~
        entity:
            - NotBlank: ~

Oro\Bundle\DotmailerBundle\Entity\DataFieldMappingConfig:
    constraints:
        - Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity:
            fields: [mapping, dataField]
            message: "The same Data Field can be mapped only one time"
        - Oro\Bundle\DotmailerBundle\Validator\Constraints\DataFieldMappingConfigConstraint:
    properties:
        entityFields:
            - NotBlank: ~
        dataField:
            - NotBlank: ~

