services:
    akeneo_connectivity.connection.persistence.query.select_connections:
        class: 'Akeneo\Connectivity\Connection\Infrastructure\Persistence\Dbal\Query\DbalSelectConnectionsQuery'
        arguments:
            - '@database_connection'

    akeneo_connectivity.connection.persistence.query.select_connection_with_credentials_by_code:
        class: 'Akeneo\Connectivity\Connection\Infrastructure\Persistence\Dbal\Query\DbalSelectConnectionWithCredentialsByCodeQuery'
        arguments:
            - '@database_connection'

    akeneo_connectivity.connection.persistence.query.select_period_event_count_per_connection:
        class: 'Akeneo\Connectivity\Connection\Infrastructure\Persistence\Dbal\Query\DbalSelectPeriodEventCountPerConnectionQuery'
        arguments:
            - '@database_connection'

    akeneo_connectivity.connection.persistence.query.extract_connections_product_event_count:
        class: Akeneo\Connectivity\Connection\Infrastructure\Persistence\Dbal\Query\DbalExtractConnectionsProductEventCountQuery
        arguments:
            - '@database_connection'
            - '%pim_catalog.entity.product.class%'

    akeneo_connectivity_connection.persistence.query.select_hourly_intervals_to_refresh:
        class: Akeneo\Connectivity\Connection\Infrastructure\Persistence\Dbal\Query\DbalSelectHourlyIntervalsToRefreshQuery
        arguments:
            - '@database_connection'

    akeneo_connectivity_connection.persistence.query.purge_audit_product:
        class: Akeneo\Connectivity\Connection\Infrastructure\Persistence\Dbal\Query\DbalPurgeAuditProductQuery
        arguments:
            - '@database_connection'

    akeneo_connectivity_connection.persistence.query.select_last_connection_business_errors:
        class: Akeneo\Connectivity\Connection\Infrastructure\Persistence\Elasticsearch\Query\ElasticsearchSelectLastConnectionBusinessErrorsQuery
        arguments:
            - '@akeneo_connectivity.client.connection_error'

    akeneo_connectivity_connection.persistence.query.select_all_auditable_connection_code:
        class: Akeneo\Connectivity\Connection\Infrastructure\Persistence\Dbal\Query\SelectAllAuditableConnectionCodeQuery
        arguments:
            - '@database_connection'

    akeneo_connectivity_connection.persistence.query.purge_connection_errors:
        class: Akeneo\Connectivity\Connection\Infrastructure\Persistence\Elasticsearch\Query\PurgeConnectionErrorsQuery
        arguments:
            - '@akeneo_connectivity.client.connection_error'

    akeneo_connectivity_connection.persistence.query.select_error_count_per_connection:
        class: Akeneo\Connectivity\Connection\Infrastructure\Persistence\Dbal\Query\DbalSelectErrorCountPerConnectionQuery
        arguments:
            - '@database_connection'

    akeneo_connectivity_connection.persistence.query.purge_audit_error:
        class: Akeneo\Connectivity\Connection\Infrastructure\Persistence\Dbal\Query\PurgeAuditErrorQuery
        arguments:
            - '@database_connection'

    akeneo_connectivity_connection.persistence.query.select_period_error_count_per_connection:
        class: Akeneo\Connectivity\Connection\Infrastructure\Persistence\Dbal\Query\DbalSelectPeriodErrorCountPerConnectionQuery
        arguments:
            - '@database_connection'

    akeneo_connectivity.connection.persistence.query.select_active_webhooks:
        class: Akeneo\Connectivity\Connection\Infrastructure\Persistence\Dbal\Query\DbalSelectActiveWebhooksQuery
        arguments:
            - '@database_connection'

    akeneo_connectivity.connection.persistence.query.get_connection_webhook:
        class: Akeneo\Connectivity\Connection\Infrastructure\Persistence\Dbal\Query\DbalGetAConnectionWebhookQuery
        arguments:
            - '@database_connection'

    akeneo_connectivity.connection.persistence.query.select_webhook_secret:
        class: Akeneo\Connectivity\Connection\Infrastructure\Persistence\Dbal\Query\DbalSelectWebhookSecretQuery
        arguments:
            - '@database_connection'

    akeneo_connectivity.connection.persistence.query.save_webhook_secret:
        class: Akeneo\Connectivity\Connection\Infrastructure\Persistence\Dbal\Query\DbalSaveWebhookSecretQuery
        arguments:
            - '@database_connection'

    akeneo_connectivity.connection.persistence.query.count_active_event_subscriptions:
        class: Akeneo\Connectivity\Connection\Infrastructure\Persistence\Dbal\Query\DbalCountActiveEventSubscriptionsQuery
        arguments:
            - '@database_connection'

    akeneo_connectivity.connection.persistence.query.select_events_api_request_count_within_last_hour_query:
        class: Akeneo\Connectivity\Connection\Infrastructure\Persistence\Dbal\Query\DbalSelectEventsApiRequestCountWithinLastHourQuery
        arguments:
            - '@database_connection'

    akeneo_connectivity.connection.persistence.query.get_event_subscription_logs_query:
        class: Akeneo\Connectivity\Connection\Infrastructure\Persistence\Elasticsearch\Query\GetAllEventSubscriptionDebugLogsQuery
        arguments:
            - '@akeneo_connectivity.client.events_api_debug'
            - '@akeneo_connectivity.connection.clock'

    akeneo_connectivity_connection.persistence.query.purge_events_api_success_logs:
        class: Akeneo\Connectivity\Connection\Infrastructure\Persistence\Elasticsearch\Query\PurgeEventsApiSuccessLogsQuery
        arguments:
            - '@akeneo_connectivity.client.events_api_debug'

    akeneo_connectivity_connection.persistence.query.purge_events_api_error_logs:
        class: Akeneo\Connectivity\Connection\Infrastructure\Persistence\Elasticsearch\Query\PurgeEventsApiErrorLogsQuery
        arguments:
            - '@akeneo_connectivity.client.events_api_debug'

    akeneo_connectivity.connection.persistence.query.search_event_subscription_debug_logs_query:
        class: Akeneo\Connectivity\Connection\Infrastructure\Persistence\Elasticsearch\Query\SearchEventSubscriptionDebugLogsQuery
        arguments:
            - '@akeneo_connectivity.client.events_api_debug'
            - '@akeneo_connectivity.connection.clock'
            - '@akeneo_connectivity.connection.encrypter'
