parameters:
    orocrm_sales.opportunity.class:                          OroCRM\Bundle\SalesBundle\Entity\Opportunity
    orocrm_sales.opportunity.manager.api.class:              Oro\Bundle\SoapBundle\Entity\Manager\ApiEntityManager

    orocrm_sales.lead.entity.class:                          OroCRM\Bundle\SalesBundle\Entity\Lead
    orocrm_sales.lead.manager.api.class:                     Oro\Bundle\SoapBundle\Entity\Manager\ApiEntityManager

    orocrm_sales.lead.datagrid_helper.class:                 Oro\Bundle\AddressBundle\Datagrid\CountryDatagridHelper

    orocrm_sales.salesfunnel.entity.class:                   OroCRM\Bundle\SalesBundle\Entity\SalesFunnel
    orocrm_sales.salesfunnel.manager.api.class:              Oro\Bundle\SoapBundle\Entity\Manager\ApiEntityManager

    orocrm_sales.b2bcustomer.entity.class:                   OroCRM\Bundle\SalesBundle\Entity\B2bCustomer
    orocrm_sales.b2bcustomer.manager.api.class:              Oro\Bundle\SoapBundle\Entity\Manager\ApiEntityManager

    orocrm_sales.event_listener.b2bcustomer_lifetime.class:  OroCRM\Bundle\SalesBundle\EventListener\B2bCustomerLifetimeListener
services:
    orocrm_sales.opportunity.manager.api:
        class: %orocrm_sales.opportunity.manager.api.class%
        parent: oro_soap.manager.entity_manager.abstract
        arguments:
            - %orocrm_sales.opportunity.class%
            - @doctrine.orm.entity_manager

    orocrm_sales.lead.manager.api:
        class: %orocrm_sales.lead.manager.api.class%
        parent: oro_soap.manager.entity_manager.abstract
        arguments:
            - %orocrm_sales.lead.entity.class%
            - @doctrine.orm.entity_manager

    orocrm_sales.salesfunnel.manager.api:
        class: %orocrm_sales.salesfunnel.manager.api.class%
        parent: oro_soap.manager.entity_manager.abstract
        arguments:
            - %orocrm_sales.salesfunnel.entity.class%
            - @doctrine.orm.entity_manager

    orocrm_sales.lead.datagrid_helper:
        class: %orocrm_sales.lead.datagrid_helper.class%

    orocrm_sales.form.autocomplete.opportunity.search_handler:
        parent: orocrm_channel.autocomplete.channel_limitation_handler
        arguments:
            - %orocrm_sales.opportunity.class%
            - ["name"]
        tags:
            - { name: oro_form.autocomplete.search_handler, alias: opportunities, acl_resource: orocrm_sales_opportunity_view }
        lazy: true

    orocrm_sales.form.autocomplete.lead.search_handler:
        parent: orocrm_channel.autocomplete.channel_limitation_handler
        arguments:
            - %orocrm_sales.lead.entity.class%
            - ["name"]
        tags:
            - { name: oro_form.autocomplete.search_handler, alias: leads, acl_resource: orocrm_sales_lead_view }
        lazy: true

    orocrm_sales.form.autocomplete.b2bcustomer.search_handler:
        parent: orocrm_channel.autocomplete.channel_limitation_handler
        arguments:
            - %orocrm_sales.b2bcustomer.entity.class%
            - ["name"]
        tags:
            - { name: oro_form.autocomplete.search_handler, alias: b2b_customers, acl_resource: orocrm_sales_b2bcustomer_view }
        lazy: true

    orocrm_sales.provider.enitity_state:
        parent: orocrm_channel.provider.utils.entity_state_provider
        arguments:
            - 'OroCRM\Bundle\SalesBundle\Entity'

    orocrm_sales.b2bcustomer.manager.api:
        class: %orocrm_sales.b2bcustomer.manager.api.class%
        parent: oro_soap.manager.entity_manager.abstract
        arguments:
            - %orocrm_sales.b2bcustomer.entity.class%
            - @doctrine.orm.entity_manager

    orocrm_sales.event_listener.b2bcustomer_lifetime:
        class: %orocrm_sales.event_listener.b2bcustomer_lifetime.class%
        tags:
        - { name: doctrine.event_listener, event: onFlush, method: onFlush }
        - { name: doctrine.event_listener, event: postFlush, method: postFlush }
    orocrm_sales.event_listener.account_contacts_grid_listener:
        class: %oro_datagrid.event_listener.base_orm_relation.class%
        arguments:
            - 'accountId'
            - false
        tags:
            - { name: kernel.event_listener, event: oro_datagrid.datagrid.build.after.sales-account-lead-grid, method: onBuildAfter }

    orocrm_sales.event_listener.account_opportunities_grid_listener:
        class: %oro_datagrid.event_listener.base_orm_relation.class%
        arguments:
            - 'accountId'
            - false
        tags:
            - { name: kernel.event_listener, event: oro_datagrid.datagrid.build.after.sales-account-opportunity-grid, method: onBuildAfter }
