Oro\Bundle\ProductBundle\Entity\Product:
    constraints:
        - Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity:
            fields: [sku, organization]
            repositoryMethod: findByCaseInsensitive
        - Oro\Bundle\ProductBundle\Validator\Constraints\ProductVariantField: ~
        - Oro\Bundle\ProductBundle\Validator\Constraints\ProductVariantLinks: ~
        - Oro\Bundle\ProductBundle\Validator\Constraints\UniqueProductVariantLinks: ~
        - Oro\Bundle\ProductBundle\Validator\Constraints\UniqueVariantLinksSimpleProduct: ~
        - Oro\Bundle\ProductBundle\Validator\Constraints\EmptyVariantFieldInSimpleProductForVariantLinks: ~
        - Oro\Bundle\ProductBundle\Validator\Constraints\NotEmptyConfigurableAttributes:
            groups: [product_create_step_one, Import]
        - Oro\Bundle\ProductBundle\Validator\Constraints\PrimaryProductUnitPrecision: ~
        - Oro\Bundle\ProductBundle\Validator\Constraints\NotEmptyProductKitItemsCollection: ~
        - Oro\Bundle\ProductBundle\Validator\Constraints\ProductKitItemsOwnedByProductKit: ~
        - Oro\Bundle\ProductBundle\Validator\Constraints\ProductUnitPrecisionsCollectionReferencedByProductKitItems: ~
        - Oro\Bundle\ProductBundle\Validator\Constraints\OnlyProductKitCanHaveKitItems:
            groups: [Import]
    properties:
        sku:
            - NotBlank:
                message: 'oro.product.sku.blank'
            - Length:
                min: 3
                max: 255
                allowEmptyString: false
            - Oro\Bundle\ProductBundle\Validator\Constraints\SkuRegex: ~
        unitPrecisions:
            - Count:
                min: 1
                minMessage: 'oro.product.unit_precisions_items.blank'
        primaryUnitPrecision:
            - NotBlank: ~
            - Valid: ~
        status:
            - NotBlank: ~
            - Choice: { callback: getStatuses }
        type:
            - NotBlank: ~
            - Choice: { callback: getTypes }
        names:
            - Oro\Bundle\PlatformBundle\Validator\Constraints\ValidLoadedItems: ~
            - Oro\Bundle\LocaleBundle\Validator\Constraints\NotBlankDefaultLocalizedFallbackValue:
                  errorMessage: 'oro.product.names.default.blank'
        shortDescriptions:
            - Oro\Bundle\PlatformBundle\Validator\Constraints\ValidLoadedItems: ~
        descriptions:
            - Oro\Bundle\PlatformBundle\Validator\Constraints\ValidLoadedItems: ~
        inventory_status:
            - NotBlank: ~
        variantLinks:
            - Oro\Bundle\PlatformBundle\Validator\Constraints\ValidLoadedItems: ~
            - Oro\Bundle\ProductBundle\Validator\Constraints\ProductVariantLinkCollection: ~
        kitItems:
            - Oro\Bundle\PlatformBundle\Validator\Constraints\ValidLoadedItems:
                groups: [ Default, Import ]
        images:
            - Oro\Bundle\PlatformBundle\Validator\Constraints\ValidLoadedItems: ~
            - Oro\Bundle\ProductBundle\Validator\Constraints\ProductImageCollection: ~
        attributeFamily:
            - NotBlank: ~
        slugPrototypes:
            - Oro\Bundle\PlatformBundle\Validator\Constraints\ValidLoadedItems: ~
        pageTemplate:
            - Oro\Bundle\ProductBundle\Validator\Constraints\ProductPageTemplate:
                route: 'oro_product_frontend_product_view'

Oro\Bundle\ProductBundle\Entity\ProductName:
    properties:
        fallback:
            - Length:
                  max: 64
            - Choice: { callback: getFallbacks }
        string:
            - Length:
                  max: 255

Oro\Bundle\ProductBundle\Entity\ProductShortDescription:
    properties:
        fallback:
            - Length:
                  max: 64
            - Choice: { callback: getFallbacks }

