services:
    #Jobs
    akeneo.pim.automation.data_quality_insights.job.prepare_evaluations:
        class: '%pim_connector.job.simple_job.class%'
        arguments:
            - 'data_quality_insights_prepare_evaluations'
            - '@event_dispatcher'
            - '@akeneo_batch.job_repository'
            -
                - '@akeneo.pim.automation.data_quality_insights.connector.step.prepare_products_criteria_evaluation'
                - '@akeneo.pim.automation.data_quality_insights.connector.step.prepare_product_models_criteria_evaluation'
            - true
            - false
        tags:
            - { name: akeneo_batch.job, connector: 'Data Quality Insights Connector', type: 'data_quality_insights' }

    akeneo.pim.automation.data_quality_insights.job.evaluations:
        class: '%pim_connector.job.simple_job.class%'
        arguments:
            - 'data_quality_insights_evaluations'
            - '@event_dispatcher'
            - '@akeneo_batch.job_repository'
            -
                - '@akeneo.pim.automation.data_quality_insights.connector.step.evaluate_products_and_product_models_criteria'
            - true
            - false
        tags:
            - { name: akeneo_batch.job, connector: 'Data Quality Insights Connector', type: 'data_quality_insights' }

    akeneo.pim.automation.data_quality_insights.job.periodic_tasks:
        class: '%pim_connector.job.simple_job.class%'
        arguments:
            - 'data_quality_insights_periodic_tasks'
            - '@event_dispatcher'
            - '@akeneo_batch.job_repository'
            -
                - '@akeneo.pim.automation.data_quality_insights.connector.step.purge_outdated_data'
                - '@akeneo.pim.automation.data_quality_insights.connector.step.consolidate_dashboard_rates'
            - true
            - false
        tags:
            - { name: akeneo_batch.job, connector: 'Data Quality Insights Connector', type: 'data_quality_insights' }

    akeneo.pim.automation.data_quality_insights.job.recompute_products_scores:
        class: '%pim_connector.job.simple_job.class%'
        arguments:
            - 'data_quality_insights_recompute_products_scores'
            - '@event_dispatcher'
            - '@akeneo_batch.job_repository'
            -
                - '@akeneo.pim.automation.data_quality_insights.connector.step.recompute_products_scores'
            - true
            - false
        tags:
            - { name: akeneo_batch.job, connector: 'Data Quality Insights Connector', type: 'data_quality_insights' }

    #Steps
    akeneo.pim.automation.data_quality_insights.connector.step.recompute_products_scores:
        class: '%pim_connector.step.tasklet.class%'
        arguments:
            - 'recompute_product_scores'
            - '@event_dispatcher'
            - '@akeneo_batch.job_repository'
            - '@akeneo.pim.automation.data_quality_insights.connector.tasklet.recompute_products_scores'

    akeneo.pim.automation.data_quality_insights.connector.step.evaluate_products_and_product_models_criteria:
        class: '%pim_connector.step.tasklet.class%'
        arguments:
            - 'evaluate_products_and_product_models_criteria'
            - '@event_dispatcher'
            - '@akeneo_batch.job_repository'
            - '@akeneo.pim.automation.data_quality_insights.connector.tasklet.evaluate_products_and_product_models_criteria'

    akeneo.pim.automation.data_quality_insights.connector.step.prepare_products_criteria_evaluation:
        class: '%pim_connector.step.tasklet.class%'
        arguments:
            - 'prepare_products_criteria_evaluation'
            - '@event_dispatcher'
            - '@akeneo_batch.job_repository'
            - '@akeneo.pim.automation.data_quality_insights.infrastructure.connector.tasklet.prepare_products_criteria_evaluation'

    akeneo.pim.automation.data_quality_insights.connector.step.prepare_product_models_criteria_evaluation:
        class: '%pim_connector.step.tasklet.class%'
        arguments:
            - 'prepare_product_models_criteria_evaluation'
            - '@event_dispatcher'
            - '@akeneo_batch.job_repository'
            - '@akeneo.pim.automation.data_quality_insights.infrastructure.connector.tasklet.prepare_product_models_criteria_evaluation'

    akeneo.pim.automation.data_quality_insights.connector.step.consolidate_dashboard_rates:
        class: '%pim_connector.step.tasklet.class%'
        arguments:
            - 'consolidate_dashboard_rates'
            - '@event_dispatcher'
            - '@akeneo_batch.job_repository'
            - '@Akeneo\Pim\Automation\DataQualityInsights\Infrastructure\Connector\Tasklet\ConsolidateDashboardRatesTasklet'

    akeneo.pim.automation.data_quality_insights.connector.step.purge_outdated_data:
        class: '%pim_connector.step.tasklet.class%'
        arguments:
            - 'purge_outdated_data'
            - '@event_dispatcher'
            - '@akeneo_batch.job_repository'
            - '@Akeneo\Pim\Automation\DataQualityInsights\Infrastructure\Connector\Tasklet\PurgeOutdatedDataTasklet'

    #Tasklets
    akeneo.pim.automation.data_quality_insights.connector.tasklet.recompute_products_scores:
        class: Akeneo\Pim\Automation\DataQualityInsights\Infrastructure\Connector\Tasklet\RecomputeProductScoresTasklet
        arguments:
            - '@Akeneo\Pim\Automation\DataQualityInsights\Application\Consolidation\ConsolidateProductScores'
            - '@database_connection'
            - '@akeneo_batch_queue.launcher.queue_job_launcher'
            - '@akeneo_batch.job.job_instance_repository'
            - '@logger'

    akeneo.pim.automation.data_quality_insights.connector.tasklet.evaluate_products_and_product_models_criteria:
        class: Akeneo\Pim\Automation\DataQualityInsights\Infrastructure\Connector\Tasklet\EvaluateProductsAndProductModelsCriteriaTasklet
        arguments:
            - '@akeneo.pim.automation.data_quality_insights.evaluate_products_pending_criteria'
            - '@Akeneo\Pim\Automation\DataQualityInsights\Application\Consolidation\ConsolidateProductScores'
            - '@Akeneo\Pim\Automation\DataQualityInsights\Infrastructure\Elasticsearch\UpdateProductsIndex'
            - '@akeneo.pim.automation.data_quality_insights.query.get_product_ids_to_evaluate'
            - '@akeneo.pim.automation.data_quality_insights.evaluate_product_models_pending_criteria'
            - '@akeneo.pim.automation.data_quality_insights.query.get_product_model_ids_to_evaluate'

    akeneo.pim.automation.data_quality_insights.infrastructure.connector.tasklet.prepare_products_criteria_evaluation:
        class: Akeneo\Pim\Automation\DataQualityInsights\Infrastructure\Connector\Tasklet\PrepareProductsCriteriaEvaluationTasklet
        arguments:
            - '@akeneo.pim.automation.data_quality_insights.mark_product_criteria_to_evaluate'
            - '@logger'

    akeneo.pim.automation.data_quality_insights.infrastructure.connector.tasklet.prepare_product_models_criteria_evaluation:
        class: Akeneo\Pim\Automation\DataQualityInsights\Infrastructure\Connector\Tasklet\PrepareProductModelsCriteriaEvaluationTasklet
        arguments:
            - '@akeneo.pim.automation.data_quality_insights.mark_product_model_criteria_to_evaluate'
            - '@logger'

    Akeneo\Pim\Automation\DataQualityInsights\Infrastructure\Connector\Tasklet\ConsolidateDashboardRatesTasklet:
        arguments:
            - '@Akeneo\Pim\Automation\DataQualityInsights\Application\Consolidation\ConsolidateDashboardRates'
            - '@logger'

    Akeneo\Pim\Automation\DataQualityInsights\Infrastructure\Connector\Tasklet\PurgeOutdatedDataTasklet:
        arguments:
            - '@Akeneo\Pim\Automation\DataQualityInsights\Application\Consolidation\PurgeOutdatedData'
            - '@logger'

    #Job parameters
    Akeneo\Pim\Automation\DataQualityInsights\Infrastructure\Connector\JobParameters\PrepareEvaluationsParameters:
        tags:
            - { name: akeneo_batch.job.job_parameters.constraint_collection_provider }
            - { name: akeneo_batch.job.job_parameters.default_values_provider }

    Akeneo\Pim\Automation\DataQualityInsights\Infrastructure\Connector\JobParameters\PeriodicTasksParameters:
        tags:
            - { name: akeneo_batch.job.job_parameters.constraint_collection_provider }
            - { name: akeneo_batch.job.job_parameters.default_values_provider }

    Akeneo\Pim\Automation\DataQualityInsights\Infrastructure\Connector\JobParameters\RecomputeProductScoresParameters:
        tags:
            - { name: akeneo_batch.job.job_parameters.constraint_collection_provider }
            - { name: akeneo_batch.job.job_parameters.default_values_provider }

    #Job launchers
    Akeneo\Pim\Automation\DataQualityInsights\Infrastructure\Connector\JobLauncher\SchedulePeriodicTasks:
        arguments:
            - '@akeneo_batch_queue.launcher.queue_job_launcher'
            - '@akeneo_batch.job.job_instance_repository'

    Akeneo\Pim\Automation\DataQualityInsights\Infrastructure\Connector\JobLauncher\RunUniqueProcessJob:
        arguments:
            - '@doctrine.orm.entity_manager'
            - '@akeneo_batch_queue.manager.job_execution_manager'
            - '@akeneo_batch.job_repository'
            - '@akeneo_batch_queue.factory.job_execution_message'
            - '@logger'
            - '@akeneo_batch.job.job_registry'
            - '%kernel.project_dir%'
