parameters:
    orocrm_analytics.entity.rfm_category.class: OroCRM\Bundle\AnalyticsBundle\Entity\RFMMetricCategory

    orocrm_analytics.builder.class: OroCRM\Bundle\AnalyticsBundle\Builder\AnalyticsBuilder
    orocrm_analytics.builder.rfm.class: OroCRM\Bundle\AnalyticsBundle\Builder\RFMBuilder

    orocrm_analytics.form.type.category.class: OroCRM\Bundle\AnalyticsBundle\Form\Type\RFMCategoryType
    orocrm_analytics.form.type.category_settings.class: OroCRM\Bundle\AnalyticsBundle\Form\Type\RFMCategorySettingsType

    orocrm_analytics.model.analytics_aware_interface: OroCRM\Bundle\AnalyticsBundle\Model\AnalyticsAwareInterface
    orocrm_analytics.model.rfm_aware_interface: OroCRM\Bundle\AnalyticsBundle\Model\RFMAwareInterface
    orocrm_analytics.form.channel_type_extension.class: OroCRM\Bundle\AnalyticsBundle\Form\Extension\ChannelTypeExtension

    orocrm_analytics.placeholder.rfm_filter.class: OroCRM\Bundle\AnalyticsBundle\Placeholder\RFMAwareFilter

    orocrm_analytics.event_listener.timezone_change.class: OroCRM\Bundle\AnalyticsBundle\EventListener\TimezoneChangeListener
    orocrm_analytics.event_listener.rfm_category.class: OroCRM\Bundle\AnalyticsBundle\EventListener\RFMCategoryListener

    orocrm_analytics.validator.categories.class: OroCRM\Bundle\AnalyticsBundle\Validator\CategoriesValidator

    orocrm_analytics.model.rfm_state_manager.class: OroCRM\Bundle\AnalyticsBundle\Model\RFMMetricStateManager
services:
    orocrm_analytics.builder:
        class: %orocrm_analytics.builder.class%
        arguments:
            - []

    orocrm_analytics.builder.rfm:
        class: %orocrm_analytics.builder.rfm.class%
        arguments:
            - @oro_entity.doctrine_helper
        tags:
            - { name: orocrm_analytics.builder }

    orocrm_analytics.form.type.category:
        class: %orocrm_analytics.form.type.category.class%
        tags:
            - { name: form.type, alias: "orocrm_analytics_rfm_category" }

    orocrm_analytics.form.type.category_settings:
        class: %orocrm_analytics.form.type.category_settings.class%
        tags:
            - { name: form.type, alias: "orocrm_analytics_rfm_category_settings" }

    orocrm_analytics.form.channel_type_extension:
        class: %orocrm_analytics.form.channel_type_extension.class%
        arguments:
            - @oro_entity.doctrine_helper
            - %orocrm_analytics.model.rfm_aware_interface%
            - %orocrm_analytics.entity.rfm_category.class%
        tags:
            - { name: form.type_extension, alias: orocrm_channel_form }

    orocrm_analytics.placeholder.rfm_filter:
        class: %orocrm_analytics.placeholder.rfm_filter.class%
        arguments:
            - %orocrm_analytics.model.analytics_aware_interface%

    orocrm_analytics.event_listener.timezone_change:
        class: %orocrm_analytics.event_listener.timezone_change.class%
        arguments:
            - @orocrm_analytics.model.rfm_state_manager
        tags:
            - { name: kernel.event_listener, event: oro_config.update_after, method: onConfigUpdate }

    orocrm_analytics.validator.categories:
        class: %orocrm_analytics.validator.categories.class%
        tags:
            - { name: validator.constraint_validator, alias: orocrm_analytics.categories_validator }

    orocrm_analytics.model.rfm_state_manager:
        class: %orocrm_analytics.model.rfm_state_manager.class%
        arguments:
            - @oro_entity.doctrine_helper
            - %orocrm_analytics.model.rfm_aware_interface%
            - %orocrm_channel.entity.class%

    orocrm_analytics.event_listener.rfm_category:
        class: %orocrm_analytics.event_listener.rfm_category.class%
        arguments:
            - @orocrm_analytics.model.rfm_state_manager
            - %orocrm_analytics.entity.rfm_category.class%
            - %orocrm_channel.entity.class%
        tags:
            - { name: doctrine.event_listener, event: onFlush }
            - { name: kernel.event_listener, event: orocrm_channel.channel.save_succeed, method: onChannelSucceedSave }
