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

api_platform:
  mapping:
    paths:
      - '%kernel.project_dir%/var/run/classes/XC/CustomProductTabs/API/Resource'

dto_generator:
  entities:
    dto:
      XCart\API\Entity\Storefront\ProductTab:
        fields:
          serviceName:
            type: string
          name:
            type: string
          content:
            type: string
          briefInfo:
            type: string
      XCart\Logic\Entity\Storefront\ProductTab:
        fields:
          serviceName:
            type: string
          name:
            type: string
          content:
            type: string
          briefInfo:
            type: string
            nullable: true

    api:
      XCart\API\Entity\Storefront\Product\Detailed:
        fields:
          tabs:
            type: XCart\API\Entity\Storefront\ProductTab[]

    logic:
      XCart\Logic\Entity\Storefront\Product:
        fields:
          tabs:
            type: XCart\Logic\Entity\Storefront\ProductTab[]

services:
  _defaults:
    autowire: true
    autoconfigure: true

  XC\CustomProductTabs\API\Endpoint\CustomProductTab\ResourceTransformer\InputTransformerInterface: '@XC\CustomProductTabs\API\Endpoint\CustomProductTab\ResourceTransformer\InputTransformer'
  XC\CustomProductTabs\API\Endpoint\CustomProductTab\ResourceTransformer\InputTransformer: ~
  XC\CustomProductTabs\API\Endpoint\CustomProductTab\ResourceTransformer\OutputTransformerInterface: '@XC\CustomProductTabs\API\Endpoint\CustomProductTab\ResourceTransformer\OutputTransformer'
  XC\CustomProductTabs\API\Endpoint\CustomProductTab\ResourceTransformer\OutputTransformer: ~

  XC\CustomProductTabs\API\Endpoint\CustomProductTab\Transformer\InputTransformerInterface: '@XC\CustomProductTabs\API\Endpoint\CustomProductTab\Transformer\InputTransformer'
  XC\CustomProductTabs\API\Endpoint\CustomProductTab\Transformer\InputTransformer: ~
  XC\CustomProductTabs\API\Endpoint\CustomProductTab\Transformer\OutputTransformerInterface: '@XC\CustomProductTabs\API\Endpoint\CustomProductTab\Transformer\OutputTransformer'
  XC\CustomProductTabs\API\Endpoint\CustomProductTab\Transformer\OutputTransformer: ~

  XC\CustomProductTabs\API\Endpoint\CustomProductTab\DataProvider: ~
  XC\CustomProductTabs\API\Endpoint\CustomProductTab\DataPersister:
    arguments:
      - '@doctrine.orm.entity_manager'
      - '@XC\CustomProductTabs\API\Endpoint\CustomProductTab\ResourceTransformer\InputTransformer'
      - '@XC\CustomProductTabs\API\Endpoint\CustomProductTab\ResourceTransformer\OutputTransformer'

  XC\CustomProductTabs\API\OpenApiTagsRepositoryDecorator:
    decorates: XLite\API\OpenApiTagsRepository

  XC\CustomProductTabs\Transformer\XLite\Model\Product\Logic\Entity\Storefront\ProductDecorator:
    decorates: XCart\Transformer\XLite\Model\Product\Logic\Entity\Storefront\Product

  XC\CustomProductTabs\EntityCallback\TabCallback:
    tags:
      - {name: doctrine.orm.entity_listener, event: prePersist, entity: XC\CustomProductTabs\Model\Product\Tab}

  XC\CustomProductTabs\EntityCallback\CustomGlobalTabCallback:
    tags:
      - {name: doctrine.orm.entity_listener, event: prePersist, entity: XC\CustomProductTabs\Model\Product\CustomGlobalTab}
