services:
    # Normalizer
    oro_pricing.importexport.normalizer.product_price:
        class: 'Oro\Bundle\PricingBundle\ImportExport\Normalizer\ProductPriceNormalizer'
        public: false
        parent: oro_importexport.serializer.configurable_entity_normalizer
        tags:
            - { name: oro_importexport.normalizer }

    # Converter
    oro_pricing.importexport.data_converter.product_price:
        public: false
        parent: oro_importexport.data_converter.configurable
        class: 'Oro\Bundle\PricingBundle\ImportExport\DataConverter\ProductPriceDataConverter'

    # Strategy
    oro_pricing.importexport.strategy.product_price.add_or_replace:
        class: 'Oro\Bundle\PricingBundle\ImportExport\Strategy\ProductPriceImportStrategy'
        public: false
        parent: oro_importexport.strategy.configurable_add_or_replace
        calls:
            - [setTranslator, ['@translator']]

    oro_pricing.importexport.strategy.product_price.reset:
        class: 'Oro\Bundle\PricingBundle\ImportExport\Strategy\ProductPriceResetStrategy'
        public: false
        parent: oro_pricing.importexport.strategy.product_price.add_or_replace

    # Template Fixture
    oro_pricing.importexport.template_fixture.product_price:
        class: 'Oro\Bundle\PricingBundle\ImportExport\TemplateFixture\PriceListFixture'
        public: false
        tags:
            - { name: oro_importexport.template_fixture }

    # Import processor
    oro_pricing.importexport.processor.import.product_price:
        public: false
        parent: oro_importexport.processor.import_abstract
        calls:
             - [setDataConverter, ['@oro_pricing.importexport.data_converter.product_price']]
             - [setStrategy, ['@oro_pricing.importexport.strategy.product_price.add_or_replace']]
        tags:
            - { name: oro_importexport.processor, type: import, entity: 'Oro\Bundle\PricingBundle\Entity\ProductPrice', alias: oro_pricing_product_price.add_or_replace }
            - { name: oro_importexport.processor, type: import_validation, entity: 'Oro\Bundle\PricingBundle\Entity\ProductPrice', alias: oro_pricing_product_price.add_or_replace }

    oro_pricing.importexport.processor.import.product_price.reset:
        public: false
        parent: oro_importexport.processor.import_abstract
        calls:
             - [setDataConverter, ['@oro_pricing.importexport.data_converter.product_price']]
             - [setStrategy, ['@oro_pricing.importexport.strategy.product_price.reset']]
        tags:
            - { name: oro_importexport.processor, type: import, entity: 'Oro\Bundle\PricingBundle\Entity\ProductPrice', alias: oro_pricing_product_price.reset }
            - { name: oro_importexport.processor, type: import_validation, entity: 'Oro\Bundle\PricingBundle\Entity\ProductPrice', alias: oro_pricing_product_price.reset }

    # Export processor
    oro_pricing.importexport.processor.export.product_price:
        public: false
        parent: oro_importexport.processor.export_abstract
        calls:
            - [setDataConverter, ['@oro_pricing.importexport.data_converter.product_price']]
        tags:
            - { name: oro_importexport.processor, type: export, entity: 'Oro\Bundle\PricingBundle\Entity\ProductPrice', alias: oro_pricing_product_price }

    # Reader
    oro_pricing.importexport.reader.price_list_product_prices:
        public: false
        parent: oro_importexport.reader.entity
        class: 'Oro\Bundle\PricingBundle\ImportExport\Reader\PriceListProductPricesReader'
        calls:
            - [setShardManager, ['@oro_pricing.shard_manager']]

    oro_pricing.importexport.reader.price_list_additional_product_prices:
        public: false
        class: 'Oro\Bundle\PricingBundle\ImportExport\Reader\PriceListAdditionalProductPriceReader'
        arguments:
            - '@oro_importexport.context_registry'
            - '@doctrine'
            - '@oro_pricing.shard_manager'

    # Export template
    oro_pricing.importexport.processor.export_template.product_price:
        public: false
        parent: oro_importexport.processor.export_abstract
        calls:
            - [setDataConverter, ['@oro_pricing.importexport.data_converter.product_price']]
        tags:
            - { name: oro_importexport.processor, type: export_template, entity: 'Oro\Bundle\PricingBundle\Entity\ProductPrice', alias: oro_pricing_product_price }

    # Writer
    oro_pricing.importexport.writer.product_price:
        class: 'Oro\Bundle\PricingBundle\ImportExport\Writer\ProductPriceWriter'
        public: false
        parent: oro_integration.writer.persistent_batch_writer
        arguments:
            - '@oro_pricing.manager.price_manager'
            - '@oro_platform.optional_listeners.manager'
        calls:
            - [disableListener, ['oro_pricing.entity_listener.product_price_cpl']]
            - [disableListener, ['oro_pricing.entity_listener.price_list_to_product']]
            - [disableListener, ['oro_website.indexation_request_listener']]

    oro_pricing.importexport.configuration_provider.price_attribute_product_price:
        class: 'Oro\Bundle\PricingBundle\ImportExport\Configuration\PriceAttributeProductPriceImportExportConfigurationProvider'
        arguments:
            - '@translator'
        tags:
            - { name: oro_importexport.configuration, alias: oro_product_index }

    oro_pricing.importexport.configuration_provider.product_price:
        class: 'Oro\Bundle\PricingBundle\ImportExport\Configuration\ProductPriceImportExportConfigurationProvider'
        arguments:
            - '@translator'
        tags:
            - { name: oro_importexport.configuration, alias: oro_product_price }

    oro_pricing.importexport.data_converter.price_attribute_product_price:
        class: 'Oro\Bundle\PricingBundle\ImportExport\DataConverter\PriceAttributeProductPriceDataConverter'
        public: false
        parent: oro_importexport.data_converter.configurable

    oro_pricing.importexport.normalizer.price_attribute_product_price:
        class: 'Oro\Bundle\PricingBundle\ImportExport\Normalizer\PriceAttributeProductPriceNormalizer'
        public: false
        parent: oro_importexport.serializer.configurable_entity_normalizer
        tags:
            - { name: oro_importexport.normalizer }

    oro_pricing.importexport.template_fixture.price_attribute_product_price:
        class: 'Oro\Bundle\PricingBundle\ImportExport\TemplateFixture\PriceAttributeProductPriceFixture'
        public: false
        tags:
             - { name: oro_importexport.template_fixture }

    oro_pricing.importexport.processor.export.price_attribute_product_price:
        public: false
        parent: oro_importexport.processor.export_abstract
        calls:
            - [setDataConverter, ['@oro_pricing.importexport.data_converter.price_attribute_product_price']]
        tags:
            - { name: oro_importexport.processor, type: export, entity: 'Oro\Bundle\PricingBundle\Entity\PriceAttributeProductPrice', alias: oro_pricing_product_price_attribute_price }

    oro_pricing.importexport.processor.export_template.price_attribute_product_price:
        public: false
        parent: oro_importexport.processor.export_abstract
        calls:
            - [setDataConverter, ['@oro_pricing.importexport.data_converter.price_attribute_product_price']]
        tags:
            - { name: oro_importexport.processor, type: export_template, entity: 'Oro\Bundle\PricingBundle\Entity\PriceAttributeProductPrice', alias: oro_pricing_product_price_attribute_price }

    oro_pricing.importexport.strategy.price_attribute_product_price.add_or_replace:
        class: 'Oro\Bundle\PricingBundle\ImportExport\Strategy\PriceAttributeProductPriceImportStrategy'
        public: false
        parent: oro_importexport.strategy.configurable_add_or_replace

    oro_pricing.importexport.strategy.price_attribute_product_price.reset:
        class: 'Oro\Bundle\PricingBundle\ImportExport\Strategy\PriceAttributeProductPriceImportResetStrategy'
        public: false
        parent: oro_pricing.importexport.strategy.price_attribute_product_price.add_or_replace

    oro_pricing.importexport.processor.import.price_attribute_product_price:
        public: false
        parent: oro_importexport.processor.import_abstract
        calls:
             - [setStrategy, ['@oro_pricing.importexport.strategy.price_attribute_product_price.add_or_replace']]
             - [setDataConverter, ['@oro_pricing.importexport.data_converter.price_attribute_product_price']]
        tags:
            - { name: oro_importexport.processor, type: import, entity: 'Oro\Bundle\PricingBundle\Entity\PriceAttributeProductPrice', alias: oro_pricing_product_price_attribute_price.add_or_replace }
            - { name: oro_importexport.processor, type: import_validation, entity: 'Oro\Bundle\PricingBundle\Entity\PriceAttributeProductPrice', alias: oro_pricing_product_price_attribute_price.add_or_replace }

    oro_pricing.importexport.processor.import.price_attribute_product_price.reset:
        public: false
        parent: oro_importexport.processor.import_abstract
        calls:
             - [setStrategy, ['@oro_pricing.importexport.strategy.price_attribute_product_price.reset']]
             - [setDataConverter, ['@oro_pricing.importexport.data_converter.price_attribute_product_price']]
        tags:
            - { name: oro_importexport.processor, type: import, entity: 'Oro\Bundle\PricingBundle\Entity\PriceAttributeProductPrice', alias: oro_pricing_product_price_attribute_price.reset }
            - { name: oro_importexport.processor, type: import_validation, entity: 'Oro\Bundle\PricingBundle\Entity\PriceAttributeProductPrice', alias: oro_pricing_product_price_attribute_price.reset }

    oro_pricing.importexport.writer.price_attribute_product_price:
        class: 'Oro\Bundle\PricingBundle\ImportExport\Writer\PriceAttributeProductPriceWriter'
        public: false
        parent: oro_integration.writer.persistent_batch_writer

    oro_pricing.importexport.listener.before_import_chunks:
        class: Oro\Bundle\PricingBundle\ImportExport\EventListener\BeforeImportChunksListener
        arguments:
            - '@doctrine'
            - '@oro_pricing.shard_manager'
        public: false
        tags:
            - { name: kernel.event_listener, event: oro.import_export.before_import_chunks, method: onBeforeImportChunks }

    oro_pricing.importexport.frontend.listener.frontend_product_export:
        class: Oro\Bundle\PricingBundle\ImportExport\Frontend\EventListener\FrontendProductExportEventListener
        arguments:
            - '@oro_pricing.provider.frontend_product_prices_export'
            - '@oro_pricing.formatter.import_export.product_prices_export_formatter'
        tags:
            - { name: kernel.event_listener, event: oro_product.frontend_product_export.convert_to_export, method: onConvertToExport }
            - { name: kernel.event_listener, event: oro_product.frontend_product_export.normalize, method: onProductExportNormalize }

    oro_pricing.provider.frontend_product_prices_export:
        class: Oro\Bundle\PricingBundle\Provider\FrontendProductPricesExportProvider
        arguments:
            - '@doctrine'
            - '@oro_config.manager'
            - '@oro_pricing.provider.product_price'
            - '@oro_security.token_accessor'
            - '@oro_pricing.model.product_price_scope_criteria_factory'
            - '@oro_pricing.user_currency_manager'

    oro_pricing.formatter.import_export.product_prices_export_formatter:
        class: Oro\Bundle\PricingBundle\ImportExport\Frontend\Formatter\ProductPricesExportFormatter
        arguments:
            - '@oro_locale.formatter.number'
            - '@oro_product.formatter.product_unit_value'
            - '@oro_product.formatter.product_unit_label'
