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

parameters:
  atd.vehicles.api.test_gateway_enabled.default: false
  atd.vehicles.api.test_gateway_enabled: "%env(default:atd.vehicles.api.test_gateway_enabled.default:bool:ATD_TEST_VEHICLES_API_GATEWAY_ENABLED)%"
  atd.brands.api.test_gateway_enabled.default: false
  atd.brands.api.test_gateway_enabled: "%env(default:atd.brands.api.test_gateway_enabled.default:bool:ATD_TEST_BRANDS_API_GATEWAY_ENABLED)%"
  atd.order.api.test_gateway_enabled.default: false
  atd.order.api.test_gateway_enabled: "%env(default:atd.order.api.test_gateway_enabled.default:bool:ATD_TEST_ORDER_API_GATEWAY_ENABLED)%"
  atd.product.adapter.test.enabled.default: false
  atd.product.adapter.test.enabled: "%env(default:atd.product.adapter.test.enabled.default:bool:ATD_TEST_PRODUCT_ADAPTER_ENABLED)%"
  atd.vehicle.fitments.test_gateway.enabled.default: false
  atd.vehicle.fitments.test_gateway.enabled: "%env(default:atd.vehicle.fitments.test_gateway.enabled.default:bool:ATD_TEST_VEHICLE_FITMENTS_GATEWAY_ENABLED)%"
  atd.order.adapter.test.enabled.default: false
  atd.order.adapter.test.enabled: "%env(default:atd.order.adapter.test.enabled.default:bool:ATD_TEST_ORDER_ADAPTER_ENABLED)%"
  atd.order.details.adapter.test.enabled.default: false
  atd.order.details.adapter.test.enabled: "%env(default:atd.order.details.adapter.test.enabled.default:bool:ATD_TEST_ORDER_DETAILS_ADAPTER_ENABLED)%"

services:
  _defaults:
    autowire: true
    autoconfigure: true

  XC\ATD\Core\API\TestGateway: ~

  XC\ATD\Core\API\BrandsAPIGateway\TestBrandsAPIGatewayImplementation:
    decorates: XC\ATD\Core\API\BrandsAPIGateway\IBrandsAPIGateway
    class: XC\ATD\Core\API\BrandsAPIGateway\TestBrandsAPIGatewayImplementation
    arguments:
      $gateway: '@.inner'
      $isTestApiEnabled: '@=parameter("atd.brands.api.test_gateway_enabled") ? true : false'

  XC\ATD\Core\API\VehicleAPIGateway\TestVehiclesAPIGatewayImplementation:
    decorates: XC\ATD\Core\API\VehicleAPIGateway\IVehiclesAPIGateway
    class: XC\ATD\Core\API\VehicleAPIGateway\TestVehiclesAPIGatewayImplementation
    arguments:
      $gateway: '@.inner'
      $isTestApiEnabled: '@=parameter("atd.vehicles.api.test_gateway_enabled") ? true : false'

  XC\ATD\Core\Data\AdapterTest\TestProductAdapter:
    decorates: XC\ATD\Core\Data\Adapter\Product\IProductAdapter
    class: XC\ATD\Core\Data\AdapterTest\TestProductAdapter
    arguments:
      $adapter: '@.inner'
      $isTestAdapterEnabled: '@=parameter("atd.product.adapter.test.enabled") ? true : false'

  XC\ATD\Core\API\VehicleAPIGateway\TestVehicleFitmentsAPIGateway:
    decorates: XC\ATD\Core\API\VehicleAPIGateway\IVehicleFitmentsAPIGateway
    class: XC\ATD\Core\API\VehicleAPIGateway\TestVehicleFitmentsAPIGateway
    arguments:
      $gateway: '@.inner'
      $isTestAPIEnabled: '@=parameter("atd.vehicle.fitments.test_gateway.enabled") ? true : false'
      $vehicleTrimOptionsDataBuilder: '@XC\ATD\Core\API\VehicleAPIGateway\DataBuilder\VehicleTrimOptionsDataBuilder'
      $vehicleInstallationSpecsDataBuilder: '@XC\ATD\Core\API\VehicleAPIGateway\DataBuilder\VehicleInstallationSpecsDataBuilder'

  XC\ATD\Core\Data\AdapterTest\TestOrderAdapter:
    decorates: XC\ATD\Core\Data\Adapter\Order\IOrderAdapter
    class: XC\ATD\Core\Data\AdapterTest\TestOrderAdapter
    arguments:
      $adapter: '@.inner'
      $metadataGateway: '@xc.atd.metadata_gateway'
      $isTestAdapterEnabled: '@=parameter("atd.order.adapter.test.enabled") ? true : false'

  XC\ATD\Core\Data\AdapterTest\TestOrderDetailsAdapter:
    decorates: XC\ATD\Core\Data\Adapter\OrderDetails\IOrderDetailsAdapter
    class: XC\ATD\Core\Data\AdapterTest\TestOrderDetailsAdapter
    arguments:
      $adapter: '@.inner'
      $isTestAdapterEnabled: '@=parameter("atd.order.details.adapter.test.enabled") ? true : false'

  XC\ATD\Core\API\OrderAPIGateway\TestOrderAPIGatewayImplementation:
    decorates: XC\ATD\Core\API\OrderAPIGateway\OrderAPIGateway
    class: XC\ATD\Core\API\OrderAPIGateway\TestOrderAPIGatewayImplementation
    arguments:
      $gateway: '@.inner'
      $isTestApiEnabled: '@=parameter("atd.order.api.test_gateway_enabled") ? true : false'
