<?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\Bundle\CartBundle\Model\Cart">
        <property name="items">
            <constraint name="Valid" />
        </property>
    </class>
    <class name="Sylius\Bundle\CartBundle\Model\CartItem">
        <property name="quantity">
            <constraint name="NotBlank" />
            <constraint name="Type">
                <option name="type">integer</option>
            </constraint>
            <constraint name="Min">
                <option name="limit">1</option>
            </constraint>
        </property>
    </class>

</constraint-mapping>

<?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\Bundle\CartBundle\Model\Cart">
        <property name="items">
            <constraint name="Valid" />
        </property>
    </class>
    <class name="Sylius\Bundle\CartBundle\Model\CartItem">
        <property name="quantity">
            <constraint name="NotBlank" />
            <constraint name="Type">
                <option name="type">integer</option>
            </constraint>
            <constraint name="Range">
                <option name="min">1</option>
            </constraint>
        </property>
    </class>

</constraint-mapping>

Move to Min validator to Range on CartItem Entity
Move to Min validator to Range on CartItem Entity