services:
  _defaults:
    autowire: true
    autoconfigure: true

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

  xcart.api.attribute_option.checkbox.global_sub_extension:
    class: XLite\API\SubExtension\AttributeOption\GlobalAttributeOptionSubExtension
    arguments:
      $attributeType: !php/const XLite\Model\Attribute::TYPE_CHECKBOX
      $operationNames: ['get_checkbox', 'post_checkbox', 'put_checkbox', 'delete_checkbox', 'get_checkboxes']
      $pathPrefix: 'attributes_checkbox'
    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.checkbox.global_sub_iri_converter:
    class: XLite\API\SubIriConverter\AttributeOption\GlobalAttributeOptionSubIriConverter
    arguments:
      $attributeType: !php/const XLite\Model\Attribute::TYPE_CHECKBOX
      $itemRouteName: 'api_attribute options_get_checkbox_item'
    tags: [!php/const XCart\Framework\ApiPlatform\Core\Bridge\Symfony\Routing\SubIriConverter\SubIriFromItemConverterInterface::SUB_IRI_FROM_ITEM_CONVERTER_TAG]

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

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

  xcart.api.attribute_option.checkbox.product_class_sub_extension:
    class: XLite\API\SubExtension\AttributeOption\ProductClassBasedAttributeOptionSubExtension
    arguments:
      $attributeType: !php/const XLite\Model\Attribute::TYPE_CHECKBOX
      $operationNames: ['product_class_based_get_checkbox', 'product_class_based_post_checkbox', 'product_class_based_put_checkbox', 'product_class_based_delete_checkbox', 'product_class_based_get_checkboxes']
      $pathPrefix: 'attributes_checkbox'
    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.checkbox.product_class_sub_iri_converter:
    class: XLite\API\SubIriConverter\AttributeOption\ProductClassBasedAttributeOptionSubIriConverter
    arguments:
      $attributeType: !php/const XLite\Model\Attribute::TYPE_CHECKBOX
      $itemRouteName: 'api_attribute options_product_class_based_get_checkbox_item'
    tags: [!php/const XCart\Framework\ApiPlatform\Core\Bridge\Symfony\Routing\SubIriConverter\SubIriFromItemConverterInterface::SUB_IRI_FROM_ITEM_CONVERTER_TAG]

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

  xcart.api.attribute_option.checkbox.product_sub_extension:
    class: XLite\API\SubExtension\AttributeOption\ProductBasedAttributeOptionSubExtension
    arguments:
      $attributeType: !php/const XLite\Model\Attribute::TYPE_CHECKBOX
      $operationNames: ['product_based_get_checkbox', 'product_based_post_checkbox', 'product_based_put_checkbox', 'product_based_delete_checkbox', 'product_based_get_checkboxes']
      $pathPrefix: 'attributes_checkbox'
    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.checkbox.product_sub_iri_converter:
    class: XLite\API\SubIriConverter\AttributeOption\ProductBasedAttributeOptionSubIriConverter
    arguments:
      $attributeType: !php/const XLite\Model\Attribute::TYPE_CHECKBOX
      $itemRouteName: 'api_attribute options_product_based_get_checkbox_item'
    tags: [!php/const XCart\Framework\ApiPlatform\Core\Bridge\Symfony\Routing\SubIriConverter\SubIriFromItemConverterInterface::SUB_IRI_FROM_ITEM_CONVERTER_TAG]
