<?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">
    <parameters>
        <parameter key="sylius.form.type.product_association.validation_groups" type="collection">
            <parameter>sylius</parameter>
        </parameter>
        <parameter key="sylius.form.type.product_association_type.validation_groups" type="collection">
            <parameter>sylius</parameter>
        </parameter>
        <parameter key="sylius.form.type.product_association_type_translation.validation_groups" type="collection">
            <parameter>sylius</parameter>
        </parameter>
        <parameter key="sylius.form.type.product_attribute.validation_groups" type="collection">
            <parameter>sylius</parameter>
        </parameter>
        <parameter key="sylius.form.type.product_attribute_translation.validation_groups" type="collection">
            <parameter>sylius</parameter>
        </parameter>
        <parameter key="sylius.form.type.product_attribute_value.validation_groups" type="collection">
            <parameter>sylius</parameter>
        </parameter>
        <parameter key="sylius.form.type.product.validation_groups" type="collection">
            <parameter>sylius</parameter>
        </parameter>
        <parameter key="sylius.form.type.product_translation.validation_groups" type="collection">
            <parameter>sylius</parameter>
        </parameter>
        <parameter key="sylius.form.type.product_generate_variants.validation_groups" type="collection">
            <parameter>sylius</parameter>
        </parameter>
        <parameter key="sylius.form.type.product_option.validation_groups" type="collection">
            <parameter>sylius</parameter>
        </parameter>
        <parameter key="sylius.form.type.product_option_translation.validation_groups" type="collection">
            <parameter>sylius</parameter>
        </parameter>
        <parameter key="sylius.form.type.product_option_value.validation_groups" type="collection">
            <parameter>sylius</parameter>
        </parameter>
        <parameter key="sylius.form.type.product_option_value_translation.validation_groups" type="collection">
            <parameter>sylius</parameter>
        </parameter>
        <parameter key="sylius.form.type.product_variant.validation_groups" type="collection">
            <parameter>sylius</parameter>
        </parameter>
        <parameter key="sylius.form.type.product_variant_translation.validation_groups" type="collection">
            <parameter>sylius</parameter>
        </parameter>
        <parameter key="sylius.form.type.product_variant_generation.validation_groups" type="collection">
            <parameter>sylius</parameter>
        </parameter>
    </parameters>

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

        <service id="sylius.form.type.product_association" class="Sylius\Bundle\ProductBundle\Form\Type\ProductAssociationType">
            <argument>%sylius.model.product_association.class%</argument>
            <argument>%sylius.form.type.product_association.validation_groups%</argument>
            <tag name="form.type" />
        </service>

        <service id="sylius.form.type.product_association_type" class="Sylius\Bundle\ProductBundle\Form\Type\ProductAssociationTypeType">
            <argument>%sylius.model.product_association_type.class%</argument>
            <argument>%sylius.form.type.product_association_type.validation_groups%</argument>
            <tag name="form.type" />
        </service>

        <service id="sylius.form.type.product_association_type_translation" class="Sylius\Bundle\ProductBundle\Form\Type\ProductAssociationTypeTranslationType">
            <argument>%sylius.model.product_association_type_translation.class%</argument>
            <argument>%sylius.form.type.product_association_type_translation.validation_groups%</argument>
            <tag name="form.type" />
        </service>

        <service id="sylius.form.type.product_association_type_choice" class="Sylius\Bundle\ProductBundle\Form\Type\ProductAssociationTypeChoiceType">
            <argument type="service" id="sylius.repository.product_association_type" />
            <tag name="form.type" />
        </service>

        <service id="sylius.form.type.sylius_product_associations" class="Sylius\Bundle\ProductBundle\Form\Type\ProductAssociationsType">
            <argument type="service" id="sylius.repository.product_association_type" />
            <argument type="service" id="sylius.form.type.data_transformer.products_to_product_associations" />
            <tag name="form.type" />
        </service>

        <service id="sylius.form.type.product_attribute" class="Sylius\Bundle\ProductBundle\Form\Type\ProductAttributeType">
            <argument>%sylius.model.product_attribute.class%</argument>
            <argument>%sylius.form.type.product_attribute.validation_groups%</argument>
            <argument>Sylius\Bundle\ProductBundle\Form\Type\ProductAttributeTranslationType</argument>
            <argument type="service" id="sylius.form_registry.attribute_type" />
            <tag name="form.type" />
        </service>

        <service id="sylius.form.type.product_attribute_translation" class="Sylius\Bundle\ProductBundle\Form\Type\ProductAttributeTranslationType">
            <argument>%sylius.model.product_attribute_translation.class%</argument>
            <argument>%sylius.form.type.product_attribute_translation.validation_groups%</argument>
            <tag name="form.type" />
        </service>

        <service id="sylius.form.type.product_attribute_choice" class="Sylius\Bundle\ProductBundle\Form\Type\ProductAttributeChoiceType">
            <argument type="service" id="sylius.repository.product_attribute" />
            <tag name="form.type" />
        </service>

        <service id="sylius.form.type.product_attribute_value" class="Sylius\Bundle\ProductBundle\Form\Type\ProductAttributeValueType">
            <argument>%sylius.model.product_attribute_value.class%</argument>
            <argument>%sylius.form.type.product_attribute_value.validation_groups%</argument>
            <argument>Sylius\Bundle\ProductBundle\Form\Type\ProductAttributeChoiceType</argument>
            <argument type="service" id="sylius.repository.product_attribute" />
            <argument type="service" id="sylius.repository.locale" />
            <argument type="service" id="sylius.form_registry.attribute_type" />
            <argument type="service" id="sylius.form.data_transformer.locale_to_code" />
            <tag name="form.type" />
        </service>

        <service id="sylius.form.type.product" class="Sylius\Bundle\ProductBundle\Form\Type\ProductType">
            <argument>%sylius.model.product.class%</argument>
            <argument>%sylius.form.type.product.validation_groups%</argument>
            <argument type="service" id="Sylius\Component\Product\Resolver\ProductVariantResolverInterface" />
            <argument type="service" id="sylius.factory.product_attribute_value" />
            <argument type="service" id="sylius.translation_locale_provider" />
            <tag name="form.type" />
        </service>

        <service id="sylius.form.type.product_translation" class="Sylius\Bundle\ProductBundle\Form\Type\ProductTranslationType">
            <argument>%sylius.model.product_translation.class%</argument>
            <argument>%sylius.form.type.product_translation.validation_groups%</argument>
            <tag name="form.type" />
        </service>

        <service id="sylius.form.type.product_choice" class="Sylius\Bundle\ProductBundle\Form\Type\ProductChoiceType">
            <argument type="service" id="sylius.repository.product" />
            <tag name="form.type" />
        </service>

        <service id="sylius.form.type.product_code_choice" class="Sylius\Bundle\ProductBundle\Form\Type\ProductCodeChoiceType">
            <argument type="service" id="sylius.repository.product" />
            <tag name="form.type" />
        </service>

        <service id="sylius.form.type.product_generate_variants" class="Sylius\Bundle\ProductBundle\Form\Type\ProductGenerateVariantsType">
            <argument>%sylius.model.product.class%</argument>
            <argument>%sylius.form.type.product_generate_variants.validation_groups%</argument>
            <argument type="service" id="sylius.form.event_subscriber.product_variant_generator" />
            <tag name="form.type" />
        </service>

        <service id="sylius.form.type.product_option" class="Sylius\Bundle\ProductBundle\Form\Type\ProductOptionType">
            <argument>%sylius.model.product_option.class%</argument>
            <argument>%sylius.form.type.product_option.validation_groups%</argument>
            <tag name="form.type" />
        </service>

        <service id="sylius.form.type.product_option_translation" class="Sylius\Bundle\ProductBundle\Form\Type\ProductOptionTranslationType">
            <argument>%sylius.model.product_option_translation.class%</argument>
            <argument>%sylius.form.type.product_option_translation.validation_groups%</argument>
            <tag name="form.type" />
        </service>

        <service id="sylius.form.type.product_option_choice" class="Sylius\Bundle\ProductBundle\Form\Type\ProductOptionChoiceType">
            <argument type="service" id="sylius.repository.product_option" />
            <tag name="form.type" />
        </service>

        <service id="sylius.form.type.product_option_value" class="Sylius\Bundle\ProductBundle\Form\Type\ProductOptionValueType">
            <argument>%sylius.model.product_option_value.class%</argument>
            <argument>%sylius.form.type.product_option_value.validation_groups%</argument>
            <tag name="form.type" />
        </service>

        <service id="sylius.form.type.product_option_value_translation" class="Sylius\Bundle\ProductBundle\Form\Type\ProductOptionValueTranslationType">
            <argument>%sylius.model.product_option_value_translation.class%</argument>
            <argument>%sylius.form.type.product_option_value_translation.validation_groups%</argument>
            <tag name="form.type" />
        </service>

        <service id="sylius.form.type.product_variant" class="Sylius\Bundle\ProductBundle\Form\Type\ProductVariantType">
            <argument>%sylius.model.product_variant.class%</argument>
            <argument>%sylius.form.type.product_variant.validation_groups%</argument>
            <tag name="form.type" />
        </service>

        <service id="sylius.form.type.product_variant_translation" class="Sylius\Bundle\ProductBundle\Form\Type\ProductVariantTranslationType">
            <argument>%sylius.model.product_variant_translation.class%</argument>
            <argument>%sylius.form.type.product_variant_translation.validation_groups%</argument>
            <tag name="form.type" />
        </service>

        <service id="sylius.form.type.product_variant_generation" class="Sylius\Bundle\ProductBundle\Form\Type\ProductVariantGenerationType">
            <argument>%sylius.model.product_variant.class%</argument>
            <argument>%sylius.form.type.product_variant_generation.validation_groups%</argument>
            <tag name="form.type" />
        </service>

        <service id="sylius.form.event_subscriber.product_variant_generator" class="Sylius\Bundle\ProductBundle\Form\EventSubscriber\GenerateProductVariantsSubscriber">
            <argument type="service" id="sylius.generator.product_variant" />
            <argument type="service" id="request_stack" />
        </service>

        <service id="sylius.form.type.data_transformer.products_to_product_associations" class="Sylius\Bundle\ProductBundle\Form\DataTransformer\ProductsToProductAssociationsTransformer">
            <argument type="service" id="sylius.factory.product_association" />
            <argument type="service" id="sylius.repository.product" />
            <argument type="service" id="sylius.repository.product_association_type" />
        </service>

        <service id="sylius.form.type.product_option_value_choice" class="Sylius\Bundle\ProductBundle\Form\Type\ProductOptionValueChoiceType">
            <argument type="service" id="sylius.available_product_option_values_resolver" />
            <tag name="form.type" />
        </service>
    </services>
</container>
