<?xml version="1.0"?>

<!--

 This file is part of the Sylius package.

 (c) Paweł Jędrzejewski

 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/constraint-mapping/constraint-mapping-1.0.xsd">

    <class name="Sylius\Component\Cart\Model\Cart">
        <property name="items">
            <constraint name="Valid" />
        </property>
    </class>

    <class name="Sylius\Component\Cart\Model\CartItem">
        <property name="quantity">
            <constraint name="NotBlank">
                <option name="groups">sylius</option>
            </constraint>
            <constraint name="Type">
                <option name="type">integer</option>
                <option name="groups">sylius</option>
            </constraint>
            <constraint name="Range">
                <option name="min">1</option>
                <option name="groups">sylius</option>
            </constraint>
        </property>
    </class>

</constraint-mapping>
