<?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">
    <imports>
        <import resource="services/**/*.xml" />
    </imports>

    <services>
        <defaults public="true" />

        <service id="sylius.controller.product_slug" class="Sylius\Bundle\ProductBundle\Controller\ProductSlugController">
            <argument type="service" id="sylius.generator.slug" />
            <call method="setContainer">
                <argument type="service" id="service_container" />
            </call>
        </service>

        <service id="sylius.custom_factory.product_variant" class="Sylius\Component\Product\Factory\ProductVariantFactory" decorates="sylius.factory.product_variant" decoration-priority="256" public="false">
            <argument type="service" id="sylius.custom_factory.product_variant.inner" />
        </service>
        <service id="Sylius\Component\Product\Factory\ProductVariantFactoryInterface" alias="sylius.factory.product_variant" />

        <service id="sylius.custom_factory.product" class="Sylius\Component\Product\Factory\ProductFactory" decorates="sylius.factory.product" decoration-priority="256" public="false">
            <argument type="service" id="sylius.custom_factory.product.inner" />
            <argument type="service" id="sylius.factory.product_variant" />
        </service>
        <service id="Sylius\Component\Product\Factory\ProductFactoryInterface" alias="sylius.factory.product" />

        <service id="sylius.generator.product_variant" class="Sylius\Component\Product\Generator\ProductVariantGenerator">
            <argument type="service" id="sylius.factory.product_variant" />
            <argument type="service" id="sylius.checker.product_variants_parity" />
        </service>
        <service id="Sylius\Component\Product\Generator\ProductVariantGeneratorInterface" alias="sylius.generator.product_variant" />

        <service id="sylius.checker.product_variants_parity" class="Sylius\Component\Product\Checker\ProductVariantsParityChecker" />
        <service id="Sylius\Component\Product\Checker\ProductVariantsParityCheckerInterface" alias="sylius.checker.product_variants_parity" />

        <service id="sylius.generator.slug" class="Sylius\Component\Product\Generator\SlugGenerator" />
        <service id="Sylius\Component\Product\Generator\SlugGeneratorInterface" alias="sylius.generator.slug" />

        <service id="Sylius\Component\Product\Resolver\ProductVariantResolverInterface" class="Sylius\Component\Product\Resolver\CompositeProductVariantResolver">
            <argument type="tagged_iterator" tag="sylius.product_variant_resolver" />
        </service>

        <service id="sylius.product_variant_resolver.default" class="Sylius\Component\Product\Resolver\DefaultProductVariantResolver">
            <argument type="service" id="sylius.repository.product_variant" />
            <tag name="sylius.product_variant_resolver" priority="-999" />
        </service>

        <service id="sylius.listener.select_product_attribute_choice_remove" class="Sylius\Bundle\ProductBundle\EventListener\SelectProductAttributeChoiceRemoveListener">
            <argument>%sylius.model.product_attribute_value.class%</argument>
            <tag name="doctrine.event_listener" event="postUpdate" lazy="true" />
        </service>

        <service id="sylius.available_product_option_values_resolver" class="Sylius\Component\Product\Resolver\AvailableProductOptionValuesResolver" />
        <service id="Sylius\Component\Product\Resolver\AvailableProductOptionValuesResolverInterface" alias="sylius.available_product_option_values_resolver" />
    </services>
</container>
