services:
  _defaults:
    autowire: true
    autoconfigure: true
    public: false

  Extcode\Cart\:
    resource: '../Classes/*'
    exclude: '../Classes/Widgets/*'

  Extcode\Cart\EventListener\Template\Components\ModifyButtonBar:
    tags:
      - name: event.listener
        identifier: 'cart--cart--template--components--modify-button-bar'
        event: Extcode\Cart\Event\Template\Components\ModifyButtonBarEvent

  Extcode\Cart\EventListener\Cart\UpdateCountry:
    tags:
      - name: event.listener
        identifier: 'cart--cart--update-country'
        event: Extcode\Cart\Event\Cart\UpdateCountryEvent

  Extcode\Cart\EventListener\Cart\UpdateCurrency:
    tags:
      - name: event.listener
        identifier: 'cart--cart--update-currency'
        event: Extcode\Cart\Event\Cart\UpdateCurrency

  Extcode\Cart\EventListener\Mail\AttachmentFromOrderItem:
    tags:
      - name: event.listener
        identifier: 'cart--mail--attachment-from-order-item'

  Extcode\Cart\EventListener\Mail\AttachmentFromTypoScript:
    tags:
      - name: event.listener
        identifier: 'cart--mail--attachment-from-typoscript'

  Extcode\Cart\EventListener\Order\Create\Order:
    tags:
      - name: event.listener
        identifier: 'cart--order--create--order'
        event: Extcode\Cart\Event\Order\CreateEvent

  Extcode\Cart\EventListener\Order\Create\PersistOrder\Item:
    tags:
      - name: event.listener
        identifier: 'cart--order--create--persist-order--item'
        event: Extcode\Cart\Event\Order\PersistOrderEvent

  Extcode\Cart\EventListener\Order\Create\PersistOrder\TaxClasses:
    tags:
      - name: event.listener
        identifier: 'cart--order--create--persist-order--tax-classes'
        event: Extcode\Cart\Event\Order\PersistOrderEvent
        after: 'cart--order--create--persist-order--item'

  Extcode\Cart\EventListener\Order\Create\PersistOrder\Taxes:
    tags:
      - name: event.listener
        identifier: 'cart--order--create--persist-order--taxes'
        event: Extcode\Cart\Event\Order\PersistOrderEvent
        after: 'cart--order--create--persist-order--tax-classes'

  Extcode\Cart\EventListener\Order\Create\PersistOrder\Products:
    tags:
      - name: event.listener
        identifier: 'cart--order--create--persist-order--products'
        event: Extcode\Cart\Event\Order\PersistOrderEvent
        after: 'cart--order--create--persist-order--tax-classes'

  Extcode\Cart\EventListener\Order\Create\PersistOrder\Coupons:
    tags:
      - name: event.listener
        identifier: 'cart--order--create--persist-order--coupons'
        event: Extcode\Cart\Event\Order\PersistOrderEvent
        after: 'cart--order--create--persist-order--tax-classes'

  Extcode\Cart\EventListener\Order\Create\PersistOrder\Payment:
    tags:
      - name: event.listener
        identifier: 'cart--order--create--persist-order--payment'
        event: Extcode\Cart\Event\Order\PersistOrderEvent
        after: 'cart--order--create--persist-order--tax-classes'

  Extcode\Cart\EventListener\Order\Create\PersistOrder\Shipping:
    tags:
      - name: event.listener
        identifier: 'cart--order--create--persist-order--shipping'
        event: Extcode\Cart\Event\Order\PersistOrderEvent
        after: 'cart--order--create--persist-order--tax-classes'

  Extcode\Cart\EventListener\Order\Create\OrderNumber:
    arguments:
      $persistenceManager: '@TYPO3\CMS\Extbase\Persistence\Generic\PersistenceManager'
    tags:
      - name: event.listener
        identifier: 'cart--order--create--order-number'
        event: Extcode\Cart\Event\Order\NumberGeneratorEvent
        after: 'cart--order--create--order'

  Extcode\Cart\EventListener\Order\Create\InvoiceNumber:
    arguments:
      $persistenceManager: '@TYPO3\CMS\Extbase\Persistence\Generic\PersistenceManager'
    tags:
      - name: event.listener
        identifier: 'cart--order--create--invoice-number'
        event: Extcode\Cart\Event\Order\NumberGeneratorEvent
        after: 'cart--order--create--order'

  Extcode\Cart\EventListener\Order\Create\DeliveryNumber:
    arguments:
      $persistenceManager: '@TYPO3\CMS\Extbase\Persistence\Generic\PersistenceManager'
    tags:
      - name: event.listener
        identifier: 'cart--order--create--delivery-number'
        event: Extcode\Cart\Event\Order\NumberGeneratorEvent
        after: 'cart--order--create--order'

  Extcode\Cart\EventListener\Order\Finish\ClearCart:
    tags:
      - name: event.listener
        identifier: 'cart--order--finish--clear-cart'
        event: Extcode\Cart\Event\Order\FinishEvent
        after: 'cart--order--finish--email'

  Extcode\Cart\EventListener\Order\Finish\Email:
    tags:
      - name: event.listener
        identifier: 'cart--order--finish--email'
        event: Extcode\Cart\Event\Order\FinishEvent

  Extcode\Cart\EventListener\Order\Update\LogServiceUpdate:
    tags:
      - name: event.listener
        identifier: 'cart--order--update--log-service-update'
        event: Extcode\Cart\Event\Order\UpdateServiceEvent

  Extcode\Cart\Service\CurrencyTranslationServiceInterface:
    alias: Extcode\Cart\Service\CurrencyTranslationService
    public: true

  Extcode\Cart\Service\PaymentMethodsFromTypoScriptService:
    public: true

  Extcode\Cart\Service\ShippingMethodsFromTypoScriptService:
    public: true

  Extcode\Cart\Service\SpecialOptionsFromTypoScriptService:
    public: true

  Extcode\Cart\Service\TaxClassService:
    public: true

  Extcode\Cart\View\CartTemplateView:
    public: true

  querybuilder.tx_cart_domain_model_order_item:
    class: 'TYPO3\CMS\Core\Database\Query\QueryBuilder'
    factory:
      - '@TYPO3\CMS\Core\Database\ConnectionPool'
      - 'getQueryBuilderForTable'
    arguments:
      - 'tx_cart_domain_model_order_item'
