services:
    oro_api.update.processor:
        class: Oro\Bundle\ApiBundle\Processor\UpdateProcessor
        arguments:
            - '@oro_api.processor_bag'
            - update
            - '@oro_api.config_provider'
            - '@oro_api.metadata_provider'

    #
    # initialize
    #

    oro_api.update.initialize_config_extras:
        class: Oro\Bundle\ApiBundle\Processor\Update\InitializeConfigExtras
        tags:
            - { name: oro.api.processor, action: update, group: initialize, priority: 10 }

    #
    # resource_check
    #

    #
    # normalize_input
    #

    oro_api.update.json_api.validate_request_data:
        class: Oro\Bundle\ApiBundle\Processor\Update\JsonApi\ValidateRequestData
        arguments:
            - '@oro_api.value_normalizer'
        tags:
            - { name: oro.api.processor, action: update, group: normalize_input, requestType: json_api, priority: 90 }

    oro_api.update.json_api.disable_upsert_operation:
        class: Oro\Bundle\ApiBundle\Processor\Update\JsonApi\DisableUpsertOperation
        tags:
            - { name: oro.api.processor, action: update, group: normalize_input, requestType: json_api, priority: 45 }

    #
    # security_check
    #

    oro_api.update.validate_entity_type_access:
        class: Oro\Bundle\ApiBundle\Processor\Shared\ValidateEntityTypeAccess
        arguments:
            - '@security.authorization_checker'
            - '@oro_api.doctrine_helper'
            - '@oro_security.acl.group_provider.chain'
            - EDIT
        tags:
            - { name: oro.api.processor, action: update, group: security_check, priority: 10 }

    #
    # load_data
    #

    oro_api.update.load_upsert_entity:
        class: Oro\Bundle\ApiBundle\Processor\Update\JsonApi\LoadUpsertEntity
        arguments:
            - '@oro_api.doctrine_helper'
            - '@oro_api.acl_protected_entity_loader'
            - '@oro_api.entity_instantiator'
            - '@oro_api.entity_id_helper'
        tags:
            - { name: oro.api.processor, action: update, group: load_data, requestType: json_api, priority: -5 }

    #
    # data_security_check
    #

    oro_api.update.validate_entity_object_access:
        class: Oro\Bundle\ApiBundle\Processor\Shared\ValidateEntityObjectAccess
        arguments:
            - '@security.authorization_checker'
            - EDIT
        tags:
            - { name: oro.api.processor, action: update, group: data_security_check, priority: 10 }

    #
    # transform_data
    #

    #
    # save_data
    #

    oro_api.update.persist_entity:
        class: Oro\Bundle\ApiBundle\Processor\Update\PersistEntity
        arguments:
            - '@oro_api.doctrine_helper'
        tags:
            - { name: oro.api.processor, action: update, group: save_data, priority: -8 }

    oro_api.update.save_entity:
        class: Oro\Bundle\ApiBundle\Processor\Update\SaveEntity
        arguments:
            - '@oro_api.doctrine_helper'
            - '@oro_api.save_data_handler'
        tags:
            - { name: oro.api.processor, action: update, group: save_data, priority: -10 }

    oro_api.update.set_entity_id_to_context:
        class: Oro\Bundle\ApiBundle\Processor\Update\SetEntityIdToContext
        tags:
            - { name: oro.api.processor, action: update, group: save_data, priority: -20 }

    #
    # normalize_data
    #

    oro_api.update.load_normalized_entity:
        class: Oro\Bundle\ApiBundle\Processor\Shared\LoadNormalizedEntity
        arguments:
            - '@oro_api.action_processor_bag'
        tags:
            - { name: oro.api.processor, action: update, group: normalize_data, priority: -10 }

    #
    # finalize
    #

    #
    # normalize_result
    #
