<?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\AdminUser">
        <constraint name="Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity">
            <option name="fields">email</option>
            <option name="message">sylius.user.email.unique</option>
            <option name="groups">sylius</option>
        </constraint>
        <constraint name="Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity">
            <option name="fields">username</option>
            <option name="message">sylius.user.username.unique</option>
            <option name="groups">sylius</option>
        </constraint>
        <property name="email">
            <constraint name="NotBlank">
                <option name="message">sylius.user.email.not_blank</option>
                <option name="groups">sylius</option>
            </constraint>
            <constraint name="Email">
                <option name="message">sylius.user.email.invalid</option>
                <option name="mode">strict</option>
                <option name="groups">sylius</option>
            </constraint>
        </property>
        <property name="username">
            <constraint name="NotBlank">
                <option name="message">sylius.user.username.not_blank</option>
                <option name="groups">sylius</option>
            </constraint>
            <constraint name="Length">
                <option name="max">255</option>
                <option name="maxMessage">sylius.user.username.max</option>
                <option name="groups">sylius</option>
            </constraint>
        </property>
        <property name="firstName">
            <constraint name="Length">
                <option name="max">255</option>
                <option name="maxMessage">sylius.user.first_name.max</option>
                <option name="groups">sylius</option>
            </constraint>
        </property>
        <property name="lastName">
            <constraint name="Length">
                <option name="max">255</option>
                <option name="maxMessage">sylius.user.last_name.max</option>
                <option name="groups">sylius</option>
            </constraint>
        </property>
        <property name="localeCode">
            <constraint name="NotBlank">
                <option name="message">sylius.user.locale_code.not_blank</option>
                <option name="groups">sylius</option>
            </constraint>
            <constraint name="Locale">
                <option name="groups">sylius</option>
            </constraint>
        </property>
    </class>
</constraint-mapping>
