services:
  _defaults:
    autowire: true
    autoconfigure: true

  # get one by id (compact)
  xcart.api.storefront.category.compact.data_provider.item.get_one_by_id:
    class: XCart\Bundle\APIPlatformBridgeBundle\API\DataProvider\Item\DataProvider
    arguments:
      $classes: [XCart\API\Entity\Storefront\Category\Compact]
      $action: '@xcart.logic.storefront.category.get_one_by_id.action'
      $requestAssembler: '@xcart.api.storefront.category.compact.data_provider.item.request.assembler'
      $responseAssembler: '@xcart.api.storefront.category.compact.data_provider.item.response.assembler'
      $operationNames: [get]

  # get one by id (detailed)
  xcart.api.storefront.category.detailed.data_provider.item.get_one_by_id:
    class: XCart\Bundle\APIPlatformBridgeBundle\API\DataProvider\Item\DataProvider
    arguments:
      $classes: [XCart\API\Entity\Storefront\Category\Detailed]
      $action: '@xcart.logic.storefront.category.get_one_by_id.action'
      $requestAssembler: '@xcart.api.storefront.category.detailed.data_provider.item.request.assembler'
      $responseAssembler: '@xcart.api.storefront.category.detailed.data_provider.item.response.assembler'
      $operationNames: [get]

  # get one by clean url (compact)
  xcart.api.storefront.category.compact.data_provider.item.get_by_clean_url:
    class: XCart\Bundle\APIPlatformBridgeBundle\API\DataProvider\Item\DataProvider
    arguments:
      $classes: [XCart\API\Entity\Storefront\Category\Compact]
      $action: '@xcart.logic.storefront.category.get_one_by_id.action'
      $requestAssembler: '@xcart.api.storefront.category.data_provider.item.request.assembler.get_one_by_clean_url'
      $responseAssembler: '@xcart.api.storefront.category.compact.data_provider.item.response.assembler'
      $operationNames: [getByCleanURL]

  # get one by clean url (detailed)
  xcart.api.storefront.category.detailed.data_provider.item.get_by_clean_url:
    class: XCart\Bundle\APIPlatformBridgeBundle\API\DataProvider\Item\DataProvider
    arguments:
      $classes: [XCart\API\Entity\Storefront\Category\Detailed]
      $action: '@xcart.logic.storefront.category.get_one_by_id.action'
      $requestAssembler: '@xcart.api.storefront.category.data_provider.item.request.assembler.get_one_by_clean_url'
      $responseAssembler: '@xcart.api.storefront.category.detailed.data_provider.item.response.assembler'
      $operationNames: [getByCleanURL]

  # common assemblers
  xcart.api.storefront.category.data_provider.item.request.assembler.get_one_by_clean_url:
    class: XCart\API\Endpoint\Storefront\Category\Detailed\GetOneByCleanURL\Assembler\RequestAssembler
    arguments:
      $categoryRepository: '@xcart.repository.category'
