<?xml version="1.0" encoding="UTF-8"?>

<!--

 This file is part of the Sylius package.

 (c) Sylius Sp. z o.o.

 For the full copyright and license information, please view the LICENSE
 file that was distributed with this source code.

-->

<constraint-mapping xmlns="http://symfony.com/schema/dic/constraint-mapping" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://symfony.com/schema/dic/constraint-mapping http://symfony.com/schema/dic/services/constraint-mapping-1.0.xsd">
    <class name="Sylius\Component\Core\Model\ChannelPricing">
        <constraint name="Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity">
            <option name="fields">
                <value>channelCode</value>
                <value>productVariant</value>
            </option>
            <option name="groups">sylius</option>
            <option name="message">sylius.channel_pricing.channel_code.unique</option>
        </constraint>
        <property name="price">
            <constraint name="Range">
                <option name="min">0</option>
                <option name="minMessage">sylius.channel_pricing.price.min</option>
                <option name="groups">sylius</option>
            </constraint>
            <constraint name="Sylius\Bundle\CoreBundle\Validator\Constraints\MaxInteger">
                <option name="groups">sylius</option>
            </constraint>
        </property>
        <property name="originalPrice">
            <constraint name="Range">
                <option name="min">0</option>
                <option name="minMessage">sylius.channel_pricing.price.min</option>
                <option name="groups">sylius</option>
            </constraint>
            <constraint name="Sylius\Bundle\CoreBundle\Validator\Constraints\MaxInteger">
                <option name="groups">sylius</option>
            </constraint>
        </property>
        <property name="minimumPrice">
            <constraint name="Range">
                <option name="min">0</option>
                <option name="minMessage">sylius.channel_pricing.price.min</option>
                <option name="groups">sylius</option>
            </constraint>
            <constraint name="Sylius\Bundle\CoreBundle\Validator\Constraints\MaxInteger">
                <option name="groups">sylius</option>
            </constraint>
        </property>
        <property name="channelCode">
            <constraint name="NotBlank">
                <option name="message">sylius.channel_pricing.channel_code.not_blank</option>
                <option name="groups">sylius</option>
            </constraint>
            <constraint name="Sylius\Bundle\CoreBundle\Validator\Constraints\ExistingChannelCode">
                <option name="groups">sylius</option>
            </constraint>
        </property>
    </class>
</constraint-mapping>
