parameters:
    orocrm_sales.opportunity.form.type.class: OroCRM\Bundle\SalesBundle\Form\Type\OpportunityType
    orocrm_sales.opportunity.form.type.api.class: OroCRM\Bundle\SalesBundle\Form\Type\OpportunityApiType
    orocrm_sales.opportunity.form.handler.class: OroCRM\Bundle\SalesBundle\Form\Handler\OpportunityHandler

    orocrm_sales.lead.form.type.class: OroCRM\Bundle\SalesBundle\Form\Type\LeadType
    orocrm_sales.lead.form.type.api.class: OroCRM\Bundle\SalesBundle\Form\Type\LeadApiType
    orocrm_sales.lead.form.handler.class: OroCRM\Bundle\SalesBundle\Form\Handler\LeadHandler

    orocrm_sales.form.type.lead_select.class:        OroCRM\Bundle\SalesBundle\Form\Type\LeadSelectType
    orocrm_sales.form.type.opportunity_select.class: OroCRM\Bundle\SalesBundle\Form\Type\OpportunitySelectType
    orocrm_sales.form.type.b2bcustomer_select.class: OroCRM\Bundle\SalesBundle\Form\Type\B2bCustomerSelectType

    orocrm_sales.salesfunnel.form.type.class: OroCRM\Bundle\SalesBundle\Form\Type\SalesFunnelType
    orocrm_sales.salesfunnel.form.type.api.class: OroCRM\Bundle\SalesBundle\Form\Type\SalesFunnelApiType
    orocrm_sales.salesfunnel.form.handler.class: OroCRM\Bundle\SalesBundle\Form\Handler\SalesFunnelHandler

    orocrm_sales.b2bcustomer.form.type.class: OroCRM\Bundle\SalesBundle\Form\Type\B2bCustomerType
    orocrm_sales.b2bcustomer.form.handler.class: OroCRM\Bundle\SalesBundle\Form\Handler\B2bCustomerHandler

services:
    orocrm_sales.opportunity.form.type:
        class: %orocrm_sales.opportunity.form.type.class%
        tags:
            - { name: form.type, alias: orocrm_sales_opportunity }

    orocrm_sales.opportunity.form.type.api:
        class: %orocrm_sales.opportunity.form.type.api.class%
        tags:
            - { name: form.type, alias: orocrm_sales_opportunity_api }

    orocrm_sales.opportunity.form:
        class:           Symfony\Component\Form\Form
        factory_method:  createNamed
        factory_service: form.factory
        arguments:
            - "orocrm_sales_opportunity_form"
            - "orocrm_sales_opportunity"

    orocrm_sales.opportunity.form.api:
        class:           Symfony\Component\Form\Form
        factory_method:  createNamed
        factory_service: form.factory
        arguments:
            - "opportunity"
            - "orocrm_sales_opportunity_api"

    orocrm_sales.opportunity.form.handler:
        class: %orocrm_sales.opportunity.form.handler.class%
        scope: request
        arguments:
            - @orocrm_sales.opportunity.form
            - @request
            - @doctrine.orm.entity_manager
            - @orocrm_channel.provider.request_channel

    orocrm_sales.opportunity.form.handler.api:
        class: %orocrm_sales.opportunity.form.handler.class%
        scope: request
        arguments:
            - @orocrm_sales.opportunity.form.api
            - @request
            - @doctrine.orm.entity_manager
            - @orocrm_channel.provider.request_channel

    orocrm_sales.lead.form.type:
        class: %orocrm_sales.lead.form.type.class%
        tags:
            - { name: form.type, alias: orocrm_sales_lead }

    orocrm_sales.lead.form.type.api:
        class: %orocrm_sales.lead.form.type.api.class%
        tags:
            - { name: form.type, alias: orocrm_sales_lead_api }

    orocrm_sales.lead.form:
        class: Symfony\Component\Form\Form
        factory_method: createNamed
        factory_service: form.factory
        arguments:
            - "orocrm_sales_lead_form"
            - "orocrm_sales_lead"

    orocrm_sales.lead.form.api:
        class: Symfony\Component\Form\Form
        factory_method: createNamed
        factory_service: form.factory
        arguments:
            - "lead"
            - "orocrm_sales_lead_api"

    orocrm_sales.lead.form.handler:
        class: %orocrm_sales.lead.form.handler.class%
        scope: request
        arguments:
            - @orocrm_sales.lead.form
            - @request
            - @doctrine.orm.entity_manager
            - @orocrm_channel.provider.request_channel

    orocrm_sales.lead.form.handler.api:
        class: %orocrm_sales.lead.form.handler.class%
        scope: request
        arguments:
            - @orocrm_sales.lead.form.api
            - @request
            - @doctrine.orm.entity_manager
            - @orocrm_channel.provider.request_channel

    orocrm_sales.form.type.opportunity_select:
        class: %orocrm_sales.form.type.opportunity_select.class%
        tags:
            - { name: form.type, alias: orocrm_sales_opportunity_select }

    orocrm_sales.form.type.lead_select:
        class: %orocrm_sales.form.type.lead_select.class%
        tags:
            - { name: form.type, alias: "orocrm_sales_lead_select" }

    orocrm_sales.form.type.b2bcustomer_select:
        class: %orocrm_sales.form.type.b2bcustomer_select.class%
        tags:
            - { name: form.type, alias: orocrm_sales_b2bcustomer_select }

    orocrm_sales.salesfunnel.form.type:
        class: %orocrm_sales.salesfunnel.form.type.class%
        tags:
            - { name: form.type, alias: "orocrm_sales_funnel" }

    orocrm_sales.salesfunnel.form.type.api:
        class: %orocrm_sales.salesfunnel.form.type.api.class%
        tags:
            - { name: form.type, alias: "orocrm_sales_salesfunnel_api" }

    orocrm_sales.salesfunnel.form:
        class: Symfony\Component\Form\Form
        factory_method: createNamed
        factory_service: form.factory
        arguments:
            - "orocrm_sales_salesfunnel_form"
            - "orocrm_sales_funnel"

    orocrm_sales.salesfunnel.form.api:
        class: Symfony\Component\Form\Form
        factory_method: createNamed
        factory_service: form.factory
        arguments:
            - "salesfunnel"
            - "orocrm_sales_salesfunnel_api"

    orocrm_sales.salesfunnel.form.handler:
        class: %orocrm_sales.salesfunnel.form.handler.class%
        scope: request
        arguments:
            - @orocrm_sales.salesfunnel.form
            - @request
            - @doctrine.orm.entity_manager

    orocrm_sales.salesfunnel.form.handler.api:
        class: %orocrm_sales.salesfunnel.form.handler.class%
        scope: request
        arguments:
            - @orocrm_sales.salesfunnel.form.api
            - @request
            - @doctrine.orm.entity_manager

    orocrm_sales.b2bcustomer.form.type:
        class: %orocrm_sales.b2bcustomer.form.type.class%
        tags:
            - { name: form.type, alias: orocrm_sales_b2bcustomer }

    orocrm_sales.b2bcustomer.form:
        class: Symfony\Component\Form\Form
        factory_method: createNamed
        factory_service: form.factory
        arguments:
            - "orocrm_sales_b2bcustomer_form"
            - "orocrm_sales_b2bcustomer"

    orocrm_sales.b2bcustomer.form.handler:
        class: %orocrm_sales.b2bcustomer.form.handler.class%
        scope: request
        arguments:
            - @orocrm_sales.b2bcustomer.form
            - @request
            - @doctrine.orm.entity_manager
            - @orocrm_channel.provider.request_channel
        tags:
            - { name: oro_tag.tag_manager }
