services:
  _defaults:
    public: true

  prestashop.adapter.feature.command_handler.add_feature_handler:
    class: PrestaShop\PrestaShop\Adapter\Feature\CommandHandler\AddFeatureHandler
    tags:
      - { name: tactician.handler, command: PrestaShop\PrestaShop\Core\Domain\Feature\Command\AddFeatureCommand }

  prestashop.adapter.feature.command_handler.edit_feature_handler:
    class: PrestaShop\PrestaShop\Adapter\Feature\CommandHandler\EditFeatureHandler
    tags:
      - { name: tactician.handler, command: PrestaShop\PrestaShop\Core\Domain\Feature\Command\EditFeatureCommand }

  prestashop.adapter.feature.query_handler.get_feature_for_editing:
    class: PrestaShop\PrestaShop\Adapter\Feature\QueryHandler\GetFeatureForEditingHandler
    tags:
      - { name: tactician.handler, command: PrestaShop\PrestaShop\Core\Domain\Feature\Query\GetFeatureForEditing }

  prestashop.adapter.feature.command_handler.add_feature_value_handler:
      class: PrestaShop\PrestaShop\Adapter\Feature\CommandHandler\AddFeatureValueHandler
      arguments:
          - '@prestashop.adapter.feature.repository.feature_repository'
          - '@prestashop.adapter.feature.repository.feature_value_repository'
      tags:
          - { name: tactician.handler, command: PrestaShop\PrestaShop\Core\Domain\Feature\Command\AddFeatureValueCommand }

  prestashop.adapter.feature.command_handler.edit_feature_value_handler:
      class: PrestaShop\PrestaShop\Adapter\Feature\CommandHandler\EditFeatureValueHandler
      arguments:
          - '@prestashop.adapter.feature.repository.feature_value_repository'
      tags:
          - { name: tactician.handler, command: PrestaShop\PrestaShop\Core\Domain\Feature\Command\EditFeatureValueCommand }

  prestashop.adapter.feature.query_handler.get_feature_value_for_editing:
      class: PrestaShop\PrestaShop\Adapter\Feature\QueryHandler\GetFeatureValueForEditingHandler
      arguments:
          - '@prestashop.adapter.feature.repository.feature_value_repository'
      tags:
          - { name: tactician.handler, command: PrestaShop\PrestaShop\Core\Domain\Feature\Query\GetFeatureValueForEditing }

  prestashop.adapter.feature.repository.feature_repository:
      class: PrestaShop\PrestaShop\Adapter\Feature\Repository\FeatureRepository
      arguments:
          - '@doctrine.dbal.default_connection'
          - '%database_prefix%'

  prestashop.adapter.feature.validate.feature_value_validator:
      class: PrestaShop\PrestaShop\Adapter\Feature\Validate\FeatureValueValidator

  prestashop.adapter.feature.repository.feature_value_repository:
      class: PrestaShop\PrestaShop\Adapter\Feature\Repository\FeatureValueRepository
      arguments:
          - '@doctrine.dbal.default_connection'
          - '%database_prefix%'
          - '@prestashop.adapter.feature.validate.feature_value_validator'
