parameters:
    orocrm_account.account.entity.class:            OroCRM\Bundle\AccountBundle\Entity\Account
    orocrm_account.type.account.class:              OroCRM\Bundle\AccountBundle\Form\Type\AccountType
    orocrm_account.handler.account.class:           OroCRM\Bundle\AccountBundle\Form\Handler\AccountHandler
    orocrm_account.form.type.account_select.class:  OroCRM\Bundle\AccountBundle\Form\Type\AccountSelectType

    orocrm_account.account.manager.api.class:       Oro\Bundle\SoapBundle\Entity\Manager\ApiEntityManager
    orocrm_account.type.account.api.class:          OroCRM\Bundle\AccountBundle\Form\Type\AccountApiType

    orocrm_account.activity_widget_provider.class:  %oro_activity.widget_provider.activities.menu.class%

services:
    orocrm_account.form.account:
        class:                                      Symfony\Component\Form\Form
        factory_method: createNamed
        factory_service: form.factory
        arguments: ["orocrm_account_form", "orocrm_account", null]

    orocrm_account.form.type.account:
        class:                                      %orocrm_account.type.account.class%
        arguments:
            - @router
            - @oro_locale.formatter.name
            - @oro_security.security_facade
        tags:
            - { name: form.type, alias: orocrm_account }

    orocrm_account.form.handler.account:
        class:                                      %orocrm_account.handler.account.class%
        scope: request
        arguments:
            - @orocrm_account.form.account
            - @request
            - @doctrine.orm.entity_manager
        tags:
            - { name: oro_tag.tag_manager }

    # Form type
    orocrm_account.form.type.account_select:
        class:                                      %orocrm_account.form.type.account_select.class%
        tags:
            - { name: form.type, alias: orocrm_account_select }

    # Account API
    orocrm_account.account.manager.api:
        class:                                      %orocrm_account.account.manager.api.class%
        parent: oro_soap.manager.entity_manager.abstract
        arguments:
            - %orocrm_account.account.entity.class%
            - @doctrine.orm.entity_manager

    orocrm_account.form.type.account.api:
        class:                                      %orocrm_account.type.account.api.class%
        arguments:
            - @router
            - @oro_locale.formatter.name
            - @oro_security.security_facade
        tags:
            - { name: form.type, alias: account }

    orocrm_account.form.account.api:
        class:                                      Symfony\Component\Form\Form
        factory_method: createNamed
        factory_service: form.factory
        arguments: ["account", "account", null]

    orocrm_account.form.handler.account.api:
        class:                                      %orocrm_account.handler.account.class%
        scope: request
        arguments:
            - @orocrm_account.form.account.api
            - @request
            - @doctrine.orm.entity_manager
        tags:
            - { name: oro_tag.tag_manager }

    orocrm_account.form.autocomplete.account.search_handler:
        parent: oro_form.autocomplete.search_handler
        arguments:
            - %orocrm_account.account.entity.class%
            - ["name"]
        tags:
            - { name: oro_form.autocomplete.search_handler, alias: accounts, acl_resource: orocrm_account_view }

    orocrm_account.activity_widget_provider:
        class: %orocrm_account.activity_widget_provider.class%
        arguments:
           - @oro_entity.entity_identifier_accessor
           - @oro_ui.twig.tab_extension
           - 'account_activity_tab_panel'
           - %orocrm_account.account.entity.class%
        tags:
           - { name: oro_activity.activity_widget_provider, priority: -10 }
