<?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.validator.promotion_subject_coupon" class="Sylius\Bundle\PromotionBundle\Validator\PromotionSubjectCouponValidator">
            <argument type="service" id="sylius.promotion_eligibility_checker" />
            <tag name="validator.constraint_validator" alias="sylius_promotion_subject_validator" />
        </service>

        <service id="sylius.validator.date_range" class="Sylius\Bundle\PromotionBundle\Validator\PromotionDateRangeValidator">
            <tag name="validator.constraint_validator" alias="sylius_promotion_date_range_validator" />
        </service>

        <service id="sylius.validator.promotion_coupon_generation_amount" class="Sylius\Bundle\PromotionBundle\Validator\CouponGenerationAmountValidator">
            <argument type="service" id="sylius.promotion_coupon_generator.percentage_policy" />
            <tag name="validator.constraint_validator" alias="sylius_coupon_generation_amount_validator" />
        </service>

        <service id="Sylius\Bundle\PromotionBundle\Validator\CatalogPromotionActionValidator">
            <argument>%sylius.catalog_promotion.actions_types%</argument>
            <argument type="tagged_iterator" tag="sylius.catalog_promotion.action_validator" index-by="key" />
            <tag name="validator.constraint_validator" alias="sylius_catalog_promotion_action" />
        </service>

        <service id="Sylius\Bundle\PromotionBundle\Validator\CatalogPromotionActionGroupValidator">
            <argument>%sylius.promotion.catalog_promotion_action.validation_groups%</argument>
            <tag name="validator.constraint_validator" alias="sylius_catalog_promotion_action_group" />
        </service>

        <service id="Sylius\Bundle\PromotionBundle\Validator\CatalogPromotionActionTypeValidator">
            <argument>%sylius.catalog_promotion.actions_types%</argument>
            <tag name="validator.constraint_validator" alias="sylius_catalog_promotion_action_type_validator" />
        </service>

        <service id="Sylius\Bundle\PromotionBundle\Validator\CatalogPromotionScopeValidator">
            <argument>%sylius.catalog_promotion.scopes_types%</argument>
            <argument type="tagged_iterator" tag="sylius.catalog_promotion.scope_validator" index-by="key" />
            <tag name="validator.constraint_validator" alias="sylius_catalog_promotion_scope" />
        </service>

        <service id="Sylius\Bundle\PromotionBundle\Validator\CatalogPromotionScopeGroupValidator">
            <argument>%sylius.promotion.catalog_promotion_scope.validation_groups%</argument>
            <tag name="validator.constraint_validator" alias="sylius_catalog_promotion_scope_group" />
        </service>

        <service id="Sylius\Bundle\PromotionBundle\Validator\CatalogPromotionScopeTypeValidator">
            <argument>%sylius.catalog_promotion.scopes_types%</argument>
            <tag name="validator.constraint_validator" alias="sylius_catalog_promotion_scope_type_validator" />
        </service>

        <service id="Sylius\Bundle\PromotionBundle\Validator\PromotionActionGroupValidator">
            <argument>%sylius.promotion.promotion_action.validation_groups%</argument>
            <tag name="validator.constraint_validator" alias="sylius_promotion_action_group" />
        </service>

        <service id="Sylius\Bundle\PromotionBundle\Validator\PromotionActionTypeValidator">
            <argument>%sylius.promotion_actions%</argument>
            <tag name="validator.constraint_validator" alias="sylius_promotion_action_type" />
        </service>

        <service id="Sylius\Bundle\PromotionBundle\Validator\PromotionRuleGroupValidator">
            <argument>%sylius.promotion.promotion_rule.validation_groups%</argument>
            <tag name="validator.constraint_validator" alias="sylius_promotion_rule_group" />
        </service>

        <service id="Sylius\Bundle\PromotionBundle\Validator\PromotionRuleTypeValidator">
            <argument>%sylius.promotion_rules%</argument>
            <tag name="validator.constraint_validator" alias="sylius_promotion_rule_type" />
        </service>

        <service id="Sylius\Bundle\PromotionBundle\Validator\PromotionNotCouponBasedValidator">
            <tag name="validator.constraint_validator" alias="sylius_promotion_not_coupon_based_validator" />
        </service>
    </services>
</container>
