<?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">

    <parameters>
        <parameter key="customer.account_types" type="collection">
            <parameter type="constant">Shopware\Core\Checkout\Customer\CustomerEntity::ACCOUNT_TYPE_BUSINESS</parameter>
            <parameter type="constant">Shopware\Core\Checkout\Customer\CustomerEntity::ACCOUNT_TYPE_PRIVATE</parameter>
        </parameter>
    </parameters>

    <services>
        <service id="Shopware\Core\Checkout\Customer\CustomerDefinition">
            <tag name="shopware.entity.definition"/>
            <tag name="shopware.entity.hookable"/>
        </service>

        <service id="Shopware\Core\Checkout\Customer\Aggregate\CustomerGroupTranslation\CustomerGroupTranslationDefinition">
            <tag name="shopware.entity.definition"/>
        </service>

        <service id="Shopware\Core\Checkout\Customer\Aggregate\CustomerAddress\CustomerAddressDefinition">
            <tag name="shopware.entity.definition"/>
            <tag name="shopware.entity.hookable"/>
        </service>

        <service id="Shopware\Core\Checkout\Customer\Aggregate\CustomerRecovery\CustomerRecoveryDefinition">
            <tag name="shopware.entity.definition"/>
        </service>

        <service id="Shopware\Core\Checkout\Customer\Aggregate\CustomerGroup\CustomerGroupDefinition">
            <tag name="shopware.entity.definition"/>
        </service>

        <service id="Shopware\Core\Checkout\Customer\Aggregate\CustomerGroupRegistrationSalesChannel\CustomerGroupRegistrationSalesChannelDefinition">
            <tag name="shopware.entity.definition"/>
        </service>

        <service id="Shopware\Core\Checkout\Customer\Aggregate\CustomerTag\CustomerTagDefinition">
            <tag name="shopware.entity.definition"/>
        </service>

        <service id="Shopware\Core\Checkout\Customer\SalesChannel\AccountService">
            <argument type="service" id="customer.repository"/>
            <argument type="service" id="event_dispatcher"/>
            <argument type="service" id="Shopware\Core\Checkout\Customer\Password\LegacyPasswordVerifier"/>
            <argument type="service" id="Shopware\Core\Checkout\Customer\SalesChannel\SwitchDefaultAddressRoute"/>
            <argument type="service" id="Shopware\Core\System\SalesChannel\Context\CartRestorer"/>
        </service>

        <service id="Shopware\Core\Checkout\Customer\Validation\AddressValidationFactory">
            <argument type="service" id="Shopware\Core\System\SystemConfig\SystemConfigService"/>
        </service>

        <service id="Shopware\Core\Checkout\Customer\Validation\CustomerProfileValidationFactory">
            <argument type="service" id="Shopware\Core\System\SystemConfig\SystemConfigService"/>
            <argument>%customer.account_types%</argument>
        </service>

        <service id="Shopware\Core\Checkout\Customer\Validation\PasswordValidationFactory">
            <argument type="service" id="Shopware\Core\System\SystemConfig\SystemConfigService"/>
        </service>

        <service id="Shopware\Core\Checkout\Customer\Validation\CustomerValidationFactory">
            <argument type="service" id="Shopware\Core\Checkout\Customer\Validation\CustomerProfileValidationFactory"/>
        </service>

        <service id="Shopware\Core\Checkout\Customer\Validation\Constraint\CustomerEmailUniqueValidator">
            <argument type="service" id="Doctrine\DBAL\Connection"/>

            <tag name="validator.constraint_validator"/>
        </service>

        <service id="Shopware\Core\Checkout\Customer\Validation\Constraint\CustomerPasswordMatchesValidator">
            <argument type="service" id="Shopware\Core\Checkout\Customer\SalesChannel\AccountService"/>

            <tag name="validator.constraint_validator"/>
        </service>

        <service id="Shopware\Core\Checkout\Customer\Validation\Constraint\CustomerVatIdentificationValidator">
            <argument type="service" id="Doctrine\DBAL\Connection"/>
            <tag name="validator.constraint_validator"/>
        </service>

        <service id="Shopware\Core\Checkout\Customer\Validation\Constraint\CustomerZipCodeValidator">
            <argument type="service" id="country.repository"/>
            <tag name="validator.constraint_validator"/>
        </service>

        <service id="Shopware\Core\Checkout\Customer\Password\LegacyEncoder\Md5">
            <tag name="shopware.legacy_encoder"/>
        </service>

        <service id="Shopware\Core\Checkout\Customer\Password\LegacyEncoder\Sha256">
            <tag name="shopware.legacy_encoder"/>
        </service>

        <service id="Shopware\Core\Checkout\Customer\Password\LegacyPasswordVerifier">
            <argument type="tagged_iterator" tag="shopware.legacy_encoder" />
        </service>

        <service id="Shopware\Core\Checkout\Customer\Subscriber\AddressHashSubscriber">
            <tag name="kernel.event_subscriber"/>
        </service>

        <service id="Shopware\Core\Checkout\Customer\Subscriber\CustomerMetaFieldSubscriber">
            <argument type="service" id="Doctrine\DBAL\Connection"/>

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

        <service id="Shopware\Core\Checkout\Customer\Service\ProductReviewCountService">
            <argument type="service" id="Doctrine\DBAL\Connection"/>
        </service>

        <service id="Shopware\Core\Checkout\Customer\Subscriber\ProductReviewSubscriber">
            <argument type="service" id="Shopware\Core\Checkout\Customer\Service\ProductReviewCountService"/>

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

        <service id="Shopware\Core\Checkout\Customer\Subscriber\CustomerRemoteAddressSubscriber">
            <argument type="service" id="Doctrine\DBAL\Connection"/>
            <argument type="service" id="request_stack"/>
            <argument type="service" id="Shopware\Core\System\SystemConfig\SystemConfigService"/>

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

        <service id="Shopware\Core\Checkout\Customer\Subscriber\CustomerTokenSubscriber">
            <argument type="service" id="Shopware\Core\System\SalesChannel\Context\SalesChannelContextPersister"/>
            <argument type="service" id="request_stack"/>
            <tag name="kernel.event_subscriber"/>
        </service>

        <service id="Shopware\Core\Checkout\Customer\Subscriber\CustomerGroupSubscriber">
            <argument type="service" id="customer_group.repository"/>
            <argument type="service" id="seo_url.repository"/>
            <argument type="service" id="language.repository"/>
            <argument type="service" id="Shopware\Core\Content\Seo\SeoUrlPersister"/>
            <argument type="service" id="slugify"/>
            <tag name="kernel.event_subscriber"/>
        </service>

        <service id="Shopware\Core\Checkout\Customer\Subscriber\CustomerChangePasswordSubscriber">
            <argument type="service" id="Doctrine\DBAL\Connection"/>
            <tag name="kernel.event_subscriber"/>
        </service>

        <service id="Shopware\Core\Checkout\Customer\Subscriber\CustomerFlowEventsSubscriber">
            <argument type="service" id="Symfony\Component\EventDispatcher\EventDispatcherInterface" />
            <argument type="service" id="Shopware\Core\System\SalesChannel\Context\SalesChannelContextRestorer" />
            <argument type="service" id="Shopware\Core\Checkout\Customer\DataAbstractionLayer\CustomerIndexer" />
            <argument type="service" id="Doctrine\DBAL\Connection"/>

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

        <service id="Shopware\Core\Checkout\Customer\Subscriber\CustomerLogoutSubscriber">
            <argument type="service" id="Symfony\Component\HttpFoundation\RequestStack"/>
            <tag name="kernel.event_subscriber"/>
        </service>

        <service id="Shopware\Core\Checkout\Customer\SalesChannel\LoginRoute" public="true">
            <argument type="service" id="Shopware\Core\Checkout\Customer\SalesChannel\AccountService"/>
            <argument type="service" id="Symfony\Component\HttpFoundation\RequestStack"/>
            <argument type="service" id="Shopware\Core\Framework\RateLimiter\RateLimiter"/>
        </service>

        <service id="Shopware\Core\Checkout\Customer\SalesChannel\LogoutRoute" public="true">
            <argument type="service" id="Shopware\Core\System\SalesChannel\Context\SalesChannelContextPersister"/>
            <argument type="service" id="event_dispatcher"/>
            <argument type="service" id="Shopware\Core\System\SystemConfig\SystemConfigService"/>
            <argument type="service" id="Shopware\Core\Checkout\Cart\SalesChannel\CartService"/>
        </service>

        <service id="Shopware\Core\Checkout\Customer\SalesChannel\SendPasswordRecoveryMailRoute" public="true">
            <argument type="service" id="customer.repository"/>
            <argument type="service" id="customer_recovery.repository"/>
            <argument type="service" id="event_dispatcher"/>
            <argument type="service" id="Shopware\Core\Framework\Validation\DataValidator"/>
            <argument type="service" id="Shopware\Core\System\SystemConfig\SystemConfigService"/>
            <argument type="service" id="Symfony\Component\HttpFoundation\RequestStack"/>
            <argument type="service" id="shopware.rate_limiter"/>
        </service>

        <service id="Shopware\Core\Checkout\Customer\SalesChannel\ResetPasswordRoute" public="true">
            <argument type="service" id="customer.repository"/>
            <argument type="service" id="customer_recovery.repository"/>
            <argument type="service" id="event_dispatcher"/>
            <argument type="service" id="Shopware\Core\Framework\Validation\DataValidator"/>
            <argument type="service" id="Symfony\Component\HttpFoundation\RequestStack"/>
            <argument type="service" id="shopware.rate_limiter"/>
            <argument type="service" id="Shopware\Core\Checkout\Customer\Validation\PasswordValidationFactory"/>
        </service>

        <service id="Shopware\Core\Checkout\Customer\SalesChannel\CustomerRecoveryIsExpiredRoute" public="true">
            <argument type="service" id="customer_recovery.repository"/>
            <argument type="service" id="event_dispatcher"/>
            <argument type="service" id="Shopware\Core\Framework\Validation\DataValidator"/>
            <argument type="service" id="Shopware\Core\System\SystemConfig\SystemConfigService"/>
            <argument type="service" id="Symfony\Component\HttpFoundation\RequestStack"/>
            <argument type="service" id="shopware.rate_limiter"/>
        </service>

        <service id="Shopware\Core\Checkout\Customer\SalesChannel\ChangeCustomerProfileRoute" public="true">
            <argument type="service" id="customer.repository"/>
            <argument type="service" id="event_dispatcher"/>
            <argument type="service" id="Shopware\Core\Framework\Validation\DataValidator"/>
            <argument type="service" id="Shopware\Core\Checkout\Customer\Validation\CustomerProfileValidationFactory"/>
            <argument type="service" id="Shopware\Core\System\SalesChannel\StoreApiCustomFieldMapper"/>
            <argument type="service" id="salutation.repository"/>
        </service>

        <service id="Shopware\Core\Checkout\Customer\SalesChannel\ChangePasswordRoute" public="true">
            <argument type="service" id="customer.repository"/>
            <argument type="service" id="event_dispatcher"/>
            <argument type="service" id="Shopware\Core\System\SystemConfig\SystemConfigService"/>
            <argument type="service" id="Shopware\Core\Framework\Validation\DataValidator"/>
        </service>

        <service id="Shopware\Core\Checkout\Customer\SalesChannel\ChangeEmailRoute" public="true">
            <argument type="service" id="customer.repository"/>
            <argument type="service" id="event_dispatcher"/>
            <argument type="service" id="Shopware\Core\Framework\Validation\DataValidator"/>
        </service>

        <service id="Shopware\Core\Checkout\Customer\SalesChannel\ChangeLanguageRoute" public="true">
            <argument type="service" id="customer.repository"/>
            <argument type="service" id="event_dispatcher"/>
            <argument type="service" id="Shopware\Core\Framework\Validation\DataValidator"/>
        </service>

        <service id="Shopware\Core\Checkout\Customer\SalesChannel\ConvertGuestRoute" public="true">
            <argument type="service" id="customer.repository"/>
            <argument type="service" id="event_dispatcher"/>
            <argument type="service" id="Shopware\Core\Framework\Validation\DataValidator"/>
            <argument type="service" id="Shopware\Core\Checkout\Customer\Validation\PasswordValidationFactory"/>
        </service>

        <service id="Shopware\Core\Checkout\Customer\SalesChannel\CustomerRoute" public="true">
            <argument type="service" id="customer.repository"/>
        </service>

        <service id="Shopware\Core\Checkout\Customer\SalesChannel\DeleteCustomerRoute" public="true">
            <argument type="service" id="customer.repository"/>
        </service>

        <service id="Shopware\Core\Checkout\Customer\SalesChannel\RegisterRoute" public="true">
            <argument type="service" id="event_dispatcher"/>
            <argument type="service" id="Shopware\Core\System\NumberRange\ValueGenerator\NumberRangeValueGeneratorInterface"/>
            <argument type="service" id="Shopware\Core\Framework\Validation\DataValidator"/>
            <argument type="service" id="Shopware\Core\Checkout\Customer\Validation\CustomerValidationFactory"/>
            <argument type="service" id="Shopware\Core\Checkout\Customer\Validation\AddressValidationFactory"/>
            <argument type="service" id="Shopware\Core\System\SystemConfig\SystemConfigService"/>
            <argument type="service" id="customer.repository"/>
            <argument type="service" id="Shopware\Core\System\SalesChannel\Context\SalesChannelContextPersister"/>
            <argument type="service" id="sales_channel.country.repository"/>
            <argument type="service" id="Doctrine\DBAL\Connection"/>
            <argument type="service" id="Shopware\Core\System\SalesChannel\Context\SalesChannelContextService"/>
            <argument type="service" id="Shopware\Core\System\SalesChannel\StoreApiCustomFieldMapper"/>
            <argument type="service" id="salutation.repository"/>
            <argument type="service" id="Shopware\Core\Checkout\Customer\Validation\PasswordValidationFactory"/>
        </service>

        <service id="Shopware\Core\Checkout\Customer\SalesChannel\RegisterConfirmRoute" public="true">
            <argument type="service" id="customer.repository"/>
            <argument type="service" id="event_dispatcher"/>
            <argument type="service" id="Shopware\Core\Framework\Validation\DataValidator"/>
            <argument type="service" id="Shopware\Core\System\SalesChannel\Context\SalesChannelContextPersister"/>
            <argument type="service" id="Shopware\Core\System\SalesChannel\Context\SalesChannelContextService"/>
        </service>

        <service id="Shopware\Core\Checkout\Customer\SalesChannel\ListAddressRoute" public="true">
            <argument type="service" id="customer_address.repository"/>
            <argument type="service" id="event_dispatcher"/>
        </service>

        <service id="Shopware\Core\Checkout\Customer\SalesChannel\UpsertAddressRoute" public="true">
            <argument type="service" id="customer_address.repository"/>
            <argument type="service" id="Shopware\Core\Framework\Validation\DataValidator"/>
            <argument type="service" id="event_dispatcher"/>
            <argument type="service" id="Shopware\Core\Checkout\Customer\Validation\AddressValidationFactory"/>
            <argument type="service" id="Shopware\Core\System\SystemConfig\SystemConfigService"/>
            <argument type="service" id="Shopware\Core\System\SalesChannel\StoreApiCustomFieldMapper"/>
            <argument type="service" id="salutation.repository"/>
        </service>

        <service id="Shopware\Core\Checkout\Customer\SalesChannel\DeleteAddressRoute" public="true">
            <argument type="service" id="customer_address.repository"/>
        </service>

        <service id="Shopware\Core\Checkout\Customer\SalesChannel\SwitchDefaultAddressRoute" public="true">
            <argument type="service" id="customer_address.repository"/>
            <argument type="service" id="customer.repository"/>
            <argument type="service" id="Symfony\Component\EventDispatcher\EventDispatcherInterface" />
        </service>

        <service id="Shopware\Core\Checkout\Customer\SalesChannel\CustomerGroupRegistrationSettingsRoute" public="true">
            <argument type="service" id="customer_group.repository"/>
        </service>

        <service id="Shopware\Core\Checkout\Customer\DataAbstractionLayer\CustomerIndexer">
            <argument type="service" id="Shopware\Core\Framework\DataAbstractionLayer\Dbal\Common\IteratorFactory"/>
            <argument type="service" id="customer.repository"/>
            <argument type="service" id="Shopware\Core\Framework\DataAbstractionLayer\Indexing\ManyToManyIdFieldUpdater"/>
            <argument type="service" id="Shopware\Core\Content\Newsletter\DataAbstractionLayer\Indexing\CustomerNewsletterSalesChannelsUpdater"/>
            <argument type="service" id="event_dispatcher"/>
            <tag name="shopware.entity_indexer" priority="100"/>
        </service>

        <service id="Shopware\Core\Checkout\Customer\Api\CustomerGroupRegistrationActionController" public="true">
            <argument type="service" id="customer.repository"/>
            <argument type="service" id="customer_group.repository" />
            <argument type="service" id="event_dispatcher"/>
            <argument type="service" id="Shopware\Core\System\SalesChannel\Context\SalesChannelContextRestorer" />
        </service>

        <service id="Shopware\Core\Checkout\Customer\Aggregate\CustomerWishlist\CustomerWishlistDefinition">
            <tag name="shopware.entity.definition"/>
        </service>

        <service id="Shopware\Core\Checkout\Customer\Aggregate\CustomerWishlistProduct\CustomerWishlistProductDefinition">
            <tag name="shopware.entity.definition"/>
        </service>

        <service id="Shopware\Core\Checkout\Customer\SalesChannel\LoadWishlistRoute" public="true">
            <argument type="service" id="customer_wishlist.repository"/>
            <argument type="service" id="sales_channel.product.repository"/>
            <argument type="service" id="event_dispatcher"/>
            <argument type="service" id="Shopware\Core\System\SystemConfig\SystemConfigService"/>
            <argument type="service" id="Shopware\Core\Content\Product\SalesChannel\ProductCloseoutFilterFactory"/>
        </service>

        <service id="Shopware\Core\Checkout\Customer\SalesChannel\AddWishlistProductRoute" public="true">
            <argument type="service" id="customer_wishlist.repository"/>
            <argument type="service" id="sales_channel.product.repository"/>
            <argument type="service" id="Shopware\Core\System\SystemConfig\SystemConfigService"/>
            <argument type="service" id="event_dispatcher"/>
        </service>

        <service id="Shopware\Core\Checkout\Customer\SalesChannel\RemoveWishlistProductRoute" public="true">
            <argument type="service" id="customer_wishlist.repository"/>
            <argument type="service" id="customer_wishlist_product.repository"/>
            <argument type="service" id="Shopware\Core\System\SystemConfig\SystemConfigService"/>
            <argument type="service" id="event_dispatcher"/>
        </service>

        <service id="Shopware\Core\Checkout\Customer\DataAbstractionLayer\CustomerWishlistProductExceptionHandler">
            <tag name="shopware.dal.exception_handler"/>
        </service>

        <service id="Shopware\Core\Checkout\Customer\SalesChannel\MergeWishlistProductRoute" public="true">
            <argument type="service" id="customer_wishlist.repository"/>
            <argument type="service" id="sales_channel.product.repository"/>
            <argument type="service" id="Shopware\Core\System\SystemConfig\SystemConfigService"/>
            <argument type="service" id="event_dispatcher"/>
            <argument type="service" id="Doctrine\DBAL\Connection"/>
        </service>

        <service id="Shopware\Core\Checkout\Customer\CustomerValueResolver">
            <tag name="controller.argument_value_resolver" priority="1002"/>
        </service>

        <service id="Shopware\Core\Checkout\Customer\SalesChannel\AccountNewsletterRecipientRoute" public="true">
            <argument type="service" id="sales_channel.newsletter_recipient.repository" />
        </service>

        <service id="Shopware\Core\Checkout\Customer\SalesChannel\ImitateCustomerRoute" public="true">
            <argument type="service" id="Shopware\Core\Checkout\Customer\SalesChannel\AccountService"/>
            <argument type="service" id="Shopware\Core\Checkout\Customer\ImitateCustomerTokenGenerator"/>
            <argument type="service" id="Shopware\Core\Checkout\Customer\SalesChannel\LogoutRoute"/>
            <argument type="service" id="Shopware\Core\System\SalesChannel\Context\SalesChannelContextFactory"/>
            <argument type="service" id="event_dispatcher"/>
            <argument type="service" id="Shopware\Core\Framework\Validation\DataValidator"/>
        </service>

        <service id="Shopware\Core\Checkout\Customer\DeleteUnusedGuestCustomerService">
            <argument type="service" id="customer.repository" />
            <argument type="service" id="Shopware\Core\System\SystemConfig\SystemConfigService" />
        </service>

        <service id="Shopware\Core\Checkout\Customer\ImitateCustomerTokenGenerator">
            <argument type="string">%env(APP_SECRET)%</argument>
        </service>

        <service id="Shopware\Core\Checkout\Customer\Command\DeleteUnusedGuestCustomersCommand">
            <argument type="service" id="Shopware\Core\Checkout\Customer\DeleteUnusedGuestCustomerService" />
            <tag name="console.command" />
        </service>

        <service id="Shopware\Core\Checkout\Customer\DeleteUnusedGuestCustomerTask">
            <tag name="shopware.scheduled.task"/>
        </service>

        <service id="Shopware\Core\Checkout\Customer\DeleteUnusedGuestCustomerHandler">
            <argument type="service" id="scheduled_task.repository"/>
            <argument type="service" id="logger"/>
            <argument type="service" id="Shopware\Core\Checkout\Customer\DeleteUnusedGuestCustomerService" />

            <tag name="messenger.message_handler" />
        </service>

        <service id="Shopware\Core\Checkout\Customer\Subscriber\CustomerBeforeDeleteSubscriber">
            <argument type="service" id="customer.repository"/>
            <argument type="service" id="Shopware\Core\System\SalesChannel\Context\SalesChannelContextService" />
            <argument type="service" id="event_dispatcher"/>
            <argument type="service" id="Shopware\Core\Framework\Api\Serializer\JsonEntityEncoder"/>

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

        <service id="Shopware\Core\Checkout\Customer\SalesChannel\DownloadRoute" public="true">
            <argument type="service" id="order_line_item_download.repository"/>
            <argument type="service" id="Shopware\Core\Content\Media\File\DownloadResponseGenerator"/>
        </service>

        <service id="Shopware\Core\Checkout\Customer\Subscriber\CustomerSalutationSubscriber">
            <argument type="service" id="Doctrine\DBAL\Connection"/>
            <tag name="kernel.event_subscriber"/>
        </service>
    </services>
</container>
