services:
  _defaults:
    public: true

  prestashop.core.command_bus:
    alias: PrestaShop\PrestaShop\Core\CommandBus\CommandBusInterface

  PrestaShop\PrestaShop\Core\CommandBus\CommandBusInterface:
    class: PrestaShop\PrestaShop\Core\CommandBus\TacticianCommandBusAdapter
    autowire: true
    public: false
    arguments:
      - '@tactician.commandbus.default'

  prestashop.core.query_bus:
    parent: 'prestashop.core.command_bus'
    public: true

  prestashop.core.provider.command_definition_provider:
    class: 'PrestaShop\PrestaShop\Core\CommandBus\Parser\CommandDefinitionParser'

  prestashop.core.command_bus.middleware.command_register_middleware:
    class: PrestaShop\PrestaShop\Core\CommandBus\Middleware\CommandRegisterMiddleware
    arguments:
      - '@tactician.handler.locator.symfony'
      - '@tactician.handler.command_name_extractor.class_name'
      - '@prestashop.core.command_bus.executed_command_registry'

  prestashop.core.command_bus.executed_command_registry:
    class: PrestaShop\PrestaShop\Core\CommandBus\ExecutedCommandRegistry
    arguments:
      - '@prestashop.core.command_bus.parser.command_type_parser'

  prestashop.core.command_bus.parser.command_type_parser:
    class: PrestaShop\PrestaShop\Core\CommandBus\Parser\CommandTypeParser
