services:
  _defaults:
    public: true

  prestashop.adapter.module.command_handler.bulk_toggle_module_status_handler:
    class: PrestaShop\PrestaShop\Adapter\Module\CommandHandler\BulkToggleModuleStatusHandler
    arguments:
      - '@prestashop.module.manager'
      - '@prestashop.adapter.legacy.logger'
      - '@prestashop.core.cache.clearer.cache_clearer_chain'
    tags:
      - name: 'tactician.handler'
        command: 'PrestaShop\PrestaShop\Core\Domain\Module\Command\BulkToggleModuleStatusCommand'

  prestashop.adapter.module.self_configurator:
    class: PrestaShop\PrestaShop\Adapter\Module\Configuration\ModuleSelfConfigurator
    arguments:
      - "@prestashop.core.admin.module.repository"
      - "@prestashop.adapter.legacy.configuration"
      - "@doctrine.dbal.default_connection"
      - "@filesystem"

  # MODULE TAB MANAGEMENT
  prestashop.adapter.module.tab.register:
    class: PrestaShop\PrestaShop\Adapter\Module\Tab\ModuleTabRegister
    arguments:
      - "@prestashop.core.admin.tab.repository"
      - "@prestashop.core.admin.lang.repository"
      - "@logger"
      - "@translator"
      - "@filesystem"
      - "@=service('prestashop.adapter.legacy.context').getLanguages()"
      - "@routing.loader.yml"

  prestashop.adapter.module.tab.unregister:
    class: PrestaShop\PrestaShop\Adapter\Module\Tab\ModuleTabUnregister
    arguments:
      - "@prestashop.core.admin.tab.repository"
      - "@prestashop.core.admin.lang.repository"
      - "@logger"
      - "@translator"

  prestashop.adapter.module.tab.eventsubscriber:
    class: PrestaShop\PrestaShop\Adapter\Module\Tab\ModuleTabManagementSubscriber
    arguments:
      - "@prestashop.adapter.module.tab.register"
      - "@prestashop.adapter.module.tab.unregister"
    tags:
      - { name: kernel.event_subscriber }

  prestashop.adapter.presenter.module:
    class: PrestaShop\PrestaShop\Adapter\Presenter\Module\ModulePresenter
    arguments: [ "@=service('prestashop.adapter.legacy.context').getContext().currency", "@prestashop.adapter.formatter.price" ]

  prestashop.adapter.module.data_provider.tab_module_list:
    class: PrestaShop\PrestaShop\Adapter\Module\TabModuleListProvider
    deprecated: 'The "%service_id%" service is deprecated since 1.7.8.0 and will be removed in next major.'

  prestashop.adapter.presenter.module.payment:
    class: PrestaShop\PrestaShop\Adapter\Presenter\Module\PaymentModulesPresenter
    arguments:
      - '@prestashop.adapter.presenter.module'
      - '@prestashop.adapter.module.payment_module_provider'

  prestashop.adapter.module.payment_module_provider:
    class: PrestaShop\PrestaShop\Adapter\Module\PaymentModuleListProvider
    arguments:
      - '@prestashop.core.admin.module.repository'
      - '@prestashop.bundle.repository.module'
      - '@=service("prestashop.adapter.legacy.context").getContext().shop.id'

  prestashop.adapter.legacy.module:
    class: PrestaShop\PrestaShop\Adapter\Module\Module

  prestashop.adapter.module.repository.module_repository:
    class: 'PrestaShop\PrestaShop\Adapter\Module\Repository\ModuleRepository'
    arguments:
      - !php/const _PS_ROOT_DIR_
      - !php/const _PS_MODULE_DIR_
