#
# 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:
    api:
      XCart\API\Entity\Storefront\Product\Compact:
        fields:
          marketPrice:
            type: float

      XCart\API\Entity\Storefront\Product\Detailed:
        fields:
          marketPrice:
            type: float

      XCart\API\Entity\Storefront\Cart\Item:
        fields:
          marketPrice:
            type: float
            groups: [read]

    logic:
      XCart\Logic\Entity\Storefront\Product:
        fields:
          marketPrice:
            type: float

      XCart\Logic\Entity\Storefront\Cart\Item:
        fields:
          marketPrice:
            type: float
            nullable: true

services:
  _defaults:
    autowire: true
    autoconfigure: true

  CDev\MarketPrice\Transformer\XLite\Model\Product\Logic\Entity\Storefront\ProductDecorator:
    decorates: XCart\Transformer\XLite\Model\Product\Logic\Entity\Storefront\Product

  CDev\MarketPrice\Transformer\XLite\Model\OrderItem\Logic\Entity\Storefront\Cart\ItemDecorator:
    class: CDev\MarketPrice\Transformer\XLite\Model\OrderItem\Logic\Entity\Storefront\Cart\ItemDecorator
    decorates: XCart\Transformer\XLite\Model\OrderItem\Logic\Entity\Storefront\Cart\Item
    decoration_priority: 50

  CDev\MarketPrice\Transformer\XLite\Model\OrderItem\Logic\Entity\Storefront\Cart\NewItemDecorator:
    class: CDev\MarketPrice\Transformer\XLite\Model\OrderItem\Logic\Entity\Storefront\Cart\NewItemDecorator
    decorates: XCart\Transformer\XLite\Model\OrderItem\Logic\Entity\Storefront\Cart\NewItem
    decoration_priority: 50
