#
# 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:
  resource_class_directories:
    - '%kernel.project_dir%/var/run/classes/XC/VendorPartners/Model'

services:
  _defaults:
    autowire: true
    autoconfigure: true

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

  # /vendors/{vendor_id}/staff_members
  XC\VendorPartners\API\Endpoint\VendorStaffMember\Transformer\OutputTransformerInterface: '@XC\VendorPartners\API\Endpoint\VendorStaffMember\Transformer\OutputTransformer'
  XC\VendorPartners\API\Endpoint\VendorStaffMember\Transformer\OutputTransformer: ~
  XC\VendorPartners\API\Endpoint\VendorStaffMember\Transformer\InputTransformerInterface: '@XC\VendorPartners\API\Endpoint\VendorStaffMember\Transformer\InputTransformer'
  XC\VendorPartners\API\Endpoint\VendorStaffMember\Transformer\InputTransformer: ~

  XC\VendorPartners\API\Endpoint\VendorStaffMember\SubIriConverter\SubIriConverter:
    tags: [!php/const XCart\Framework\ApiPlatform\Core\Bridge\Symfony\Routing\SubIriConverter\SubIriFromItemConverterInterface::SUB_IRI_FROM_ITEM_CONVERTER_TAG]

  XC\VendorPartners\API\Endpoint\VendorStaffMember\DataProvider\CollectionDataProvider:
    arguments:
      $inner: '@api_platform.doctrine.orm.default.collection_data_provider'
      $repository: '@xcart.repository.xc.multi_vendor.vendor'

  XC\VendorPartners\API\Endpoint\VendorStaffMember\DataProvider\ItemDataProvider:
    arguments:
      $inner: '@api_platform.doctrine.orm.default.item_data_provider'
      $repository: '@xcart.repository.xc.multi_vendor.vendor'

  xcart.api.xc.vendor_partners.vendor_staff_member.sub_extension:
    class: XC\VendorPartners\API\Endpoint\VendorStaffMember\SubExtension\SubExtension
    tags: [!php/const XLite\API\Extension\CollectionSubExtension\CollectionSubExtensionInterface::COLLECTION_SUB_EXTENSION_TAG, !php/const XLite\API\Extension\ItemSubExtension\ItemSubExtensionInterface::ITEM_SUB_EXTENSION_TAG]

  xcart.api.xc.vendor_partners.vendor_staff_member.controller:
    class: XC\VendorPartners\Controller\API\VendorStaffMember\Post
    public: true
    arguments:
      $repository: '@xcart.repository.xc.multi_vendor.vendor'
