<?xml version="1.0" ?>

<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>
        <service id="Shopware\Core\System\SalesChannel\SalesChannelDefinition">
            <tag name="shopware.entity.definition"/>
        </service>

        <service id="Shopware\Core\System\SalesChannel\Aggregate\SalesChannelTranslation\SalesChannelTranslationDefinition">
            <tag name="shopware.entity.definition"/>
        </service>

        <service id="Shopware\Core\System\SalesChannel\Aggregate\SalesChannelCountry\SalesChannelCountryDefinition">
            <tag name="shopware.entity.definition"/>
        </service>

        <service id="Shopware\Core\System\SalesChannel\Aggregate\SalesChannelCurrency\SalesChannelCurrencyDefinition">
            <tag name="shopware.entity.definition"/>
        </service>

        <service id="Shopware\Core\System\SalesChannel\Aggregate\SalesChannelDomain\SalesChannelDomainDefinition">
            <tag name="shopware.entity.definition"/>
        </service>

        <service id="Shopware\Core\System\SalesChannel\Aggregate\SalesChannelLanguage\SalesChannelLanguageDefinition">
            <tag name="shopware.entity.definition"/>
        </service>

        <service id="Shopware\Core\System\SalesChannel\Aggregate\SalesChannelPaymentMethod\SalesChannelPaymentMethodDefinition">
            <tag name="shopware.entity.definition"/>
        </service>

        <service id="Shopware\Core\System\SalesChannel\Aggregate\SalesChannelShippingMethod\SalesChannelShippingMethodDefinition">
            <tag name="shopware.entity.definition"/>
        </service>

        <service id="Shopware\Core\System\SalesChannel\Aggregate\SalesChannelType\SalesChannelTypeDefinition">
            <tag name="shopware.entity.definition"/>
        </service>

        <service id="Shopware\Core\System\SalesChannel\Aggregate\SalesChannelTypeTranslation\SalesChannelTypeTranslationDefinition">
            <tag name="shopware.entity.definition"/>
        </service>

        <service id="Shopware\Core\System\SalesChannel\Aggregate\SalesChannelAnalytics\SalesChannelAnalyticsDefinition">
            <tag name="shopware.entity.definition" entity="sales_channel_analytics" />
        </service>

        <service id="Shopware\Core\System\SalesChannel\Context\SalesChannelContextPersister">
            <argument type="service" id="Doctrine\DBAL\Connection"/>
            <argument type="service" id="event_dispatcher"/>
            <argument type="service" id="Shopware\Core\Checkout\Cart\CartPersister"/>
            <argument type="string">%shopware.api.store.context_lifetime%</argument>
        </service>

        <service id="Shopware\Core\System\SalesChannel\Context\SalesChannelContextFactory" public="true">
            <argument type="service" id="customer.repository"/>
            <argument type="service" id="customer_group.repository"/>
            <argument type="service" id="customer_address.repository"/>
            <argument type="service" id="payment_method.repository"/>
            <argument type="service" id="Shopware\Core\Checkout\Cart\Tax\TaxDetector"/>
            <argument type="tagged" tag="tax.rule_type_filter"/>
            <argument type="service" id="event_dispatcher"/>
            <argument type="service" id="currency_country_rounding.repository"/>
            <argument type="service" id="Shopware\Core\System\SalesChannel\Context\BaseContextFactory"/>
        </service>

        <service id="Shopware\Core\System\SalesChannel\Context\BaseContextFactory">
            <argument type="service" id="sales_channel.repository"/>
            <argument type="service" id="currency.repository"/>
            <argument type="service" id="customer_group.repository"/>
            <argument type="service" id="country.repository"/>
            <argument type="service" id="tax.repository"/>
            <argument type="service" id="payment_method.repository"/>
            <argument type="service" id="shipping_method.repository"/>
            <argument type="service" id="Doctrine\DBAL\Connection"/>
            <argument type="service" id="country_state.repository"/>
            <argument type="service" id="currency_country_rounding.repository"/>
        </service>

        <service id="Shopware\Core\System\SalesChannel\Context\CachedBaseContextFactory" decorates="Shopware\Core\System\SalesChannel\Context\BaseContextFactory">
            <argument type="service" id="Shopware\Core\System\SalesChannel\Context\CachedBaseContextFactory.inner"/>
            <argument type="service" id="cache.object"/>
            <argument type="service" id="Shopware\Core\Framework\Adapter\Cache\CacheTracer"/>
        </service>

        <service id="Shopware\Core\System\SalesChannel\Context\CachedSalesChannelContextFactory" decorates="Shopware\Core\System\SalesChannel\Context\SalesChannelContextFactory" decoration-priority="-1000">
            <argument type="service" id="Shopware\Core\System\SalesChannel\Context\CachedSalesChannelContextFactory.inner"/>
            <argument type="service" id="cache.object"/>
            <argument type="service" id="Shopware\Core\Framework\Adapter\Cache\CacheTracer"/>
        </service>

        <service id="Shopware\Core\System\SalesChannel\Context\SalesChannelContextService">
            <argument type="service" id="Shopware\Core\System\SalesChannel\Context\SalesChannelContextFactory"/>
            <argument type="service" id="Shopware\Core\Checkout\Cart\CartRuleLoader"/>
            <argument type="service" id="Shopware\Core\System\SalesChannel\Context\SalesChannelContextPersister"/>
            <argument type="service" id="Shopware\Core\Checkout\Cart\SalesChannel\CartService"/>
            <argument type="service" id="event_dispatcher"/>
        </service>

        <service id="Shopware\Core\System\SalesChannel\Context\SalesChannelContextRestorer">
            <argument type="service" id="Shopware\Core\System\SalesChannel\Context\SalesChannelContextFactory"/>
            <argument type="service" id="Shopware\Core\Checkout\Cart\CartRuleLoader"/>
            <argument type="service" id="Shopware\Core\Checkout\Cart\Order\OrderConverter"/>
            <argument type="service" id="order.repository"/>
            <argument type="service" id="Doctrine\DBAL\Connection"/>
            <argument type="service" id="event_dispatcher"/>
        </service>

        <service id="Shopware\Core\System\SalesChannel\Context\CartRestorer">
            <argument type="service" id="Shopware\Core\System\SalesChannel\Context\SalesChannelContextFactory"/>
            <argument type="service" id="Shopware\Core\System\SalesChannel\Context\SalesChannelContextPersister"/>
            <argument type="service" id="Shopware\Core\Checkout\Cart\SalesChannel\CartService"/>
            <argument type="service" id="Shopware\Core\Checkout\Cart\CartRuleLoader"/>
            <argument type="service" id="event_dispatcher"/>
        </service>

        <service id="Shopware\Core\System\SalesChannel\SalesChannel\StoreApiInfoController" public="true">
            <argument type="service" id="Shopware\Core\Framework\Api\ApiDefinition\DefinitionService"/>
            <argument type="service" id="twig"/>
            <argument>%shopware.security.csp_templates%</argument>
        </service>

        <service id="Shopware\Core\System\SalesChannel\SalesChannel\SalesChannelContextSwitcher">
            <argument type="service" id="Shopware\Core\System\SalesChannel\SalesChannel\ContextSwitchRoute"/>
        </service>

        <service id="Shopware\Core\System\SalesChannel\SalesChannel\ContextSwitchRoute" public="true">
            <argument type="service" id="Shopware\Core\Framework\Validation\DataValidator"/>
            <argument type="service" id="Shopware\Core\System\SalesChannel\Context\SalesChannelContextPersister"/>
            <argument type="service" id="event_dispatcher"/>
        </service>

        <service id="Shopware\Core\System\SalesChannel\SalesChannel\ContextRoute" public="true"/>

        <service id="Shopware\Core\System\SalesChannel\Entity\SalesChannelDefinitionInstanceRegistry" public="true">
            <argument type="string"/>
            <argument type="service" id="service_container" />
            <argument type="collection"/>
            <argument type="collection"/>
        </service>

        <service id="Shopware\Core\System\SalesChannel\Entity\DefinitionRegistryChain">
            <argument type="service" id="Shopware\Core\Framework\DataAbstractionLayer\DefinitionInstanceRegistry"/>
            <argument type="service" id="Shopware\Core\System\SalesChannel\Entity\SalesChannelDefinitionInstanceRegistry"/>
        </service>

        <service id="Shopware\Core\System\SalesChannel\Context\SalesChannelContextValueResolver">
            <tag name="controller.argument_value_resolver" priority="1000"/>
        </service>

        <service id="Shopware\Core\System\SalesChannel\SalesChannelExceptionHandler">
            <tag name="shopware.dal.exception_handler"/>
        </service>

        <service id="Shopware\Core\System\SalesChannel\Api\StoreApiResponseListener">
            <tag name="kernel.event_subscriber"/>
            <argument type="service" id="Shopware\Core\System\SalesChannel\Api\StructEncoder"/>
        </service>

        <service id="Shopware\Core\System\SalesChannel\Api\StructEncoder">
            <argument type="service" id="Shopware\Core\System\SalesChannel\Entity\DefinitionRegistryChain"/>
            <argument type="service" id="serializer"/>
        </service>

        <service id="Shopware\Core\System\SalesChannel\DataAbstractionLayer\SalesChannelIndexer">
            <argument type="service" id="Shopware\Core\Framework\DataAbstractionLayer\Dbal\Common\IteratorFactory"/>
            <argument type="service" id="sales_channel.repository"/>
            <argument type="service" id="event_dispatcher"/>
            <argument type="service" id="Shopware\Core\Framework\DataAbstractionLayer\Indexing\ManyToManyIdFieldUpdater"/>
            <tag name="shopware.entity_indexer"/>
        </service>

        <service id="Shopware\Core\System\SalesChannel\Context\Cleanup\CleanupSalesChannelContextTask">
            <tag name="shopware.scheduled.task"/>
        </service>

        <service id="Shopware\Core\System\SalesChannel\Context\Cleanup\CleanupSalesChannelContextTaskHandler">
            <argument type="service" id="scheduled_task.repository"/>
            <argument type="service" id="logger"/>
            <argument type="service" id="Doctrine\DBAL\Connection"/>
            <argument>%shopware.sales_channel_context.expire_days%</argument>
            <tag name="messenger.message_handler"/>
        </service>

        <service id="Shopware\Core\System\SalesChannel\Validation\SalesChannelValidator">
            <argument type="service" id="Doctrine\DBAL\Connection"/>

            <tag name="kernel.event_subscriber"/>
        </service>

        <service id="Shopware\Core\System\SalesChannel\Subscriber\SalesChannelTypeValidator">
            <tag name="kernel.event_subscriber"/>
        </service>

        <service id="Shopware\Core\System\SalesChannel\Subscriber\SalesChannelAnalyticsLoader">
            <argument type="service" id="sales_channel_analytics.repository"/>

            <tag name="kernel.event_listener" event="Shopware\Storefront\Event\StorefrontRenderEvent" method="loadAnalytics" priority="2000" />
        </service>

        <service id="Shopware\Core\System\SalesChannel\StoreApiCustomFieldMapper">
            <argument type="service" id="Doctrine\DBAL\Connection"/>
            <tag name="kernel.reset" method="reset"/>
        </service>
    </services>
</container>
