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

        <service id="Sylius\Bundle\CoreBundle\CatalogPromotion\CommandHandler\ApplyCatalogPromotionsOnVariantsHandler">
            <argument type="service" id="Sylius\Bundle\PromotionBundle\Provider\EligibleCatalogPromotionsProviderInterface" />
            <argument type="service" id="Sylius\Bundle\CoreBundle\CatalogPromotion\Applicator\CatalogPromotionApplicatorInterface"/>
            <argument type="service" id="sylius.repository.product_variant" />
            <argument type="service" id="Sylius\Bundle\CoreBundle\CatalogPromotion\Processor\CatalogPromotionClearerInterface" />
            <tag name="messenger.message_handler" bus="sylius.command_bus" />
        </service>

        <service id="Sylius\Bundle\CoreBundle\CatalogPromotion\CommandHandler\DisableCatalogPromotionHandler">
            <argument type="service" id="sylius.repository.catalog_promotion" />
            <argument type="service" id="Sylius\Bundle\CoreBundle\CatalogPromotion\Processor\AllProductVariantsCatalogPromotionsProcessorInterface"/>
            <tag name="messenger.message_handler" bus="sylius.command_bus" />
        </service>

        <service id="Sylius\Bundle\CoreBundle\CatalogPromotion\CommandHandler\RemoveCatalogPromotionHandler">
            <argument type="service" id="sylius.repository.catalog_promotion" />
            <argument type="service" id="sylius.manager.catalog_promotion"/>
            <tag name="messenger.message_handler" bus="sylius.command_bus" />
        </service>

        <service id="Sylius\Bundle\CoreBundle\CatalogPromotion\CommandHandler\RemoveInactiveCatalogPromotionHandler">
            <argument type="service" id="sylius.repository.catalog_promotion" />
            <argument type="service" id="sylius.manager.catalog_promotion"/>
            <tag name="messenger.message_handler" bus="sylius.command_bus" />
        </service>

        <service id="Sylius\Bundle\CoreBundle\CatalogPromotion\CommandHandler\UpdateCatalogPromotionStateHandler">
            <argument type="service" id="Sylius\Bundle\CoreBundle\CatalogPromotion\Processor\CatalogPromotionStateProcessorInterface" />
            <argument type="service" id="sylius.repository.catalog_promotion" />
            <tag name="messenger.message_handler" bus="sylius.command_bus" />
        </service>
    </services>
</container>
