services:
  _defaults:
    autowire: true
    autoconfigure: true

  # /attributes_select/{attribute_id}/options
  XLite\API\Endpoint\AttributeOption\Select\Transformer\OutputTransformerInterface: '@XLite\API\Endpoint\AttributeOption\Select\Transformer\OutputTransformer'
  XLite\API\Endpoint\AttributeOption\Select\Transformer\OutputTransformer: ~
  XLite\API\Endpoint\AttributeOption\Select\Transformer\InputTransformerInterface: '@XLite\API\Endpoint\AttributeOption\Select\Transformer\InputTransformer'
  XLite\API\Endpoint\AttributeOption\Select\Transformer\InputTransformer: ~

  xcart.api.attribute_option.select.global_sub_extension:
    class: XLite\API\SubExtension\AttributeOption\GlobalAttributeOptionSubExtension
    arguments:
      $attributeType: !php/const XLite\Model\Attribute::TYPE_SELECT
      $operationNames: ['get_option_select', 'post_option_select', 'put_option_select', 'delete_option_select', 'get_option_selects']
      $pathPrefix: 'attributes_select'
    tags: [!php/const XLite\API\Extension\ItemSubExtension\ItemSubExtensionInterface::ITEM_SUB_EXTENSION_TAG, !php/const XLite\API\Extension\CollectionSubExtension\CollectionSubExtensionInterface::COLLECTION_SUB_EXTENSION_TAG]

  xcart.api.attribute_option.select.global_sub_iri_converter:
    class: XLite\API\SubIriConverter\AttributeOption\GlobalAttributeOptionSubIriConverter
    arguments:
      $attributeType: !php/const XLite\Model\Attribute::TYPE_SELECT
      $itemRouteName: 'api_attribute options_get_option_select_item'
    tags: [!php/const XCart\Framework\ApiPlatform\Core\Bridge\Symfony\Routing\SubIriConverter\SubIriFromItemConverterInterface::SUB_IRI_FROM_ITEM_CONVERTER_TAG]

  xcart.api.attribute_option.select.controller:
    class: XLite\Controller\API\AttributeOption\Post
    arguments:
      $attributeType: !php/const XLite\Model\Attribute::TYPE_SELECT
    tags: ['controller.service_arguments']

  # /product_classes/{class_id}/attributes_select/{attribute_id}/options
  xcart.api.attribute_option.select.product_class_controller:
    class: XLite\Controller\API\AttributeOption\ProductClassBasedPost
    arguments:
      $attributeType: !php/const XLite\Model\Attribute::TYPE_SELECT
    tags: ['controller.service_arguments']

  xcart.api.attribute_option.select.product_class_sub_extension:
    class: XLite\API\SubExtension\AttributeOption\ProductClassBasedAttributeOptionSubExtension
    arguments:
      $attributeType: !php/const XLite\Model\Attribute::TYPE_SELECT
      $operationNames: ['product_class_based_get_option_select', 'product_class_based_post_option_select', 'product_class_based_put_option_select', 'product_class_based_delete_option_select', 'product_class_based_get_option_selects']
      $pathPrefix: 'attributes_select'
    tags: [!php/const XLite\API\Extension\ItemSubExtension\ItemSubExtensionInterface::ITEM_SUB_EXTENSION_TAG, !php/const XLite\API\Extension\CollectionSubExtension\CollectionSubExtensionInterface::COLLECTION_SUB_EXTENSION_TAG]

  xcart.api.attribute_option.select.product_class_sub_iri_converter:
    class: XLite\API\SubIriConverter\AttributeOption\ProductClassBasedAttributeOptionSubIriConverter
    arguments:
      $attributeType: !php/const XLite\Model\Attribute::TYPE_SELECT
      $itemRouteName: 'api_attribute options_product_class_based_get_option_select_item'
    tags: [!php/const XCart\Framework\ApiPlatform\Core\Bridge\Symfony\Routing\SubIriConverter\SubIriFromItemConverterInterface::SUB_IRI_FROM_ITEM_CONVERTER_TAG]

  # /products/{product_id}/attributes_select/{attribute_id}/options
  xcart.api.attribute_option.select.product_controller:
    class: XLite\Controller\API\AttributeOption\ProductBasedPost
    arguments:
      $attributeType: !php/const XLite\Model\Attribute::TYPE_SELECT
    tags: ['controller.service_arguments']

  xcart.api.attribute_option.select.product_sub_extension:
    class: XLite\API\SubExtension\AttributeOption\ProductBasedAttributeOptionSubExtension
    arguments:
      $attributeType: !php/const XLite\Model\Attribute::TYPE_SELECT
      $operationNames: ['product_based_get_option_select', 'product_based_post_option_select', 'product_based_put_option_select', 'product_based_delete_option_select', 'product_based_get_option_selects']
      $pathPrefix: 'attributes_select'
    tags: [!php/const XLite\API\Extension\ItemSubExtension\ItemSubExtensionInterface::ITEM_SUB_EXTENSION_TAG, !php/const XLite\API\Extension\CollectionSubExtension\CollectionSubExtensionInterface::COLLECTION_SUB_EXTENSION_TAG]

  xcart.api.attribute_option.select.product_sub_iri_converter:
    class: XLite\API\SubIriConverter\AttributeOption\ProductBasedAttributeOptionSubIriConverter
    arguments:
      $attributeType: !php/const XLite\Model\Attribute::TYPE_SELECT
      $itemRouteName: 'api_attribute options_product_based_get_option_select_item'
    tags: [!php/const XCart\Framework\ApiPlatform\Core\Bridge\Symfony\Routing\SubIriConverter\SubIriFromItemConverterInterface::SUB_IRI_FROM_ITEM_CONVERTER_TAG]
