#
# Module services
#
# Copyright (c) 2011-present Qualiteam software Ltd. All rights reserved.
# See https://www.x-cart.com/license-agreement.html for license details.

parameters:
  autoimport.test.ftp.gateway.default: 0
  autoimport.test.ftp.gateway: "%env(default:autoimport.test.ftp.gateway.default:bool:AUTOIMPORT_TEST_FTP_GATEWAY_ENABLED)%"

  autoimport.test.product.data.gateway.default: 0
  autoimport.test.product.data.gateway: "%env(default:autoimport.test.product.data.gateway.default:bool:AUTOIMPORT_TEST_PRODUCT_DATA_GATEWAY_ENABLED)%"

  autoimport.test.order.processing.gateway.default: 0
  autoimport.test.order.processing.gateway: "%env(default:autoimport.test.order.processing.gateway.default:bool:AUTOIMPORT_TEST_ORDER_PROCESSING_GATEWAY_ENABLED)%"

  autoimport.test.electronic.order.gateway.default: 0
  autoimport.test.electronic.order.gateway: "%env(default:autoimport.test.electronic.order.gateway.default:bool:AUTOIMPORT_TEST_ELECTRONIC_ORDER_GATEWAY_ENABLED)%"

  autoimport.test.order.history.gateway.default: 0
  autoimport.test.order.history.gateway: "%env(default:autoimport.test.order.history.gateway.default:bool:AUTOIMPORT_TEST_ORDER_HISTORY_GATEWAY_ENABLED)%"

services:
  _defaults:
    autowire: true
    autoconfigure: true

  XC\Keystone\Core\APITest\TestGeneralAPIGateway:
    decorates: XC\Keystone\Core\API\General\GeneralAPIGateway
    arguments:
      $gateway: '@.inner'
      $enabled: '@=parameter("autoimport.test.api.gateway") ? true : false'

  XC\Keystone\Core\APITest\TestFTPGatewayImplementation:
    decorates: XC\Keystone\Core\API\FTP\FTPGateway
    arguments:
      $ftpGateway: '@.inner'
      $enabled: '@=parameter("autoimport.test.ftp.gateway") ? true : false'

  XC\Keystone\Core\GatewayTest\ProductData\TestProductDataGatewayImplementation:
    decorates: XC\Keystone\Core\Gateway\ProductData\ProductDataGateway
    arguments:
      $productDataGateway: '@.inner'
      $enabled: '@=parameter("autoimport.test.product.data.gateway") ? true : false'

  XC\Keystone\Core\GatewayTest\OrderProcessing\TestOrderProcessingGatewayImplementation:
    decorates: XC\Keystone\Core\Gateway\OrderProcessing\OrderProcessingGateway
    arguments:
      $gateway: '@.inner'
      $enabled: '@=parameter("autoimport.test.order.processing.gateway") ? true : false'

  XC\Keystone\Core\APITest\TestElectronicOrderGatewayImplementation:
    decorates: XC\Keystone\Core\API\ElectronicOrder\ElectronicOrderGateway
    arguments:
      $gateway: '@.inner'
      $enabled: '@=parameter("autoimport.test.electronic.order.gateway") ? true : false'

  XC\Keystone\Core\GatewayTest\OrderHistory\TestOrderHistoryGatewayImplementation:
    decorates: XC\Keystone\Core\Gateway\OrderHistory\OrderHistoryGateway
    arguments:
      $gateway: '@.inner'
      $enabled: '@=parameter("autoimport.test.order.history.gateway") ? true : false'

  XC\Keystone\Core\APITest\TestDataProvider: ~
