<?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.

-->

<container xmlns="http://symfony.com/schema/dic/services"
           xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
           xsi:schemaLocation="http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd"
>
    <services>
        <defaults public="true" />

        <service id="Sylius\Bundle\ApiBundle\Validator\Constraints\UniqueShopUserEmailValidator">
            <argument type="service" id="sylius.canonicalizer" />
            <argument type="service" id="sylius.repository.shop_user" />
            <tag name="validator.constraint_validator" alias="sylius_validator_unique_shop_user_email" />
        </service>

        <service id="Sylius\Bundle\ApiBundle\Validator\Constraints\OrderNotEmptyValidator" class="Sylius\Bundle\ApiBundle\Validator\Constraints\OrderNotEmptyValidator">
            <argument type="service" id="sylius.repository.order" />
            <tag name="validator.constraint_validator" alias="sylius_api_validator_order_not_empty" />
        </service>

        <service id="Sylius\Bundle\ApiBundle\Validator\Constraints\OrderProductEligibilityValidator">
            <argument type="service" id="sylius.repository.order" />
            <tag name="validator.constraint_validator" alias="sylius_api_validator_order_product_eligibility" />
        </service>

        <service id="Sylius\Bundle\ApiBundle\Validator\Constraints\OrderItemAvailabilityValidator">
            <argument type="service" id="sylius.repository.order" />
            <argument type="service" id="sylius.availability_checker" />
            <tag name="validator.constraint_validator" alias="sylius_api_validator_order_item_availability" />
        </service>

        <service id="Sylius\Bundle\ApiBundle\Validator\Constraints\OrderShippingMethodEligibilityValidator">
            <argument type="service" id="sylius.repository.order" />
            <argument type="service" id="sylius.shipping_method_eligibility_checker" />
            <tag name="validator.constraint_validator" alias="sylius_api_validator_order_shipping_method_eligibility" />
        </service>

        <service id="Sylius\Bundle\ApiBundle\Validator\Constraints\CheckoutCompletionValidator">
            <argument type="service" id="sylius.repository.order" />
            <argument type="service" id="sylius_abstraction.state_machine" />
            <tag name="validator.constraint_validator" alias="sylius_api_validator_checkout_completion" />
        </service>

        <service id="Sylius\Bundle\ApiBundle\Validator\Constraints\ChosenShippingMethodEligibilityValidator">
            <argument type="service" id="sylius.repository.shipment" />
            <argument type="service" id="sylius.repository.shipping_method" />
            <argument type="service" id="sylius.shipping_methods_resolver" />
            <tag name="validator.constraint_validator" alias="sylius_api_validator_chosen_shipping_method_eligibility" />
        </service>

        <service id="Sylius\Bundle\ApiBundle\Validator\Constraints\AddingEligibleProductVariantToCartValidator">
            <argument type="service" id="sylius.repository.product_variant" />
            <argument type="service" id="sylius.repository.order" />
            <argument type="service" id="sylius.availability_checker" />
            <tag name="validator.constraint_validator" alias="sylius_api_validator_adding_eligible_product_variant_to_cart" />
        </service>

        <service id="Sylius\Bundle\ApiBundle\Validator\Constraints\ChangedItemQuantityInCartValidator">
            <argument type="service" id="sylius.repository.order_item" />
            <argument type="service" id="sylius.repository.order" />
            <argument type="service" id="sylius.availability_checker" />
            <tag name="validator.constraint_validator" alias="sylius_api_validator_changed_item_quantity_in_cart" />
        </service>

        <service id="Sylius\Bundle\ApiBundle\Validator\Constraints\CorrectOrderAddressValidator">
            <argument type="service" id="sylius.repository.country" />
            <tag name="validator.constraint_validator" alias="sylius_api_validator_correct_order_address" />
        </service>

        <service id="Sylius\Bundle\ApiBundle\Validator\Constraints\OrderPaymentMethodEligibilityValidator">
            <argument type="service" id="sylius.repository.order" />
            <tag name="validator.constraint_validator" alias="sylius_api_order_payment_method_eligibility" />
        </service>

        <service id="Sylius\Bundle\ApiBundle\Validator\Constraints\ChosenPaymentMethodEligibilityValidator">
            <argument type="service" id="sylius.repository.payment" />
            <argument type="service" id="sylius.repository.payment_method" />
            <argument type="service" id="sylius.payment_methods_resolver" />
            <tag name="validator.constraint_validator" alias="sylius_api_chosen_payment_method_eligibility" />
        </service>

        <service id="Sylius\Bundle\ApiBundle\Validator\Constraints\CanPaymentMethodBeChangedValidator">
            <argument type="service" id="sylius.repository.order" />
            <tag name="validator.constraint_validator" alias="sylius_api_validator_can_payment_method_be_changed" />
        </service>

        <service id="Sylius\Bundle\ApiBundle\Validator\Constraints\CorrectChangeShopUserConfirmPasswordValidator">
            <tag name="validator.constraint_validator" alias="sylius_api_correct_change_shop_user_confirm_password" />
        </service>

        <service id="Sylius\Bundle\ApiBundle\Validator\Constraints\ConfirmResetPasswordValidator">
            <tag name="validator.constraint_validator" alias="sylius_api_confirm_reset_password" />
        </service>

        <service id="Sylius\Bundle\ApiBundle\Validator\Constraints\PromotionCouponEligibilityValidator">
            <argument type="service" id="sylius.repository.promotion_coupon" />
            <argument type="service" id="sylius.repository.order" />
            <argument type="service" id="Sylius\Bundle\ApiBundle\Checker\AppliedCouponEligibilityCheckerInterface" />
            <tag name="validator.constraint_validator" alias="sylius_api_promotion_coupon_eligibility" />
        </service>

        <service id="Sylius\Bundle\ApiBundle\Validator\Constraints\ShipmentAlreadyShippedValidator">
            <argument type="service" id="sylius.repository.shipment" />
            <tag name="validator.constraint_validator" alias="sylius_api_shipment_already_shipped" />
        </service>

        <service id="Sylius\Bundle\ApiBundle\Validator\Constraints\ShopUserResetPasswordTokenExistsValidator">
            <argument type="service" id="sylius.repository.shop_user" />
            <tag name="validator.constraint_validator" alias="sylius_api_shop_user_reset_password_token_exists" />
        </service>

        <service id="Sylius\Bundle\ApiBundle\Validator\Constraints\ShopUserResetPasswordTokenNotExpiredValidator">
            <argument type="service" id="sylius.repository.shop_user" />
            <argument type="string">%sylius.shop_user.token.password_reset.ttl%</argument>
            <tag name="validator.constraint_validator" alias="sylius_api_shop_user_reset_password_token_not_expired" />
        </service>

        <service id="Sylius\Bundle\ApiBundle\Validator\Constraints\ShopUserNotVerifiedValidator">
            <argument type="service" id="sylius.repository.shop_user" />
            <tag name="validator.constraint_validator" alias="sylius_api_shop_user_not_verified" />
        </service>

        <service id="Sylius\Bundle\ApiBundle\Validator\Constraints\SingleValueForProductVariantOptionValidator">
            <tag name="validator.constraint_validator" alias="sylius_api_validator_single_value_for_product_variant_option" />
        </service>

        <service id="Sylius\Bundle\ApiBundle\Validator\Constraints\AccountVerificationTokenEligibilityValidator">
            <argument type="service" id="sylius.repository.shop_user" />
            <tag name="validator.constraint_validator" alias="sylius_api_validator_account_verification_token_eligibility" />
        </service>

        <service id="Sylius\Bundle\ApiBundle\Validator\Constraints\UniqueReviewerEmailValidator">
            <argument type="service" id="sylius.repository.shop_user" />
            <argument type="service" id="Sylius\Bundle\ApiBundle\Context\UserContextInterface" />
            <tag name="validator.constraint_validator" alias="sylius_api_unique_reviewer_email_validator" />
        </service>

        <service id="Sylius\Bundle\ApiBundle\Validator\Constraints\AdminResetPasswordTokenNonExpiredValidator">
            <argument type="service" id="sylius.repository.admin_user" />
            <argument type="string">%sylius.admin_user.token.password_reset.ttl%</argument>
            <tag name="validator.constraint_validator" alias="sylius_api_validator_admin_non_expired_password_reset_token" />
        </service>

        <service id="Sylius\Bundle\ApiBundle\Validator\CatalogPromotion\PercentageDiscountActionValidator">
            <argument type="service" id="Sylius\Bundle\CoreBundle\SectionResolver\SectionProviderInterface" />
            <tag name="sylius.catalog_promotion.action_validator" key="percentage_discount"/>
        </service>

        <service
            id="Sylius\Bundle\ApiBundle\Validator\CatalogPromotion\FixedDiscountActionValidator"
            decorates="Sylius\Bundle\CoreBundle\CatalogPromotion\Validator\CatalogPromotionAction\FixedDiscountActionValidator"
        >
            <argument type="service" id="Sylius\Bundle\ApiBundle\Validator\CatalogPromotion\FixedDiscountActionValidator.inner" />
            <argument type="service" id="Sylius\Bundle\CoreBundle\SectionResolver\SectionProviderInterface" />
        </service>

        <service
            id="Sylius\Bundle\ApiBundle\Validator\CatalogPromotion\ForProductsScopeValidator"
            decorates="Sylius\Bundle\CoreBundle\CatalogPromotion\Validator\CatalogPromotionScope\ForProductsScopeValidator"
        >
            <argument type="service" id="Sylius\Bundle\ApiBundle\Validator\CatalogPromotion\ForProductsScopeValidator.inner" />
            <argument type="service" id="Sylius\Bundle\CoreBundle\SectionResolver\SectionProviderInterface" />
        </service>

        <service
            id="Sylius\Bundle\ApiBundle\Validator\CatalogPromotion\ForTaxonsScopeValidator"
            decorates="Sylius\Bundle\CoreBundle\CatalogPromotion\Validator\CatalogPromotionScope\ForTaxonsScopeValidator"
        >
            <argument type="service" id="Sylius\Bundle\ApiBundle\Validator\CatalogPromotion\ForTaxonsScopeValidator.inner" />
            <argument type="service" id="Sylius\Bundle\CoreBundle\SectionResolver\SectionProviderInterface" />
        </service>

        <service
            id="Sylius\Bundle\ApiBundle\Validator\CatalogPromotion\ForVariantsScopeValidator"
            decorates="Sylius\Bundle\CoreBundle\CatalogPromotion\Validator\CatalogPromotionScope\ForVariantsScopeValidator"
        >
            <argument type="service" id="Sylius\Bundle\ApiBundle\Validator\CatalogPromotion\ForVariantsScopeValidator.inner" />
            <argument type="service" id="Sylius\Bundle\CoreBundle\SectionResolver\SectionProviderInterface" />
        </service>

        <service id="sylius.validator.order_address_requirement" class="Sylius\Bundle\ApiBundle\Validator\Constraints\OrderAddressRequirementValidator">
            <argument type="service" id="sylius.repository.order" />
            <tag name="validator.constraint_validator" alias="sylius_order_address_requirement_validator" />
        </service>
    </services>
</container>
