<?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\Content\Rule\RuleDefinition">
            <tag name="shopware.entity.definition"/>
        </service>
        <service id="Shopware\Core\Content\Rule\Aggregate\RuleCondition\RuleConditionDefinition">
            <tag name="shopware.entity.definition"/>
        </service>
        <service id="Shopware\Core\Content\Rule\Aggregate\RuleTag\RuleTagDefinition">
            <tag name="shopware.entity.definition"/>
        </service>

        <service id="Shopware\Core\Content\Rule\RuleValidator">
            <argument type="service" id="validator"/>
            <argument type="service" id="Shopware\Core\Framework\Rule\Collector\RuleConditionRegistry"/>
            <argument type="service" id="rule_condition.repository" />
            <argument type="service" id="app_script_condition.repository" />

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

        <service id="Shopware\Core\Content\Rule\DataAbstractionLayer\RulePayloadSubscriber">
            <tag name="kernel.event_subscriber"/>
            <argument type="service" id="Shopware\Core\Content\Rule\DataAbstractionLayer\RulePayloadUpdater"/>
            <argument type="service" id="Shopware\Core\Framework\Script\Debugging\ScriptTraces"/>
            <argument>%twig.cache%</argument>
            <argument>%kernel.debug%</argument>
        </service>

        <service id="Shopware\Core\Content\Rule\DataAbstractionLayer\RuleIndexer">
            <argument type="service" id="Shopware\Core\Framework\DataAbstractionLayer\Dbal\Common\IteratorFactory"/>
            <argument type="service" id="rule.repository"/>
            <argument type="service" id="Shopware\Core\Content\Rule\DataAbstractionLayer\RulePayloadUpdater"/>
            <argument type="service" id="Shopware\Core\Content\Rule\DataAbstractionLayer\RuleAreaUpdater"/>
            <argument type="service" id="event_dispatcher"/>
            <tag name="shopware.entity_indexer"/>
        </service>

        <service id="Shopware\Core\Content\Rule\DataAbstractionLayer\RuleIndexerSubscriber">
            <tag name="kernel.event_subscriber"/>
            <argument type="service" id="Doctrine\DBAL\Connection"/>
            <argument type="service" id="Shopware\Core\Checkout\Cart\CartRuleLoader"/>
        </service>


        <service id="Shopware\Core\Content\Rule\DataAbstractionLayer\RulePayloadUpdater">
            <argument type="service" id="Doctrine\DBAL\Connection"/>
            <argument type="service" id="Shopware\Core\Framework\Rule\Collector\RuleConditionRegistry"/>
            <tag name="kernel.event_subscriber"/>
        </service>

        <service id="Shopware\Core\Content\Rule\DataAbstractionLayer\RuleAreaUpdater">
            <argument type="service" id="Doctrine\DBAL\Connection"/>
            <argument type="service" id="Shopware\Core\Content\Rule\RuleDefinition"/>
            <argument type="service" id="Shopware\Core\Framework\Rule\Collector\RuleConditionRegistry"/>
            <argument type="service" id="Shopware\Core\Framework\Adapter\Cache\CacheInvalidator"/>
            <argument type="service" id="Shopware\Core\Framework\DataAbstractionLayer\DefinitionInstanceRegistry"/>
            <tag name="kernel.event_subscriber"/>
        </service>
    </services>
</container>
