<?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\DataProvider\AccountResetPasswordItemDataProvider">
            <tag name="api_platform.item_data_provider" priority="10" />
        </service>

        <service id="Sylius\Bundle\ApiBundle\DataProvider\AdminResetPasswordItemDataProvider">
            <tag name="api_platform.item_data_provider" priority="10" />
        </service>

        <service id="Sylius\Bundle\ApiBundle\DataProvider\OrderItemItemDataProvider">
            <argument type="service" id="sylius.repository.order_item" />
            <argument type="service" id="Sylius\Bundle\ApiBundle\Context\UserContextInterface" />
            <tag name="api_platform.item_data_provider" priority="10" />
        </service>

        <service id="Sylius\Bundle\ApiBundle\DataProvider\OrderItemUnitItemDataProvider">
            <argument type="service" id="sylius.repository.order_item_unit" />
            <argument type="service" id="Sylius\Bundle\ApiBundle\Context\UserContextInterface" />
            <tag name="api_platform.item_data_provider" priority="10" />
        </service>

        <service id="Sylius\Bundle\ApiBundle\DataProvider\PaymentItemDataProvider">
            <argument type="service" id="sylius.repository.payment" />
            <argument type="service" id="Sylius\Bundle\ApiBundle\Context\UserContextInterface" />
            <tag name="api_platform.item_data_provider" priority="10" />
        </service>

        <service id="Sylius\Bundle\ApiBundle\DataProvider\ShipmentItemDataProvider">
            <argument type="service" id="sylius.repository.shipment" />
            <argument type="service" id="Sylius\Bundle\ApiBundle\Context\UserContextInterface" />
            <tag name="api_platform.item_data_provider" priority="10" />
        </service>

        <service id="Sylius\Bundle\ApiBundle\DataProvider\ProductItemDataProvider">
            <argument type="service" id="sylius.repository.product" />
            <argument type="service" id="Sylius\Bundle\ApiBundle\Context\UserContextInterface" />
            <tag name="api_platform.item_data_provider" priority="10" />
        </service>

        <service id="Sylius\Bundle\ApiBundle\DataProvider\ProductAttributesSubresourceDataProvider">
            <argument type="tagged_iterator" tag="api_platform.doctrine.orm.query_extension.collection" />
            <argument type="service" id="sylius.repository.product_attribute_value" />
            <argument type="service" id="sylius.context.locale" />
            <argument type="service" id="sylius.locale_provider.channel_based" />
            <argument>%locale%</argument>
            <tag name="api_platform.subresource_data_provider" priority="10" />
        </service>

        <service id="Sylius\Bundle\ApiBundle\DataProvider\CustomerItemDataProvider">
            <argument type="service" id="Sylius\Bundle\ApiBundle\Context\UserContextInterface" />
            <argument type="service" id="sylius.repository.customer" />
            <tag name="api_platform.item_data_provider" priority="10" />
        </service>

        <service id="Sylius\Bundle\ApiBundle\DataProvider\ShippingMethodsCollectionDataProvider">
            <argument type="service" id="sylius.repository.shipment" />
            <argument type="service" id="sylius.repository.shipping_method" />
            <argument type="service" id="sylius.shipping_methods_resolver" />
            <argument type="service" id="Sylius\Component\Channel\Context\ChannelContextInterface" />
            <tag name="api_platform.collection_data_provider" priority="10" />
        </service>

        <service id="Sylius\Bundle\ApiBundle\DataProvider\PaymentMethodsCollectionDataProvider">
            <argument type="service" id="sylius.repository.order" />
            <argument type="service" id="sylius.repository.payment_method" />
            <argument type="service" id="sylius.repository.payment" />
            <argument type="service" id="Sylius\Component\Channel\Context\ChannelContextInterface" />
            <argument type="service" id="sylius.payment_methods_resolver" />
            <tag name="api_platform.collection_data_provider" priority="10" />
        </service>

        <service id="Sylius\Bundle\ApiBundle\DataProvider\ChannelsCollectionDataProvider">
            <argument type="service" id="sylius.context.channel" />
            <tag name="api_platform.collection_data_provider" priority="10" />
        </service>

        <service id="Sylius\Bundle\ApiBundle\DataProvider\OrderAdjustmentsSubresourceDataProvider">
            <argument type="service" id="sylius.repository.order" />
            <tag name="api_platform.subresource_data_provider" priority="10" />
        </service>

        <service id="Sylius\Bundle\ApiBundle\DataProvider\OrderItemAdjustmentsSubresourceDataProvider">
            <argument type="service" id="sylius.repository.order_item" />
            <tag name="api_platform.subresource_data_provider" priority="10" />
        </service>

        <service id="Sylius\Bundle\ApiBundle\Context\UserContextInterface" class="Sylius\Bundle\ApiBundle\Context\TokenBasedUserContext">
            <argument type="service" id="security.token_storage" />
        </service>

        <service id="Sylius\Bundle\ApiBundle\DataProvider\VerifyCustomerAccountItemDataProvider">
            <tag name="api_platform.item_data_provider" priority="10" />
        </service>

        <service id="Sylius\Bundle\ApiBundle\DataProvider\AdminOrderItemAdjustmentsSubresourceDataProvider">
            <argument type="service" id="sylius.repository.order_item" />
            <argument type="service" id="sylius.section_resolver.uri_based_section_resolver" />
            <tag name="api_platform.subresource_data_provider" priority="10" />
        </service>
    </services>
</container>
