services:
    oro_contact_us_bridge.contact_request_type:
        class: 'Oro\Bridge\ContactUs\Form\Type\ContactRequestType'
        arguments:
            - '@doctrine'
            - '@oro_security.token_accessor'
            - '@oro_locale.helper.localization'
        tags:
            - { name: form.type }

    oro_contact_us_bridge.event_listener.contact_request_datagrid:
        class: 'Oro\Bridge\ContactUs\EventListener\ContactRequestDatagridListener'
        tags:
            - { name: kernel.event_listener, event: oro_datagrid.datagrid.build.before.orcrm-contact-requests-grid, method: onBuildBefore }

    oro_contact_us_bridge.event_listener.contact_request_view:
        class: 'Oro\Bridge\ContactUs\EventListener\ContactRequestViewListener'
        tags:
            - { name: kernel.event_listener, event: oro_ui.scroll_data.before.contactRequestView, method: onView }

    oro_contact_us_bridge.event_listener.system_config.consent_contact_reason:
        class: Oro\Bundle\ConfigBundle\EventListener\EntitySystemConfigListener
        arguments:
            - '@doctrine'
            - 'Oro\Bundle\ContactUsBundle\Entity\ContactReason'
            - 'oro_contact_us_bridge.consent_contact_reason'
        tags:
            - { name: kernel.event_listener, event: oro_config.settings_form_preset, method: onFormPreSetData }
            - { name: kernel.event_listener, event: oro_config.settings_before_save, method: onSettingsSaveBefore }

    oro_contact_us_bridge.event_listener.reset_consent_contact_reason_system_config:
        class: Oro\Bridge\ContactUs\EventListener\ResetConsentContactReasonSystemConfigListener
        arguments:
            - '@oro_config.global'
        tags:
            - { name: doctrine.orm.entity_listener, entity: Oro\Bundle\ContactUsBundle\Entity\ContactReason, event: preRemove, method: onPreRemove}

    oro_contact_us_bridge.helper.contact_request:
        class: 'Oro\Bridge\ContactUs\Helper\ContactRequestHelper'
        arguments:
            - '@oro_entity.doctrine_helper'
            - '@oro_config.manager'
            - '@oro_locale.helper.localization'
            - '@translator'
            - '@property_accessor'

    oro_contact_us_bridge.event_listener.declined_consents:
        class: 'Oro\Bridge\ContactUs\EventListener\DeclinedConsentsEventListener'
        arguments:
            - '@oro_contact_us_bridge.helper.contact_request'
            - '@doctrine'
        tags:
            - { name: kernel.event_listener, event: oro_consent.event.consents_declined, method: onDecline }

    oro_contact_us.content_widget.contact_us_form:
        class: 'Oro\Bridge\ContactUs\ContentWidget\ContactUsFormContentWidgetType'
        arguments:
            - '@form.factory'
            - '@router'
            - '@request_stack'
        tags:
            - { name: oro_cms.content_widget.type }
