<?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="false" />

        <service id="Sylius\Bundle\ApiBundle\OpenApi\Factory\OpenApiFactory" decorates="api_platform.openapi.factory">
            <argument type="service" id="Sylius\Bundle\ApiBundle\OpenApi\Factory\OpenApiFactory.inner" />
            <argument type="tagged_iterator" tag="sylius.open_api.modifier" />
        </service>

        <service id="Sylius\Bundle\ApiBundle\OpenApi\Documentation\AcceptLanguageHeaderDocumentationModifier">
            <argument type="service" id="sylius.repository.locale" />
            <tag name="sylius.open_api.modifier" />
        </service>

        <service id="Sylius\Bundle\ApiBundle\OpenApi\Documentation\AdministratorDocumentationModifier">
            <argument>%sylius.security.new_api_route%</argument>
            <tag name="sylius.open_api.modifier" />
        </service>

        <service id="Sylius\Bundle\ApiBundle\OpenApi\Documentation\PathHiderDocumentationModifier">
            <argument>%sylius.api.paths_to_hide%</argument>
            <tag name="sylius.open_api.modifier" />
        </service>

        <service id="Sylius\Bundle\ApiBundle\OpenApi\Documentation\AttributeTypeDocumentationModifier">
            <argument type="service" id="sylius.registry.attribute_type" />
            <tag name="sylius.open_api.modifier" />
        </service>

        <service id="Sylius\Bundle\ApiBundle\OpenApi\Documentation\ProductDocumentationModifier">
            <tag name="sylius.open_api.modifier" />
        </service>

        <service id="Sylius\Bundle\ApiBundle\OpenApi\Documentation\ImageDocumentationModifier">
            <argument type="service" id="Sylius\Bundle\ApiBundle\Provider\ImageFiltersProviderInterface" />
            <tag name="sylius.open_api.modifier" />
        </service>

        <service id="Sylius\Bundle\ApiBundle\OpenApi\Documentation\ProductReviewDocumentationModifier">
            <argument>%sylius.security.new_api_route%</argument>
            <tag name="sylius.open_api.modifier" />
        </service>

        <service id="Sylius\Bundle\ApiBundle\OpenApi\Documentation\ProductSlugDocumentationModifier">
            <argument>%sylius.security.new_api_route%</argument>
            <tag name="sylius.open_api.modifier" />
        </service>

        <service id="Sylius\Bundle\ApiBundle\OpenApi\Documentation\ProductVariantDocumentationModifier">
            <tag name="sylius.open_api.modifier" />
        </service>

        <service id="Sylius\Bundle\ApiBundle\OpenApi\Documentation\ShippingMethodDocumentationModifier">
            <argument>%sylius.security.new_api_route%</argument>
            <argument>%sylius.shipping_method_rules%</argument>
            <argument>%sylius.shipping_calculators%</argument>
            <tag name="sylius.open_api.modifier" />
        </service>

        <service id="Sylius\Bundle\ApiBundle\OpenApi\Documentation\CustomerDocumentationModifier">
            <argument>%sylius.security.new_api_route%</argument>
            <tag name="sylius.open_api.modifier" />
        </service>

        <service id="Sylius\Bundle\ApiBundle\OpenApi\Documentation\StatisticsDocumentationModifier">
            <argument>%sylius.security.new_api_route%</argument>
            <argument type="service" id="Sylius\Calendar\Provider\DateTimeProviderInterface" />
            <argument>%sylius_core.orders_statistics.intervals_map%</argument>
            <tag name="sylius.open_api.modifier" />
        </service>

        <service id="Sylius\Bundle\ApiBundle\OpenApi\Documentation\PromotionDocumentationModifier">
            <argument>%sylius.security.new_api_route%</argument>
            <argument>%sylius.promotion_actions%</argument>
            <argument>%sylius.promotion_rules%</argument>
            <tag name="sylius.open_api.modifier" />
        </service>

        <service id="Sylius\Bundle\ApiBundle\OpenApi\Documentation\OrderAdjustmentsTypeDocumentationModifier">
            <argument>%sylius.security.new_api_route%</argument>
            <argument>%sylius.model.adjustment.class%</argument>
            <tag name="sylius.open_api.modifier" />
        </service>

        <service id="Sylius\Bundle\ApiBundle\OpenApi\Documentation\AddressLogEntryDocumentationModifier">
            <tag name="sylius.open_api.modifier" />
        </service>
    </services>
</container>
