services:
  _defaults:
    autowire: true
    autoconfigure: true

  # create cart address
  xcart.api.storefront.cart.address.data_persister.persister.request.assembler.create.decorator.profile:
    class: XCart\API\Endpoint\Storefront\CartAddress\DataPersister\Persister\Assembler\CreatePayloadAssemblerDecorator
    decorates: xcart.api.storefront.cart.address.data_persister.persister.request.assembler.create
    arguments:
      $inner: '@.inner'

  # create address
  xcart.api.storefront.address.data_persister.persister.request.assembler.create.decorator.profile:
    class: XCart\API\Endpoint\Storefront\Address\DataPersister\Persister\Assembler\CreatePayloadAssemblerDecorator
    decorates: xcart.api.storefront.address.data_persister.persister.request.assembler.create
    arguments:
      $inner: '@.inner'

  # update cart address
  xcart.api.storefront.cart.address.data_persister.persister.request.assembler.update.decorator.profile:
    class: XCart\API\Endpoint\Storefront\CartAddress\DataPersister\Persister\Assembler\CreatePayloadAssemblerDecorator
    decorates: xcart.api.storefront.cart.address.data_persister.persister.request.assembler.update
    arguments:
      $inner: '@.inner'

  # update address
  xcart.api.storefront.address.data_persister.persister.request.assembler.update.decorator.profile:
    class: XCart\API\Endpoint\Storefront\Address\DataPersister\Persister\Assembler\CreatePayloadAssemblerDecorator
    decorates: xcart.api.storefront.address.data_persister.persister.request.assembler.update
    arguments:
      $inner: '@.inner'

  # get cart address list
  xcart.api.storefront.cart.address.data_provider.collection.request.assembler.decorator.profile:
    class: XCart\API\Endpoint\Storefront\CartAddress\DataProvider\Collection\Assembler\RequestAssemblerDecorator
    decorates: xcart.api.storefront.cart.address.data_provider.collection.request.assembler
    arguments:
      $inner: '@.inner'

  # get address list
  xcart.api.storefront.address.data_provider.collection.request.assembler.decorator.profile:
    class: XCart\API\Endpoint\Storefront\Address\DataProvider\Collection\Assembler\RequestAssemblerDecorator
    decorates: xcart.api.storefront.address.data_provider.collection.request.assembler
    arguments:
      $inner: '@.inner'

  # get cart address
  xcart.api.storefront.cart.address.data_provider.item.request.assembler.decorator.profile:
    class: XCart\API\Endpoint\Storefront\CartAddress\DataProvider\Item\Assembler\RequestAssemblerDecorator
    decorates: xcart.api.storefront.cart.address.data_provider.item.request.assembler
    arguments:
      $inner: '@.inner'

  xcart.api.storefront.cart.address.data_provider.item.get_one:
    class: XCart\Bundle\APIPlatformBridgeBundle\API\DataProvider\Item\DataProvider
    arguments:
      $classes: [XCart\API\Entity\Storefront\Cart\Address]
      $action: '@xcart.logic.storefront.address.get_one.action.self'
      $requestAssembler: '@xcart.api.storefront.cart.address.data_provider.item.request.assembler'
      $responseAssembler: '@xcart.api.storefront.cart.address.data_provider.item.response.assembler'
      $operationNames: [get, patch, delete]

  XCart\API\Endpoint\Storefront\CartAddress\SubIriConverter\SubIriConverter:
    class: XCart\API\Endpoint\Storefront\CartAddress\SubIriConverter\SubIriConverter
    tags:
      - xcart.api.sub_iri_from_item_converter

  # get address
  xcart.api.storefront.address.data_provider.item.request.assembler.decorator.profile:
    class: XCart\API\Endpoint\Storefront\Address\DataProvider\Item\Assembler\RequestAssemblerDecorator
    decorates: xcart.api.storefront.address.data_provider.item.request.assembler
    arguments:
      $inner: '@.inner'

  xcart.api.storefront.address.data_provider.item.get_one.self:
    class: XCart\Bundle\APIPlatformBridgeBundle\API\DataProvider\Item\DataProvider
    arguments:
      $classes: [XCart\API\Entity\Storefront\Address]
      $action: '@xcart.logic.storefront.address.get_one.action.self'
      $requestAssembler: '@xcart.api.storefront.address.data_provider.item.request.assembler'
      $responseAssembler: '@xcart.api.storefront.address.data_provider.item.response.assembler'
      $operationNames: [get, patch, delete]

  # get address field
  xcart.api.storefront.address_field.data_provider.item.get_one:
    class: XCart\Bundle\APIPlatformBridgeBundle\API\DataProvider\Item\DataProvider
    arguments:
      $classes: [XCart\API\Entity\Storefront\AddressField]
      $action: '@xcart.logic.storefront.address_field.get_one.action'
      $requestAssembler: '@xcart.api.storefront.addressfield.data_provider.item.request.assembler'
      $responseAssembler: '@xcart.api.storefront.addressfield.data_provider.item.response.assembler'
      $operationNames: [get]
