parameters:
    oro_tracking.tracking_website.class:                 Oro\Bundle\TrackingBundle\Entity\TrackingWebsite
    oro_tracking.tracking_event.class:                   Oro\Bundle\TrackingBundle\Entity\TrackingEvent
    oro_tracking.tracking_data.class:                    Oro\Bundle\TrackingBundle\Entity\TrackingData
    oro_tracking.tracking_visit_event.class:             Oro\Bundle\TrackingBundle\Entity\TrackingVisitEvent
    oro_tracking.form.type.tracking_website.class:       Oro\Bundle\TrackingBundle\Form\Type\TrackingWebsiteType
    oro_tracking.form.handler.tracking_website.class:    Oro\Bundle\TrackingBundle\Form\Handler\TrackingWebsiteHandler
    oro_tracking.tracking_website.manager.api.class:     Oro\Bundle\SoapBundle\Entity\Manager\ApiEntityManager
    oro_tracking.importexport.reader.log.class:          Oro\Bundle\TrackingBundle\ImportExport\LogReader
    oro_tracking.importexport.reader.context.class:      Oro\Bundle\TrackingBundle\ImportExport\ContextReader
    oro_tracking.importexport.normalizer.data.class:     Oro\Bundle\TrackingBundle\ImportExport\DataNormalizer
    oro_tracking.importexport.data_converter.data.class: Oro\Bundle\TrackingBundle\ImportExport\DataConverter
    oro_tracking.config.listener:                        Oro\Bundle\TrackingBundle\EventListener\ConfigListener
    oro_tracking.entity_config_dumper.visit_identifier.extension.class: Oro\Bundle\TrackingBundle\Tools\IdentifierVisitConfigDumperExtension
    oro_tracking.entity_generator.visit_identifie.extension.class:     Oro\Bundle\TrackingBundle\Tools\IdentifierVisitGeneratorExtension
    oro_tracking.processor.tracking_processor.class:     Oro\Bundle\TrackingBundle\Processor\TrackingProcessor

    oro_tracking.provider.identifier_provider.class: Oro\Bundle\TrackingBundle\Provider\TrackingEventIdentificationProvider

services:
    oro_tracking.form.type.tracking_website:
        class: %oro_tracking.form.type.tracking_website.class%
        arguments:
            - %oro_tracking.tracking_website.class%
        tags:
            - { name: form.type, alias: oro_tracking_website }

    oro_tracking.form.handler.tracking_website:
        class: %oro_tracking.form.handler.tracking_website.class%
        scope: request
        arguments:
            - '@oro_tracking.form.tracking_website'
            - '@request'
            - '@doctrine.orm.entity_manager'

    oro_tracking.form.tracking_website:
        class: Symfony\Component\Form\Form
        factory_method: createNamed
        factory_service: form.factory
        arguments:
            - oro_tracking_website
            - oro_tracking_website

    oro_tracking.tracking_website.manager.api:
        class: %oro_tracking.tracking_website.manager.api.class%
        parent: oro_soap.manager.entity_manager.abstract
        arguments:
            - %oro_tracking.tracking_website.class%
            - '@doctrine.orm.entity_manager'

    oro_tracking.importexport.reader.log:
        class: %oro_tracking.importexport.reader.log.class%
        arguments:
            - '@oro_importexport.context_registry'

    oro_tracking.importexport.reader.context:
        class: %oro_tracking.importexport.reader.context.class%
        arguments:
            - '@oro_importexport.context_registry'

    oro_tracking.importexport.data_converter.data:
        class: %oro_tracking.importexport.data_converter.data.class%
        arguments:
            - '@oro_importexport.field.field_helper'

    oro_tracking.importexport.strategy.data:
        parent: oro_importexport.strategy.configurable_add_or_replace

    oro_tracking.importexport.normalizer.data:
        class: %oro_tracking.importexport.normalizer.data.class%
        parent: oro_importexport.serializer.configurable_entity_normalizer
        calls:
            - [setEntityName, [%oro_tracking.tracking_data.class%]]
        tags:
            - { name: oro_importexport.normalizer, priority: 10 }

    oro_tracking.importexport.processor.import.data:
        parent: oro_importexport.processor.import_abstract
        calls:
            - [setDataConverter,  ['@oro_tracking.importexport.data_converter.data']]
            - [setStrategy,  ['@oro_tracking.importexport.strategy.data']]
        tags:
            - { name: oro_importexport.processor, type: import, entity: %oro_tracking.tracking_data.class%, alias: oro_tracking.processor.data }

    oro_tracking.config.listener:
        class: %oro_tracking.config.listener%
        arguments:
            - '@oro_config.global'
            - '@router'
            - %kernel.logs_dir%
        tags:
            - { name: kernel.event_listener, event: oro_config.update_after, method: onUpdateAfter }

    oro_tracking.migration.extension.tracking_identifier:
        class: Oro\Bundle\TrackingBundle\Migration\Extension\IdentifierEventExtension
        tags:
            - { name: oro_migration.extension, extension_name: tracking_identifier }

    oro_tracking.migration.extension.visit_event_association:
        class: Oro\Bundle\TrackingBundle\Migration\Extension\VisitEventAssociationExtension
        tags:
            - { name: oro_migration.extension, extension_name: visit_event_association }

    oro_tracking.entity_config_dumper.visit_identifier.extension:
        class: %oro_tracking.entity_config_dumper.visit_identifier.extension.class%
        arguments:
            - '@oro_tracking.provider.identifier_provider'
            - '@oro_entity_config.config_manager'
            - '@oro_entity_extend.association_builder'
        tags:
            - { name: oro_entity_extend.entity_config_dumper_extension }

    oro_tracking.entity_config_dumper.visit_event_association.extension:
        class: Oro\Bundle\TrackingBundle\Tools\VisitEventAssociationDumperExtension
        arguments:
            - '@oro_tracking.provider.identifier_provider'
            - '@oro_entity_config.config_manager'
            - '@oro_entity_extend.association_builder'
        tags:
            - { name: oro_entity_extend.entity_config_dumper_extension }

    oro_tracking.entity_generator.visit_identifie.extension:
        class: %oro_tracking.entity_generator.visit_identifie.extension.class%
        tags:
            - { name: oro_entity_extend.entity_generator_extension }

    oro_tracking.entity_generator.visit_event_association.extension:
        class: Oro\Bundle\TrackingBundle\Tools\VisitEventAssociationGeneratorExtension
        tags:
            - { name: oro_entity_extend.entity_generator_extension }

    oro_tracking.processor.tracking_processor:
        class: %oro_tracking.processor.tracking_processor.class%
        arguments:
            - '@doctrine'
            - '@oro_tracking.provider.identifier_provider'

    oro_tracking.exclusion_provider.identifier_event:
        class: Oro\Bundle\TrackingBundle\Provider\IdentifierEventExclusionProvider
        public: false
        tags:
            - { name: oro_entity.exclusion_provider.api }

    oro_tracking.exclusion_provider.visit_event:
        class: Oro\Bundle\TrackingBundle\Provider\VisitEventExclusionProvider
        public: false
        tags:
            - { name: oro_entity.exclusion_provider.api }

    #
    # Chain provider for identicating tracking visit
    #
    oro_tracking.provider.identifier_provider:
        class: %oro_tracking.provider.identifier_provider.class%
