<?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\Order">
        <constraint name="Sylius\Bundle\PromotionBundle\Validator\Constraints\PromotionSubjectCoupon">
            <option name="groups">sylius_promotion_coupon</option>
        </constraint>
        <constraint name="Sylius\Bundle\CoreBundle\Validator\Constraints\OrderShippingMethodEligibility">
            <option name="message">sylius.order.shipping_method_eligibility</option>
            <option name="groups">
                <value>sylius_checkout_complete</value>
            </option>
        </constraint>
        <constraint name="Sylius\Bundle\CoreBundle\Validator\Constraints\OrderPaymentMethodEligibility">
            <option name="message">sylius.order.payment_method_eligibility</option>
            <option name="groups">
                <value>sylius_checkout_complete</value>
            </option>
        </constraint>
        <constraint name="Sylius\Bundle\CoreBundle\Validator\Constraints\OrderProductEligibility">
            <option name="message">sylius.order.product_eligibility</option>
            <option name="groups">
                <value>sylius_checkout_complete</value>
            </option>
        </constraint>

        <property name="shippingAddress">
            <constraint name="Valid" />
        </property>
        <property name="billingAddress">
            <constraint name="Valid" />
        </property>
        <property name="shipments">
            <constraint name="Valid" />
        </property>
        <property name="payments">
            <constraint name="Valid" />
        </property>
        <property name="currencyCode">
            <constraint name="Currency">
                <option name="message">sylius.order.currency_code.not_valid</option>
                <option name="groups">sylius</option>
            </constraint>
        </property>
        <property name="promotionCoupon">
            <constraint name="NotNull">
                <option name="message">sylius.promotion_coupon.is_invalid</option>
                <option name="groups">sylius_promotion_coupon</option>
            </constraint>
        </property>
    </class>
</constraint-mapping>
