#
# Module services
#
# Copyright (c) 2011-present Qualiteam software Ltd. All rights reserved.
# See https://www.x-cart.com/license-agreement.html for license details.
dto_generator:
  entities:
    dto:
      XCart\API\Entity\Storefront\SwatchImage:
        fields:
          url:
            type: string
          width:
            type: integer
          height:
            type: integer
      XCart\API\Entity\Storefront\ProductAttributeValue:
        fields:
          swatchColor:
            type: string
          swatchImage:
            type: XCart\API\Entity\Storefront\SwatchImage
      XCart\Logic\Entity\Storefront\SwatchImage:
        fields:
          url:
            type: string
          width:
            type: integer
          height:
            type: integer
      XCart\Logic\Entity\Storefront\ProductAttributeValue:
        fields:
          swatchColor:
            type: string
          swatchImage:
            type: XCart\Logic\Entity\Storefront\SwatchImage
  enumerations:
    XCart\Enum\AttributeDisplayMode:
      items:
        SelectBox:
          value: S
        Blocks:
          value: B
        ColorSwatch:
          value: C
services:
  _defaults:
    autowire: true
    autoconfigure: true

  QSL\ColorSwatches\Transformer\XLite\Model\AttributeValue\Logic\Entity\Storefront\AttributeValueDecorator:
    decorates: XCart\Transformer\XLite\Model\AttributeValue\Logic\Entity\Storefront\AttributeValue

  qsl.color-swatches.doctrine.migration-decorator:
    class: XCart\Doctrine\Migration\MigrationTablesInjector
    decorates: XCart\Doctrine\Migration
    arguments:
      $migration: '@.inner'
      $preservedTables: ['%env(string:DATABASE_DEFAULT_TABLE_PREFIX)%_sql_color_swtach_translations']
