services:
    oro_pricing.api.compute_price_list_currencies:
        class: Oro\Bundle\PricingBundle\Api\Processor\ComputePriceListCurrencies
        tags:
            - { name: oro.api.processor, action: customize_loaded_data, requestType: '!frontend', class: Oro\Bundle\PricingBundle\Entity\PriceList }

    oro_pricing.api.collect_price_list_initial_statuses:
        class: Oro\Bundle\PricingBundle\Api\Processor\CollectPriceListInitialStatuses
        tags:
            - { name: oro.api.processor, action: customize_form_data, event: pre_submit, requestType: '!frontend', class: Oro\Bundle\PricingBundle\Entity\PriceList }

    oro_pricing.api.move_price_list_initial_statuses_to_context:
        class: Oro\Bundle\PricingBundle\Api\Processor\MovePriceListInitialStatusesToContext
        tags:
            - { name: oro.api.processor, action: customize_form_data, event: post_save_data, requestType: '!frontend', priority: -90 }

    oro_pricing.api.handle_price_list_status_change:
        class: Oro\Bundle\PricingBundle\Api\Processor\HandlePriceListStatusChange
        arguments:
            - '@oro_pricing.price_list_relation_trigger_handler'
        tags:
            - { name: oro.api.processor, action: customize_form_data, event: post_save_data, requestType: '!frontend', initial_statuses_for_price_lists: exists, priority: -100 }

    oro_pricing.api.collect_price_lists_to_update_combined_price_lists:
        class: Oro\Bundle\PricingBundle\Api\Processor\CollectPriceListsToUpdateCombinedPriceLists
        tags:
            - { name: oro.api.processor, action: customize_form_data, event: post_save_data, requestType: '!frontend', class: Oro\Bundle\PricingBundle\Entity\PriceListSchedule }
            - { name: oro.api.processor, action: delete, group: delete_data, requestType: '!frontend', class: Oro\Bundle\PricingBundle\Entity\PriceListSchedule }
            - { name: oro.api.processor, action: delete_list, group: delete_data, requestType: '!frontend', class: Oro\Bundle\PricingBundle\Entity\PriceListSchedule }

    oro_pricing.api.move_price_lists_to_update_combined_price_lists_to_context:
        class: Oro\Bundle\PricingBundle\Api\Processor\MovePriceListsToUpdateCombinedPriceListsToContext
        tags:
            - { name: oro.api.processor, action: customize_form_data, event: post_save_data, requestType: '!frontend', priority: -90 }
            - { name: oro.api.processor, action: delete, group: delete_data, requestType: '!frontend', priority: -90 }
            - { name: oro.api.processor, action: delete_list, group: delete_data, requestType: '!frontend', priority: -90 }

    oro_pricing.api.update_combined_price_lists:
        class: Oro\Bundle\PricingBundle\Api\Processor\UpdateCombinedPriceLists
        arguments:
            - '@oro_pricing.builder.combined_price_list_activation_plan_builder'
        tags:
            - { name: oro.api.processor, action: customize_form_data, event: post_save_data, requestType: '!frontend', combined_price_lists_to_update: exists, priority: -100 }
            - { name: oro.api.processor, action: delete, group: delete_data, requestType: '!frontend', combined_price_lists_to_update: exists, priority: -100 }
            - { name: oro.api.processor, action: delete_list, group: delete_data, requestType: '!frontend', combined_price_lists_to_update: exists, priority: -100 }

    oro_pricing.api.collect_price_lists_to_update_price_lists_contain_schedule:
        class: Oro\Bundle\PricingBundle\Api\Processor\CollectPriceListsToUpdatePriceListsContainSchedule
        tags:
            - { name: oro.api.processor, action: delete, group: delete_data, requestType: '!frontend', class: Oro\Bundle\PricingBundle\Entity\PriceListSchedule }
            - { name: oro.api.processor, action: delete_list, group: delete_data, requestType: '!frontend', class: Oro\Bundle\PricingBundle\Entity\PriceListSchedule }

    oro_pricing.api.move_price_lists_to_update_price_lists_contain_schedule_to_context:
        class: Oro\Bundle\PricingBundle\Api\Processor\MovePriceListsToUpdatePriceListsContainScheduleToContext
        tags:
            - { name: oro.api.processor, action: delete, group: delete_data, requestType: '!frontend', priority: -90 }
            - { name: oro.api.processor, action: delete_list, group: delete_data, requestType: '!frontend', priority: -90 }

    oro_pricing.api.update_price_lists_contain_schedule:
        class: Oro\Bundle\PricingBundle\Api\Processor\UpdatePriceListsContainSchedule
        arguments:
            - '@oro_api.doctrine_helper'
        tags:
            - { name: oro.api.processor, action: delete, group: delete_data, requestType: '!frontend', price_lists_to_update_contain_schedule: exists, priority: -105 }
            - { name: oro.api.processor, action: delete_list, group: delete_data, requestType: '!frontend', price_lists_to_update_contain_schedule: exists, priority: -105 }

    oro_pricing.api.collect_price_lists_to_update_lexemes:
        class: Oro\Bundle\PricingBundle\Api\Processor\CollectPriceListsToUpdateLexemes
        tags:
            - { name: oro.api.processor, action: customize_form_data, event: post_save_data, requestType: '!frontend', class: Oro\Bundle\PricingBundle\Entity\PriceList }

    oro_pricing.api.collect_rule_price_price_lists_to_update_lexemes:
        class: Oro\Bundle\PricingBundle\Api\Processor\CollectPriceRulePriceListsToUpdateLexemes
        tags:
            - { name: oro.api.processor, action: customize_form_data, event: post_save_data, requestType: '!frontend', class: Oro\Bundle\PricingBundle\Entity\PriceRule }
            - { name: oro.api.processor, action: delete, group: delete_data, requestType: '!frontend', class: Oro\Bundle\PricingBundle\Entity\PriceRule }
            - { name: oro.api.processor, action: delete_list, group: delete_data, requestType: '!frontend', class: Oro\Bundle\PricingBundle\Entity\PriceRule }

    oro_pricing.api.move_price_lists_to_update_lexemes_to_context:
        class: Oro\Bundle\PricingBundle\Api\Processor\MovePriceListsToUpdateLexemesToContext
        tags:
            - { name: oro.api.processor, action: customize_form_data, event: post_save_data, requestType: '!frontend', priority: -90 }
            - { name: oro.api.processor, action: delete, group: delete_data, requestType: '!frontend', priority: -90 }
            - { name: oro.api.processor, action: delete_list, group: delete_data, requestType: '!frontend', priority: -90 }

    oro_pricing.api.update_price_list_lexemes:
        class: Oro\Bundle\PricingBundle\Api\Processor\UpdatePriceListLexemes
        arguments:
            - '@oro_pricing.handler.price_rule_lexeme_handler'
        tags:
            - { name: oro.api.processor, action: customize_form_data, event: post_save_data, requestType: '!frontend', price_lists_to_update_lexemes: exists, priority: -100 }
            - { name: oro.api.processor, action: delete, group: delete_data, requestType: '!frontend', price_lists_to_update_lexemes: exists, priority: -100 }
            - { name: oro.api.processor, action: delete_list, group: delete_data, requestType: '!frontend', price_lists_to_update_lexemes: exists, priority: -100 }

    oro_pricing.api.set_default_website:
        class: Oro\Bundle\WebsiteBundle\Api\Processor\SetDefaultWebsite
        arguments:
            - '@oro_api.form_property_accessor'
            - '@oro_website.manager'
        tags:
            - { name: oro.api.processor, action: customize_form_data, event: pre_validate, parentAction: create, class: Oro\Bundle\PricingBundle\Entity\PriceListToCustomer, priority: 20 }
            - { name: oro.api.processor, action: customize_form_data, event: pre_validate, parentAction: create, class: Oro\Bundle\PricingBundle\Entity\PriceListCustomerFallback, priority: 20 }
            - { name: oro.api.processor, action: customize_form_data, event: pre_validate, parentAction: create, class: Oro\Bundle\PricingBundle\Entity\PriceListToCustomerGroup, priority: 20 }
            - { name: oro.api.processor, action: customize_form_data, event: pre_validate, parentAction: create, class: Oro\Bundle\PricingBundle\Entity\PriceListCustomerGroupFallback, priority: 20 }

    oro_pricing.api.collect_price_list_customers_to_update:
        class: Oro\Bundle\PricingBundle\Api\Processor\CollectPriceListCustomersToUpdate
        tags:
            - { name: oro.api.processor, action: customize_form_data, event: post_save_data, requestType: '!frontend', class: Oro\Bundle\PricingBundle\Entity\PriceListToCustomer }
            - { name: oro.api.processor, action: delete, group: delete_data, requestType: '!frontend', class: Oro\Bundle\PricingBundle\Entity\PriceListToCustomer }
            - { name: oro.api.processor, action: delete_list, group: delete_data, requestType: '!frontend', class: Oro\Bundle\PricingBundle\Entity\PriceListToCustomer }
            - { name: oro.api.processor, action: customize_form_data, event: post_save_data, requestType: '!frontend', class: Oro\Bundle\PricingBundle\Entity\PriceListCustomerFallback }
            - { name: oro.api.processor, action: delete, group: delete_data, requestType: '!frontend', class: Oro\Bundle\PricingBundle\Entity\PriceListCustomerFallback }
            - { name: oro.api.processor, action: delete_list, group: delete_data, requestType: '!frontend', class: Oro\Bundle\PricingBundle\Entity\PriceListCustomerFallback }

    oro_pricing.api.move_price_list_customers_to_update_to_context:
        class: Oro\Bundle\PricingBundle\Api\Processor\MovePriceListCustomersToUpdateToContext
        tags:
            - { name: oro.api.processor, action: customize_form_data, event: post_save_data, requestType: '!frontend', priority: -90 }
            - { name: oro.api.processor, action: delete, group: delete_data, requestType: '!frontend', priority: -90 }
            - { name: oro.api.processor, action: delete_list, group: delete_data, requestType: '!frontend', priority: -90 }

    oro_pricing.api.update_price_list_customers:
        class: Oro\Bundle\PricingBundle\Api\Processor\UpdatePriceListCustomers
        arguments:
            - '@oro_pricing.price_list_relation_trigger_handler'
        tags:
            - { name: oro.api.processor, action: customize_form_data, event: post_save_data, requestType: '!frontend', price_list_customers_to_update: exists, priority: -100 }
            - { name: oro.api.processor, action: delete, group: delete_data, requestType: '!frontend', price_list_customers_to_update: exists, priority: -100 }
            - { name: oro.api.processor, action: delete_list, group: delete_data, requestType: '!frontend', price_list_customers_to_update: exists, priority: -100 }

    oro_pricing.api.collect_price_list_customer_groups_to_update:
        class: Oro\Bundle\PricingBundle\Api\Processor\CollectPriceListCustomerGroupsToUpdate
        tags:
            - { name: oro.api.processor, action: customize_form_data, event: post_save_data, requestType: '!frontend', class: Oro\Bundle\PricingBundle\Entity\PriceListToCustomerGroup }
            - { name: oro.api.processor, action: delete, group: delete_data, requestType: '!frontend', class: Oro\Bundle\PricingBundle\Entity\PriceListToCustomerGroup }
            - { name: oro.api.processor, action: delete_list, group: delete_data, requestType: '!frontend', class: Oro\Bundle\PricingBundle\Entity\PriceListToCustomerGroup }
            - { name: oro.api.processor, action: customize_form_data, event: post_save_data, requestType: '!frontend', class: Oro\Bundle\PricingBundle\Entity\PriceListCustomerGroupFallback }
            - { name: oro.api.processor, action: delete, group: delete_data, requestType: '!frontend', class: Oro\Bundle\PricingBundle\Entity\PriceListCustomerGroupFallback }
            - { name: oro.api.processor, action: delete_list, group: delete_data, requestType: '!frontend', class: Oro\Bundle\PricingBundle\Entity\PriceListCustomerGroupFallback }

    oro_pricing.api.move_price_list_customer_groups_to_update_to_context:
        class: Oro\Bundle\PricingBundle\Api\Processor\MovePriceListCustomerGroupsToUpdateToContext
        tags:
            - { name: oro.api.processor, action: customize_form_data, event: post_save_data, requestType: '!frontend', priority: -90 }
            - { name: oro.api.processor, action: delete, group: delete_data, requestType: '!frontend', priority: -90 }
            - { name: oro.api.processor, action: delete_list, group: delete_data, requestType: '!frontend', priority: -90 }

    oro_pricing.api.update_price_list_customer_groups:
        class: Oro\Bundle\PricingBundle\Api\Processor\UpdatePriceListCustomerGroups
        arguments:
            - '@oro_pricing.price_list_relation_trigger_handler'
        tags:
            - { name: oro.api.processor, action: customize_form_data, event: post_save_data, requestType: '!frontend', price_list_customer_groups_to_update: exists, priority: -100 }
            - { name: oro.api.processor, action: delete, group: delete_data, requestType: '!frontend', price_list_customer_groups_to_update: exists, priority: -100 }
            - { name: oro.api.processor, action: delete_list, group: delete_data, requestType: '!frontend', price_list_customer_groups_to_update: exists, priority: -100 }

    oro_pricing.api.add_schedule_to_price_list:
        class: Oro\Bundle\PricingBundle\Api\Processor\AddScheduleToPriceList
        tags:
           - { name: oro.api.processor, action: customize_form_data, event: pre_validate, class: Oro\Bundle\PricingBundle\Entity\PriceListSchedule }

    oro_pricing.api.update_price_by_value_and_currency:
        class: Oro\Bundle\CurrencyBundle\Api\Processor\UpdatePriceByValueAndCurrency
        tags:
            - { name: oro.api.processor, action: customize_form_data, event: pre_submit|post_validate, class: Oro\Bundle\PricingBundle\Entity\ProductPrice }
            - { name: oro.api.processor, action: customize_form_data, event: pre_submit|post_validate, class: Oro\Bundle\PricingBundle\Entity\PriceAttributeProductPrice }

    oro_pricing.api.normalize_product_price_id:
        class: Oro\Bundle\PricingBundle\Api\Processor\ProductPrice\NormalizeProductPriceId
        arguments:
            - '@oro_api.value_normalizer'
        tags:
            - { name: oro.api.processor, action: get, group: normalize_input, requestType: rest, class: Oro\Bundle\PricingBundle\Entity\ProductPrice, priority: -120 }
            - { name: oro.api.processor, action: delete, group: normalize_input, requestType: rest, class: Oro\Bundle\PricingBundle\Entity\ProductPrice, priority: -120 }
            - { name: oro.api.processor, action: update, group: normalize_input, requestType: rest, class: Oro\Bundle\PricingBundle\Entity\ProductPrice, priority: -120 }

    oro_pricing.api.compute_product_price_id:
        class: Oro\Bundle\PricingBundle\Api\Processor\ProductPrice\ComputeProductPriceId
        tags:
            - { name: oro.api.processor, action: customize_loaded_data, requestType: '!frontend', class: Oro\Bundle\PricingBundle\Entity\ProductPrice }

    oro_pricing.api.set_price_list_in_context:
        class: Oro\Bundle\PricingBundle\Api\Processor\ProductPrice\StorePriceListInContext
        tags:
            - { name: oro.api.processor, action: create, group: save_data, requestType: '!frontend', class: Oro\Bundle\PricingBundle\Entity\PriceList, priority: -20 }
            - { name: oro.api.processor, action: update, group: save_data, requestType: '!frontend', class: Oro\Bundle\PricingBundle\Entity\PriceList, priority: -20 }

    oro_pricing.api.set_price_list_in_context_by_product_price:
        class: Oro\Bundle\PricingBundle\Api\Processor\ProductPrice\StorePriceListInContextByProductPrice
        tags:
            - { name: oro.api.processor, action: create, group: save_data, requestType: '!frontend', class: Oro\Bundle\PricingBundle\Entity\ProductPrice, priority: -20 }
            - { name: oro.api.processor, action: update, group: save_data, requestType: '!frontend', class: Oro\Bundle\PricingBundle\Entity\ProductPrice, priority: -20 }

    oro_pricing.api.disable_process_persist_entity_for_product_price:
        class: Oro\Bundle\PricingBundle\Api\Processor\Create\DisableProcessForPreventPersistEntity
        arguments:
            - '%enable_price_sharding%'
        tags:
            - { name: oro.api.processor, action: create, group: save_data, requestType: '!frontend', class: Oro\Bundle\PricingBundle\Entity\ProductPrice, priority: -7 }

    oro_pricing.api.enable_process_product_price:
        class: Oro\Bundle\PricingBundle\Api\Processor\Create\EnableProcess
        arguments:
            - '%enable_price_sharding%'
        tags:
            - { name: oro.api.processor, action: create, group: save_data, requestType: '!frontend', class: Oro\Bundle\PricingBundle\Entity\ProductPrice, priority: -9 }

    oro_pricing.api.handle_price_list_filter:
        class: Oro\Bundle\PricingBundle\Api\Processor\ProductPrice\HandlePriceListFilter
        tags:
            - { name: oro.api.processor, action: get_list, group: normalize_input, requestType: '!frontend', class: Oro\Bundle\PricingBundle\Entity\ProductPrice, priority: -120 }
            - { name: oro.api.processor, action: delete_list, group: normalize_input, requestType: '!frontend', class: Oro\Bundle\PricingBundle\Entity\ProductPrice, priority: -120 }

    oro_pricing.api.build_single_item_query:
        class: Oro\Bundle\ApiBundle\Processor\Shared\BuildSingleItemQuery
        arguments:
            - '@oro_api.doctrine_helper'
            - '@oro_api.entity_id_helper'
        tags:
            - { name: oro.api.processor, action: update, group: load_data, requestType: '!frontend', class: Oro\Bundle\PricingBundle\Entity\ProductPrice, priority: 10 }
            - { name: oro.api.processor, action: delete, group: load_data, requestType: '!frontend', class: Oro\Bundle\PricingBundle\Entity\ProductPrice, priority: 10 }

    oro_pricing.api.load_entity_by_orm_query:
        class: Oro\Bundle\ApiBundle\Processor\Shared\LoadEntityByOrmQuery
        arguments:
            - '@oro_entity.query_hint_resolver'
        tags:
            - { name: oro.api.processor, action: update, group: load_data, requestType: '!frontend', class: Oro\Bundle\PricingBundle\Entity\ProductPrice }
            - { name: oro.api.processor, action: delete, group: load_data, requestType: '!frontend', class: Oro\Bundle\PricingBundle\Entity\ProductPrice }

    oro_pricing.api.enabled_price_sharding_on_query:
        class: Oro\Bundle\PricingBundle\Api\Processor\ProductPrice\EnableShardingOnQuery
        arguments:
            - '@oro_pricing.shard_manager'
        tags:
            - { name: oro.api.processor, action: update, group: load_data, requestType: '!frontend', class: Oro\Bundle\PricingBundle\Entity\ProductPrice, priority: 5 }
            - { name: oro.api.processor, action: delete, group: load_data, requestType: '!frontend', class: Oro\Bundle\PricingBundle\Entity\ProductPrice, priority: 5 }
            - { name: oro.api.processor, action: delete_list, group: build_query, requestType: '!frontend', class: Oro\Bundle\PricingBundle\Entity\ProductPrice, priority: -255 }

    oro_pricing.api.enable_price_sharding_on_config:
        class: Oro\Bundle\PricingBundle\Api\Processor\ProductPrice\EnableShardingOnConfig
        arguments:
            - '@oro_pricing.shard_manager'
        tags:
            - { name: oro.api.processor, action: get_list, group: build_query, requestType: '!frontend', class: Oro\Bundle\PricingBundle\Entity\ProductPrice, priority: -255 }
            - { name: oro.api.processor, action: get, group: build_query, requestType: '!frontend', class: Oro\Bundle\PricingBundle\Entity\ProductPrice, priority: -255 }

    oro_pricing.api.persist_product_price:
        class: Oro\Bundle\PricingBundle\Api\Processor\ProductPrice\PersistProductPrice
        arguments:
            - '@oro_pricing.manager.price_manager'
        tags:
            - { name: oro.api.processor, action: customize_form_data, event: pre_flush_data, requestType: '!frontend', class: Oro\Bundle\PricingBundle\Entity\ProductPrice, priority: 100 }

    oro_pricing.api.remember_product_price:
        class: Oro\Bundle\PricingBundle\Api\Processor\ProductPrice\RememberProductPrice
        tags:
            - { name: oro.api.processor, action: customize_form_data, event: pre_submit, requestType: '!frontend', class: Oro\Bundle\PricingBundle\Entity\ProductPrice, priority: 200 }

    oro_pricing.api.reset_price_rule_field:
        class: Oro\Bundle\PricingBundle\Api\Processor\ProductPrice\ResetPriceRuleField
        tags:
            - { name: oro.api.processor, action: customize_form_data, event: pre_flush_data, requestType: '!frontend', class: Oro\Bundle\PricingBundle\Entity\ProductPrice }

    oro_pricing.api.compute_product_prices:
        class: Oro\Bundle\PricingBundle\Api\Processor\ComputeProductPrices
        arguments:
            - '@oro_pricing.storage.prices'
            - '@oro_pricing.model.product_price_scope_criteria_factory'
            - '@oro_customer.provider.customer_user_relations_provider'
            - '@oro_pricing.user_currency_manager'
            - '@security.token_storage'
            - '@oro_website.manager'
            - '@oro_api.doctrine_helper'
            - '@oro_api.value_transformer'
        tags:
            - { name: oro.api.processor, action: customize_loaded_data, requestType: frontend, collection: true, class: Oro\Bundle\ProductBundle\Entity\Product }

    oro_pricing.api.product_search.update_depends_on_config_for_minimal_price_field:
        class: Oro\Bundle\PricingBundle\Api\Processor\UpdateDependsOnConfigForMinimalPriceField
        arguments:
            - '@oro_api.doctrine_helper'
        tags:
            - { name: oro.api.processor, action: get_list, group: build_query, requestType: frontend, class: Oro\Bundle\ProductBundle\Api\Model\ProductSearch, priority: -85 }

    oro_pricing.api.product_search.compute_minimal_prices:
        class: Oro\Bundle\PricingBundle\Api\Processor\ComputeProductSearchMinimalPrices
        arguments:
            - '@oro_api.value_transformer'
            - '@oro_pricing.user_currency_manager'
        tags:
            - { name: oro.api.processor, action: customize_loaded_data, requestType: frontend, class: Oro\Bundle\ProductBundle\Api\Model\ProductSearch }
