services:
  _defaults:
    autowire: true
    autoconfigure: true

  # whoami
  xcart.api.storefront.principal.data_provider.item.whoami:
    class: XCart\Bundle\APIPlatformBridgeBundle\API\DataProvider\Item\DataProvider
    arguments:
      $classes: [XCart\API\Entity\Storefront\Principal]
      $action: '@xcart.logic.storefront.auth.whoami.action'
      $requestAssembler: '@xcart.api.storefront.principal.data_provider.item.request.assembler.whoami'
      $responseAssembler: '@xcart.api.storefront.principal.data_provider.item.response.assembler.whoami'
      $operationNames: [whoami]

  xcart.api.storefront.principal.data_provider.item.request.assembler.whoami:
    class: XCart\Bundle\APIPlatformBridgeBundle\API\DataProvider\Item\Assembler\RequestAssembler
    arguments:
      $requestFactory: '@XCart\Factory\Logic\Action\Storefront\Principal\GetOne\DTO\RequestInterface'

  xcart.api.storefront.principal.data_provider.item.request.assembler.whoami.decorator.without_id:
    class: XCart\API\DataProvider\Storefront\Item\Assembler\WithoutIdRequestAssembler
    decorates: xcart.api.storefront.principal.data_provider.item.request.assembler.whoami
    arguments:
      $inner: '@.inner'
      $requestFactory: '@XCart\Factory\Logic\Action\Storefront\Principal\GetOne\DTO\RequestInterface'

  xcart.api.storefront.principal.data_provider.item.response.assembler.whoami:
    class: XCart\Bundle\APIPlatformBridgeBundle\API\DataProvider\Item\Assembler\PayloadResponseAssembler
    arguments:
      $transformer: '@XCart\Transformer\Logic\Entity\Storefront\Principal\API\Entity\Storefront\PrincipalInterface'

  # reset_password
  xcart.api.storefront.reset_password_action.data_persister:
    class: XCart\API\Endpoint\Storefront\ResetPasswordAction\ResetPassword\DataPersister\DataPersister
    arguments:
      $classes: [XCart\API\Entity\Storefront\ResetPasswordAction]
      $persister: '@xcart.api.storefront.reset_password_action.data_persister.persister'

  xcart.api.storefront.reset_password_action.data_persister.persister:
    class: XCart\API\Endpoint\Storefront\ResetPasswordAction\ResetPassword\DataPersister\Persister\Persister
    arguments:
      $resetPasswordAction: '@xcart.logic.storefront.reset_password_action.reset_password.action'
      $resetPasswordRequestAssembler: '@xcart.api.storefront.reset_password_action.data_persister.persister.assembler.request_assembler'

  xcart.api.storefront.reset_password_action.data_persister.persister.assembler.request_assembler:
    class: XCart\Bundle\APIPlatformBridgeBundle\API\DataPersister\Persister\Assembler\PayloadAssembler
    arguments:
      $transformer: '@XCart\Transformer\API\Entity\Storefront\ResetPasswordAction\Logic\Entity\Storefront\NewResetPasswordAction'
      $factory: '@XCart\Factory\Logic\Action\Storefront\ResetPasswordAction\CreateOne\DTO\Request'