Oro\Bundle\ProductBundle\Entity\ProductDescription:
    properties:
        fallback:
            - Length:
                  max: 64
            - Choice: { callback: getFallbacks }
        wysiwyg:
            - Oro\Bundle\CMSBundle\Validator\Constraints\TwigContent: ~
            - Oro\Bundle\CMSBundle\Validator\Constraints\WYSIWYG: ~
        wysiwygStyle:
            - Oro\Bundle\CMSBundle\Validator\Constraints\TwigContent: ~
            - Oro\Bundle\CMSBundle\Validator\Constraints\WYSIWYGStyle: ~

Oro\Bundle\ProductBundle\Entity\ProductUnit:
    properties:
        code:
            - NotBlank: ~
            - Length:
                max: 255
        defaultPrecision:
            - NotBlank: ~
            - Range:
                min: 0
                max: 10
            - Oro\Bundle\ValidationBundle\Validator\Constraints\Integer: ~

Oro\Bundle\ProductBundle\Entity\ProductVariantLink:
    constraints:
        - Oro\Bundle\ProductBundle\Validator\Constraints\ProductVariantLinks:
            groups: [ api ]
            property: parentProduct
        - Oro\Bundle\ProductBundle\Validator\Constraints\UniqueProductVariantLinks:
            groups: [ api ]
            property: parentProduct
    properties:
        visible:
            - Type:
                type: boolean
        parentProduct:
            - NotBlank: ~
            - Oro\Bundle\FormBundle\Validator\Constraints\UnchangeableField:
                groups: [ api ]
        product:
            - NotBlank: ~

Oro\Bundle\ProductBundle\Entity\ProductUnitPrecision:
    constraints:
        - Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity:
            fields: [ product, unit ]
        - Oro\Bundle\ProductBundle\Validator\Constraints\ProductUnitPrecisionReferencedByProductKitItems: ~
    properties:
        unit:
            - NotBlank:
                message: 'oro.product.productunit.unit.blank'
        precision:
            - NotBlank:
                message: 'oro.product.productunit.precision.blank'
            - Range:
                min: 0
                max: 10
            - Oro\Bundle\ValidationBundle\Validator\Constraints\Integer: ~
        conversionRate:
            - Oro\Bundle\ValidationBundle\Validator\Constraints\Decimal: ~

Oro\Bundle\ProductBundle\Entity\ProductImage:
    properties:
        product:
            - NotBlank: ~
        types:
            - Valid: ~
            - Oro\Bundle\ProductBundle\Validator\Constraints\ProductImageTypeCollection: ~

Oro\Bundle\ProductBundle\Entity\ProductImageType:
    constraints:
        - Oro\Bundle\ProductBundle\Validator\Constraints\ProductImageType: ~
    properties:
        type:
            - NotBlank: ~

Oro\Bundle\ProductBundle\Model\ProductLineItem:
    constraints:
        - Oro\Bundle\ProductBundle\Validator\Constraints\QuantityUnitPrecision:
            path: quantity
            groups: [create, update, add_product]
    properties:
        product:
            - NotBlank:
                groups: [create, update, add_product]
        quantity:
            - Oro\Bundle\ValidationBundle\Validator\Constraints\Decimal:
                groups: [create, update, add_product]
            - Oro\Bundle\ValidationBundle\Validator\Constraints\GreaterThanZero:
                value: 0
                message: oro.product.productlineitem.quantity.greaterThanZero
                groups: [create, update, add_product]
            - NotBlank:
                groups: [create, update, add_product]
        unit:
            - NotBlank:
                groups: [create, update, add_product]

Oro\Bundle\EntityConfigBundle\Attribute\Entity\AttributeFamily:
    constraints:
        - Oro\Bundle\ProductBundle\Validator\Constraints\AttributeFamilyUsageInVariantField: ~

Oro\Bundle\ProductBundle\Model\QuickAddRow:
    group_sequence:
        - QuickAddRow
        - ProductUnit
        - QuantityUnitPrecision
    constraints:
        - Oro\Bundle\ProductBundle\Validator\Constraints\ProductUnitExists:
            sell: true
            message: oro.product.frontend.quick_add.validation.invalid_unit
            path: 'unit'
            groups: [ProductUnit]
        - Oro\Bundle\ProductBundle\Validator\Constraints\QuantityUnitPrecision:
            message: oro.product.frontend.quick_add.validation.invalid_precision
            path: 'quantity'
            groups: [QuantityUnitPrecision]
    properties:
        product:
            - NotNull:
                message: oro.product.frontend.quick_add.validation.product_not_found
        quantity:
            - NotBlank: ~
            - Range:
                min: 0
                max: 999999999
                minMessage: oro.product.frontend.quick_add.validation.quantity_min
                maxMessage: oro.product.frontend.quick_add.validation.quantity_max
            - Oro\Bundle\ValidationBundle\Validator\Constraints\GreaterThanZero:
                  message: oro.product.frontend.quick_add.validation.quantity_min
        unit:
            - NotBlank:
                message: oro.product.frontend.quick_add.validation.unit_not_blank

