services:
  _defaults:
    public: true

  prestashop.adapter.supplier.provider.supplier_logo:
    class: 'PrestaShop\PrestaShop\Adapter\Supplier\SupplierLogoThumbnailProvider'
    arguments:
      - '@prestashop.core.image.parser.image_tag_source_parser'
      - '@PrestaShop\PrestaShop\Adapter\ImageManager'

  prestashop.adapter.supplier.provider.supplier_address:
    class: 'PrestaShop\PrestaShop\Adapter\Supplier\SupplierAddressProvider'

  prestashop.adapter.supplier.supplier_order_validator:
    class: 'PrestaShop\PrestaShop\Adapter\Supplier\SupplierOrderValidator'
    deprecated:
      package: PrestaShop\PrestaShop
      version: 9.0

  # Command handlers

  prestashop.adapter.supplier.command_handler.abstract_delete_supplier_handler:
    class: 'PrestaShop\PrestaShop\Adapter\Supplier\CommandHandler\AbstractDeleteSupplierHandler'
    abstract: true
    arguments:
      - '@prestashop.adapter.supplier.provider.supplier_address'
      - '@PrestaShop\PrestaShop\Adapter\Product\Update\ProductSupplierUpdater'
      - '%database_prefix%'
    public: false

  prestashop.adapter.supplier.command_handler.toggle_supplier_status_handler:
    class: 'PrestaShop\PrestaShop\Adapter\Supplier\CommandHandler\ToggleSupplierStatusHandler'
    autoconfigure: true

  prestashop.adapter.supplier.command_handler.delete_supplier_handler:
    class: 'PrestaShop\PrestaShop\Adapter\Supplier\CommandHandler\DeleteSupplierHandler'
    parent: 'prestashop.adapter.supplier.command_handler.abstract_delete_supplier_handler'
    autoconfigure: true
    public: true

  prestashop.adapter.supplier.command_handler.delete_supplier_logo_image_handler:
    class: 'PrestaShop\PrestaShop\Adapter\Supplier\CommandHandler\DeleteSupplierLogoImageHandler'
    autoconfigure: true
    arguments:
      - !php/const _PS_SUPP_IMG_DIR_
      - !php/const _PS_TMP_IMG_DIR_

  prestashop.adapter.supplier.command_handler.bulk_delete_supplier_handler:
    class: 'PrestaShop\PrestaShop\Adapter\Supplier\CommandHandler\BulkDeleteSupplierHandler'
    parent: 'prestashop.adapter.supplier.command_handler.abstract_delete_supplier_handler'
    autoconfigure: true
    public: true

  prestashop.adapter.supplier.command_handler.bulk_disable_supplier_handler:
    class: 'PrestaShop\PrestaShop\Adapter\Supplier\CommandHandler\BulkDisableSupplierHandler'
    autoconfigure: true

  prestashop.adapter.supplier.command_handler.bulk_enable_supplier_handler:
    class: 'PrestaShop\PrestaShop\Adapter\Supplier\CommandHandler\BulkEnableSupplierHandler'
    autoconfigure: true

  prestashop.adapter.supplier.query_handler.get_supplier_for_viewing_handler:
    class: 'PrestaShop\PrestaShop\Adapter\Supplier\QueryHandler\GetSupplierForViewingHandler'
    autoconfigure: true
    arguments:
      - '@prestashop.core.localization.locale.context_locale'
      - '@=service("prestashop.adapter.legacy.configuration").get("PS_CURRENCY_DEFAULT")'

  prestashop.adapter.supplier.command_handler.add_supplier_handler:
    class: 'PrestaShop\PrestaShop\Adapter\Supplier\CommandHandler\AddSupplierHandler'
    autoconfigure: true

  prestashop.adapter.supplier.query_handler.get_supplier_for_editing:
    class: 'PrestaShop\PrestaShop\Adapter\Supplier\QueryHandler\GetSupplierForEditingHandler'
    autoconfigure: true
    arguments:
      - '@prestashop.core.image.parser.image_tag_source_parser'

  prestashop.adapter.supplier.command_handler.edit_supplier_handler:
    class: 'PrestaShop\PrestaShop\Adapter\Supplier\CommandHandler\EditSupplierHandler'
    autoconfigure: true

  PrestaShop\PrestaShop\Adapter\Supplier\Repository\SupplierRepository: ~
