services:
  _defaults:
    autowire: true
    autoconfigure: true

  # transformers
  XCart\Transformer\XLite\Model\Category\Logic\Entity\Storefront\Category:
    class: XCart\Transformer\XLite\Model\Category\Logic\Entity\Storefront\Category
    arguments:
      $factory: '@XCart\Factory\Logic\Entity\Storefront\CategoryInterface'

  # get one by id
  xcart.logic.storefront.category.get_one_by_id.action:
    class: XCart\Logic\Action\Storefront\Category\GetOne\Action
    arguments:
      $queryBuilderAssembler: '@xcart.logic.storefront.category.get_one.assembler.query_builder'
      $categoryRepository: '@xcart.repository.category.read'
      $responseAssembler: '@xcart.logic.storefront.category.get_one.response.assembler'
    tags:
      - {name: xcart.logic.action, request: XCart\Logic\Action\Storefront\Category\GetOne\DTO\Request, response: XCart\Logic\Action\Storefront\Category\GetOne\DTO\Response}

  xcart.logic.storefront.category.get_one.assembler.query_builder:
    class: XCart\Logic\Action\Storefront\Category\GetOne\Assembler\QueryBuilder\FindOneQueryBuilderAssembler
    arguments:
      $categoryRepository: '@xcart.repository.category.read'
      $entityIdAssembler: '@xcart.logic.storefront.category.get_one.action.entity_id.assembler'

  # get list
  xcart.doctrine.storefront.category.criteria.assembler.decorator.id:
    class: XCart\Logic\Action\Storefront\Category\GetList\Assembler\Criteria\FindListCriteriaAssemblerDecorator
    decorates: xcart.doctrine.storefront.category.criteria.assembler
    decoration_priority: 10
    arguments:
      $inner: '@.inner'
      $categoryRepository: '@xcart.repository.category'