Oro\Bundle\ProductBundle\Entity\Brand:
    properties:
        names:
            - Valid: ~
        shortDescriptions:
            - Valid: ~
        descriptions:
            - Valid: ~
        slugPrototypes:
            - Valid: ~

Oro\Bundle\ProductBundle\Entity\ProductKitItem:
    constraints:
        - Oro\Bundle\ProductBundle\Validator\Constraints\OnlySimpleProductsInProductKitItemProductsCollection: ~
        - Oro\Bundle\ProductBundle\Validator\Constraints\ProductKitItemUnitAvailableForSpecifiedProducts: ~
        - Oro\Bundle\ProductBundle\Validator\Constraints\ProductKitItemQuantityPrecision: ~
    properties:
        labels:
            - Valid:
                  groups: [ Default, Import ]
            - Count:
                  min: 1
        productKit:
            - NotNull: ~
            - Oro\Bundle\FormBundle\Validator\Constraints\UnchangeableField:
                  groups: [api]
            - Oro\Bundle\ProductBundle\Validator\Constraints\ProductType:
                  allowedTypes: [kit]
        kitItemProducts:
            - Valid: ~
            - Count:
                min: 1
                minMessage: oro.product.productkititem.products.not_empty
        minimumQuantity:
            - Type: [float, null]
            - Range:
                  min: 0
        maximumQuantity:
            - Type: [float, null]
            - Range:
                  min: 0
        productUnit:
            - NotNull:
                message: oro.product.productkititem.product_unit.not_empty
        optional:
            - Type: bool
        sortOrder:
            - Type: integer
            - Range:
                  # Minimum of 4-byte integer value.
                  min: -2147483648
                  # Maximum of 4-byte integer value.
                  max: 2147483647

Oro\Bundle\ProductBundle\Entity\ProductKitItemLabel:
    properties:
        fallback:
            - Length:
                  max: 64
            - Choice: { callback: getFallbacks }
        string:
            - NotBlank:
                  groups: [ Import ]
            - Length:
                  max: 255
        kitItem:
            - NotNull: ~
            - Oro\Bundle\FormBundle\Validator\Constraints\UnchangeableField:
                  groups: [api]
        localization:
            - Oro\Bundle\FormBundle\Validator\Constraints\UnchangeableField:
                  groups: [api]

Oro\Bundle\ProductBundle\Entity\ProductKitItemProduct:
    properties:
        sortOrder:
            - Type: integer
            - Range:
                  # Minimum of 4-byte integer value.
                  min: -2147483648
                  # Maximum of 4-byte integer value.
                  max: 2147483647
        kitItem:
            - NotNull: ~
        product:
            - NotNull: ~

Oro\Bundle\ProductBundle\Model\ProductLineItemsHolderDTO:
    properties:
        lineItems:
            - Valid: ~

Oro\Bundle\WebsiteSearchTermBundle\Entity\SearchTerm:
    properties:
        productCollectionSegment:
            -   Oro\Bundle\PlatformBundle\Validator\Constraints\When:
                    expression: 'this.getModifyActionType() == "product_collection"'
                    constraints:
                        -   NotBlank: ~
                    groups:
                        # Used in \Oro\Bundle\WebsiteSearchTermBundle\Controller\SearchTermController
                        - website_search_term_create
                        # Used in \Oro\Bundle\WebsiteSearchTermBundle\Controller\SearchTermController
                        - website_search_term_update
        redirectProduct:
            -   Oro\Bundle\PlatformBundle\Validator\Constraints\When:
                    expression: 'this.getRedirectActionType() == "product"'
                    constraints:
                        -   NotBlank: ~
                    groups:
                        # Used in \Oro\Bundle\WebsiteSearchTermBundle\Controller\SearchTermController
                        - website_search_term_create
                        # Used in \Oro\Bundle\WebsiteSearchTermBundle\Controller\SearchTermController
                        - website_search_term_update
