services:

    akeneo.pim.automation.data_quality_insights.query.get_product_criteria_evaluations:
        class: Akeneo\Pim\Automation\DataQualityInsights\Infrastructure\Persistence\Query\ProductEvaluation\GetCriteriaEvaluationsByProductIdQuery
        arguments:
            - '@database_connection'
            - '@Akeneo\Pim\Automation\DataQualityInsights\Infrastructure\Clock\SystemClock'
            - '@Akeneo\Pim\Automation\DataQualityInsights\Infrastructure\Persistence\Transformation\TransformCriterionEvaluationResultIds'
            - '%akeneo.pim.automation.data_quality_insights.persistence.product_criterion_evaluation_table%'

    akeneo.pim.automation.data_quality_insights.query.get_product_model_criteria_evaluations:
        class: Akeneo\Pim\Automation\DataQualityInsights\Infrastructure\Persistence\Query\ProductEvaluation\GetCriteriaEvaluationsByProductIdQuery
        arguments:
            - '@database_connection'
            - '@Akeneo\Pim\Automation\DataQualityInsights\Infrastructure\Clock\SystemClock'
            - '@Akeneo\Pim\Automation\DataQualityInsights\Infrastructure\Persistence\Transformation\TransformCriterionEvaluationResultIds'
            - '%akeneo.pim.automation.data_quality_insights.persistence.product_model_criterion_evaluation_table%'

    Akeneo\Pim\Automation\DataQualityInsights\Infrastructure\Persistence\Query\Structure\CachedGetLocalesByChannelQuery:
        arguments:
            - '@database_connection'

    akeneo.pim.automation.data_quality_insights.query.get_up_to_date_product_criteria_evaluations:
        class: Akeneo\Pim\Automation\DataQualityInsights\Infrastructure\Persistence\Query\ProductEvaluation\GetUpToDateCriteriaEvaluationsByProductIdQuery
        arguments:
            - '@akeneo.pim.automation.data_quality_insights.query.get_product_criteria_evaluations'
            - '@Akeneo\Pim\Automation\DataQualityInsights\Infrastructure\Persistence\Query\ProductEvaluation\HasUpToDateProductEvaluationQuery'

    akeneo.pim.automation.data_quality_insights.query.get_up_to_date_product_model_criteria_evaluations:
        class: Akeneo\Pim\Automation\DataQualityInsights\Infrastructure\Persistence\Query\ProductEvaluation\GetUpToDateCriteriaEvaluationsByProductIdQuery
        arguments:
            - '@akeneo.pim.automation.data_quality_insights.query.get_product_model_criteria_evaluations'
            - '@Akeneo\Pim\Automation\DataQualityInsights\Infrastructure\Persistence\Query\ProductEvaluation\HasUpToDateProductModelEvaluationQuery'

    Akeneo\Pim\Automation\DataQualityInsights\Infrastructure\Persistence\Query\ProductEvaluation\HasUpToDateProductEvaluationQuery:
        arguments:
            - '@database_connection'

    Akeneo\Pim\Automation\DataQualityInsights\Infrastructure\Persistence\Query\ProductEvaluation\HasUpToDateProductModelEvaluationQuery:
        arguments:
            - '@database_connection'

    Akeneo\Pim\Automation\DataQualityInsights\Infrastructure\Persistence\Query\Dashboard\GetDashboardScoresQuery:
        arguments:
            - '@database_connection'

    Akeneo\Pim\Automation\DataQualityInsights\Infrastructure\Persistence\Query\Dashboard\GetAverageRanksQuery:
        arguments:
            - '@database_connection'

    Akeneo\Pim\Automation\DataQualityInsights\Infrastructure\Persistence\Query\Dashboard\GetRanksDistributionFromProductScoresQuery:
        arguments:
            - '@database_connection'
            - '@akeneo_elasticsearch.client.product_and_product_model'
            - '@Akeneo\Pim\Automation\DataQualityInsights\Infrastructure\Persistence\Query\Structure\GetCategoryChildrenCodesQuery'
            - '@pim_channel.query.sql.get_channel_code_with_locale_codes'

    Akeneo\Pim\Automation\DataQualityInsights\Infrastructure\Persistence\Query\Structure\GetCategoryChildrenCodesQuery:
        arguments:
            - '@database_connection'

    Akeneo\Pim\Automation\DataQualityInsights\Infrastructure\Persistence\Query\Structure\GetAllFamilyCodesQuery:
        arguments:
            - '@database_connection'

    Akeneo\Pim\Automation\DataQualityInsights\Infrastructure\Persistence\Query\Structure\GetAllCategoryCodesQuery:
        arguments:
            - '@database_connection'

    akeneo.pim.automation.data_quality_insights.query.get_product_pending_criteria_evaluations:
        class: Akeneo\Pim\Automation\DataQualityInsights\Infrastructure\Persistence\Query\ProductEvaluation\GetPendingCriteriaEvaluationsByProductIdsQuery
        arguments:
            - '@database_connection'
            - '@Akeneo\Pim\Automation\DataQualityInsights\Infrastructure\Clock\SystemClock'
            - '%akeneo.pim.automation.data_quality_insights.persistence.product_criterion_evaluation_table%'

    akeneo.pim.automation.data_quality_insights.query.get_product_model_pending_criteria_evaluations:
        class: Akeneo\Pim\Automation\DataQualityInsights\Infrastructure\Persistence\Query\ProductEvaluation\GetPendingCriteriaEvaluationsByProductIdsQuery
        arguments:
            - '@database_connection'
            - '@Akeneo\Pim\Automation\DataQualityInsights\Infrastructure\Clock\SystemClock'
            - '%akeneo.pim.automation.data_quality_insights.persistence.product_model_criterion_evaluation_table%'

    Akeneo\Pim\Automation\DataQualityInsights\Infrastructure\Persistence\Query\ProductEvaluation\GetLatestProductScoresQuery:
        arguments:
            - '@database_connection'

    Akeneo\Pim\Automation\DataQualityInsights\Infrastructure\Persistence\Query\ProductEvaluation\GetUpToDateLatestProductScoresQuery:
        arguments:
            - '@Akeneo\Pim\Automation\DataQualityInsights\Infrastructure\Persistence\Query\ProductEvaluation\HasUpToDateProductEvaluationQuery'
            - '@Akeneo\Pim\Automation\DataQualityInsights\Infrastructure\Persistence\Query\ProductEvaluation\GetLatestProductScoresQuery'

    akeneo.pim.automation.data_quality_insights.query.get_evaluable_product_values:
        class: Akeneo\Pim\Automation\DataQualityInsights\Infrastructure\Persistence\Query\ProductEnrichment\GetEvaluableProductValuesQuery
        arguments:
            - '@Akeneo\Pim\Automation\DataQualityInsights\Infrastructure\Persistence\Query\ProductEnrichment\GetProductRawValuesQuery'
            - '@Akeneo\Pim\Automation\DataQualityInsights\Infrastructure\Persistence\Query\ProductEvaluation\GetEvaluableAttributesByProductQuery'
            - '@Akeneo\Pim\Automation\DataQualityInsights\Infrastructure\Persistence\Query\Structure\CachedGetLocalesByChannelQuery'

    akeneo.pim.automation.data_quality_insights.query.get_evaluable_product_model_values:
        class: Akeneo\Pim\Automation\DataQualityInsights\Infrastructure\Persistence\Query\ProductEnrichment\GetEvaluableProductValuesQuery
        arguments:
            - '@Akeneo\Pim\Automation\DataQualityInsights\Infrastructure\Persistence\Query\ProductEnrichment\GetProductModelRawValuesQuery'
            - '@Akeneo\Pim\Automation\DataQualityInsights\Infrastructure\Persistence\Query\ProductEvaluation\GetEvaluableAttributesByProductModelQuery'
            - '@Akeneo\Pim\Automation\DataQualityInsights\Infrastructure\Persistence\Query\Structure\CachedGetLocalesByChannelQuery'

    Akeneo\Pim\Automation\DataQualityInsights\Infrastructure\Persistence\Query\ProductEnrichment\GetProductRawValuesQuery:
        arguments:
            - '@database_connection'

    Akeneo\Pim\Automation\DataQualityInsights\Infrastructure\Persistence\Query\ProductEvaluation\GetEvaluableAttributesByProductQuery:
        arguments:
            - '@database_connection'

    Akeneo\Pim\Automation\DataQualityInsights\Infrastructure\Persistence\Query\ProductEnrichment\GetProductModelRawValuesQuery:
        arguments:
            - '@database_connection'

    Akeneo\Pim\Automation\DataQualityInsights\Infrastructure\Persistence\Query\ProductEvaluation\GetEvaluableAttributesByProductModelQuery:
        arguments:
            - '@database_connection'

    Akeneo\Pim\Automation\DataQualityInsights\Infrastructure\Persistence\Query\ProductEnrichment\GetProductIdentifierFromProductIdQuery:
        arguments:
            - '@database_connection'

    Akeneo\Pim\Automation\DataQualityInsights\Infrastructure\Persistence\Query\Completeness\GetNonRequiredAttributesMasksQuery:
        arguments:
            - '@database_connection'

    Akeneo\Pim\Automation\DataQualityInsights\Infrastructure\Persistence\Query\Completeness\GetRequiredAttributesMasksQuery:
        arguments:
            - '@database_connection'

    Akeneo\Pim\Automation\DataQualityInsights\Infrastructure\Persistence\Query\Completeness\GetRequiredProductModelAttributesMaskQuery:
        arguments:
            - '@database_connection'

    Akeneo\Pim\Automation\DataQualityInsights\Infrastructure\Persistence\Query\Completeness\GetNonRequiredProductModelAttributesMaskQuery:
        arguments:
            - '@database_connection'

    akeneo.pim.automation.data_quality_insights.query.get_product_ids_to_evaluate:
        class: Akeneo\Pim\Automation\DataQualityInsights\Infrastructure\Persistence\Query\ProductEvaluation\GetProductIdsToEvaluateQuery
        arguments:
            - '@database_connection'

    akeneo.pim.automation.data_quality_insights.query.get_product_model_ids_to_evaluate:
        class: Akeneo\Pim\Automation\DataQualityInsights\Infrastructure\Persistence\Query\ProductEvaluation\GetProductModelIdsToEvaluateQuery
        arguments:
            - '@database_connection'

    Akeneo\Pim\Automation\DataQualityInsights\Infrastructure\Persistence\Query\ProductEnrichment\GetProductIdsFromProductIdentifiersQuery:
        arguments:
            - '@database_connection'

    Akeneo\Pim\Automation\DataQualityInsights\Infrastructure\Persistence\Query\Structure\GetAttributeGroupActivationQuery:
        arguments:
            - '@database_connection'

    Akeneo\Pim\Automation\DataQualityInsights\Infrastructure\Persistence\Query\Structure\GetAllAttributeGroupsActivationQuery:
        arguments:
            - '@database_connection'

    Akeneo\Pim\Automation\DataQualityInsights\Infrastructure\Persistence\Query\ProductEvaluation\GetProductIdsImpactedByAttributeGroupActivationQuery:
        arguments:
            - '@database_connection'

    Akeneo\Pim\Automation\DataQualityInsights\Infrastructure\Persistence\Query\ProductEvaluation\GetProductModelIdsImpactedByAttributeGroupActivationQuery:
        arguments:
            - '@database_connection'

    Akeneo\Pim\Automation\DataQualityInsights\Infrastructure\Persistence\Query\ProductEvaluation\GetEvaluationRatesByProductsAndCriterionQuery:
        arguments:
            - '@database_connection'
            - '@Akeneo\Pim\Automation\DataQualityInsights\Infrastructure\Persistence\Transformation\TransformCriterionEvaluationResultIds'

    Akeneo\Pim\Automation\DataQualityInsights\Infrastructure\Persistence\Query\KeyIndicator\ComputeProductsEnrichmentStatusQuery:
        arguments:
            - '@database_connection'
            - '@Akeneo\Pim\Automation\DataQualityInsights\Infrastructure\Persistence\Query\Structure\CachedGetLocalesByChannelQuery'
            - '@Akeneo\Pim\Automation\DataQualityInsights\Infrastructure\Persistence\Transformation\Channels'
            - '@Akeneo\Pim\Automation\DataQualityInsights\Infrastructure\Persistence\Transformation\Locales'
        tags:
            - { name:  akeneo.pim.automation.data_quality_insights.compute_key_indicator_query}

    Akeneo\Pim\Automation\DataQualityInsights\Infrastructure\Persistence\Query\KeyIndicator\ComputeProductsWithImageQuery:
        arguments:
            - '@Akeneo\Pim\Automation\DataQualityInsights\Infrastructure\Persistence\Query\ProductEvaluation\GetEvaluationRatesByProductsAndCriterionQuery'
        tags:
            - { name:  akeneo.pim.automation.data_quality_insights.compute_key_indicator_query}

    akeneo.pim.automation.data_quality_insights.query.product.get_enrichment_images_masks:
        class: Akeneo\Pim\Automation\DataQualityInsights\Infrastructure\Persistence\Query\Completeness\GetAttributeTypesMasksQuery
        arguments:
            $connection: '@database_connection'
            $attributeTypes:
                - !php/const Akeneo\Pim\Structure\Component\AttributeTypes::IMAGE

    akeneo.pim.automation.data_quality_insights.query.product_model.get_enrichment_images_masks:
        class: Akeneo\Pim\Automation\DataQualityInsights\Infrastructure\Persistence\Query\Completeness\GetAttributeTypesProductModelMasksQuery
        arguments:
            $connection: '@database_connection'
            $attributeTypes:
                - !php/const Akeneo\Pim\Structure\Component\AttributeTypes::IMAGE

    Akeneo\Pim\Automation\DataQualityInsights\Infrastructure\Persistence\Query\Dashboard\GetCatalogProductScoreEvolutionQuery:
        arguments:
            - '@database_connection'
            - '@Akeneo\Pim\Automation\DataQualityInsights\Infrastructure\Clock\SystemClock'

    Akeneo\Pim\Automation\DataQualityInsights\Infrastructure\Persistence\Query\ProductEvaluation\GetLatestProductScoresByIdentifiersQuery:
        arguments:
            - '@database_connection'
