<?xml version="1.0" ?>

<container xmlns="http://symfony.com/schema/dic/services"
           xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
           xsi:schemaLocation="http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd">

    <services>
        <service id="Shopware\Core\Checkout\Order\OrderDefinition">
            <tag name="shopware.entity.definition"/>
        </service>

        <service id="Shopware\Core\Checkout\Order\Aggregate\OrderAddress\OrderAddressDefinition">
            <tag name="shopware.entity.definition"/>
        </service>

        <service id="Shopware\Core\Checkout\Order\OrderExceptionHandler">
            <tag name="shopware.dal.exception_handler"/>
        </service>

        <service id="Shopware\Core\Checkout\Order\Aggregate\OrderCustomer\OrderCustomerDefinition">
            <tag name="shopware.entity.definition"/>
        </service>

        <service id="Shopware\Core\Checkout\Order\Aggregate\OrderDelivery\OrderDeliveryDefinition">
            <tag name="shopware.entity.definition"/>
        </service>

        <service id="Shopware\Core\Checkout\Order\Aggregate\OrderDeliveryPosition\OrderDeliveryPositionDefinition">
            <tag name="shopware.entity.definition"/>
        </service>

        <service id="Shopware\Core\Checkout\Order\Aggregate\OrderLineItem\OrderLineItemDefinition">
            <tag name="shopware.entity.definition"/>
        </service>

        <service id="Shopware\Core\Checkout\Order\Aggregate\OrderLineItemDownload\OrderLineItemDownloadDefinition">
            <tag name="shopware.entity.definition"/>
        </service>

        <service id="Shopware\Core\Checkout\Order\Aggregate\OrderTag\OrderTagDefinition">
            <tag name="shopware.entity.definition"/>
        </service>

        <service id="Shopware\Core\Checkout\Order\Aggregate\OrderTransaction\OrderTransactionDefinition">
            <tag name="shopware.entity.definition"/>
        </service>

        <service id="Shopware\Core\Checkout\Order\Aggregate\OrderTransactionCapture\OrderTransactionCaptureDefinition">
            <tag name="shopware.entity.definition"/>
        </service>

        <service id="Shopware\Core\Checkout\Order\Aggregate\OrderTransactionCaptureRefund\OrderTransactionCaptureRefundDefinition">
            <tag name="shopware.entity.definition"/>
        </service>

        <service id="Shopware\Core\Checkout\Order\Aggregate\OrderTransactionCaptureRefundPosition\OrderTransactionCaptureRefundPositionDefinition">
            <tag name="shopware.entity.definition"/>
        </service>

        <service id="Shopware\Core\Checkout\Order\SalesChannel\OrderService">
            <argument type="service" id="Shopware\Core\Framework\Validation\DataValidator"/>
            <argument type="service" id="Shopware\Core\Checkout\Order\Validation\OrderValidationFactory"/>
            <argument type="service" id="event_dispatcher"/>
            <argument type="service" id="Shopware\Core\Checkout\Cart\SalesChannel\CartService"/>
            <argument type="service" id="payment_method.repository"/>
            <argument type="service" id="Shopware\Core\System\StateMachine\StateMachineRegistry"/>
            <argument type="service" id="order.repository"/>
            <argument type="service" id="mail_template.repository"/>
            <argument type="service" id="document.repository"/>
            <argument type="service" id="Shopware\Core\Content\Mail\Service\MailService"/>
            <argument type="service" id="sales_channel.repository"/>
        </service>

        <service id="Shopware\Core\Checkout\Order\Validation\OrderValidationFactory"/>

        <service id="Shopware\Core\Checkout\Cart\Order\OrderPersister">
            <argument type="service" id="order.repository"/>
            <argument type="service" id="Shopware\Core\Checkout\Cart\Order\OrderConverter"/>
        </service>

        <service id="Shopware\Core\Checkout\Cart\Order\LineItemDownloadLoader">
            <argument type="service" id="product_download.repository"/>
        </service>

        <service id="Shopware\Core\Checkout\Cart\Order\OrderConverter">
            <argument type="service" id="customer.repository"/>
            <argument type="service" id="Shopware\Core\System\SalesChannel\Context\SalesChannelContextFactory"/>
            <argument type="service" id="event_dispatcher"/>
            <argument type="service" id="Shopware\Core\System\NumberRange\ValueGenerator\NumberRangeValueGeneratorInterface"/>
            <argument type="service" id="Shopware\Core\Checkout\Order\OrderDefinition"/>
            <argument type="service" id="order_address.repository"/>
            <argument type="service" id="Shopware\Core\System\StateMachine\Loader\InitialStateIdLoader"/>
            <argument type="service" id="Shopware\Core\Checkout\Cart\Order\LineItemDownloadLoader"/>
            <argument type="service" id="rule.repository"/>
        </service>

        <service id="Shopware\Core\Checkout\Order\Aggregate\OrderTransaction\OrderTransactionStateHandler">
            <argument type="service" id="Shopware\Core\System\StateMachine\StateMachineRegistry"/>
        </service>

        <service id="Shopware\Core\Checkout\Order\Aggregate\OrderTransactionCapture\OrderTransactionCaptureStateHandler">
            <argument type="service" id="Shopware\Core\System\StateMachine\StateMachineRegistry"/>
        </service>

        <service id="Shopware\Core\Checkout\Order\Aggregate\OrderTransactionCaptureRefund\OrderTransactionCaptureRefundStateHandler">
            <argument type="service" id="Shopware\Core\System\StateMachine\StateMachineRegistry"/>
        </service>

        <!-- controller -->
        <service id="Shopware\Core\Checkout\Order\Api\OrderActionController" public="true">
            <argument type="service" id="Shopware\Core\Checkout\Order\SalesChannel\OrderService" />
            <argument type="service" id="Doctrine\DBAL\Connection"/>
            <argument type="service" id="Shopware\Core\Checkout\Payment\Cart\PaymentRefundProcessor"/>
            <call method="setContainer">
                <argument type="service" id="service_container"/>
            </call>
        </service>

        <service id="Shopware\Core\Checkout\Order\SalesChannel\OrderRoute" public="true">
            <argument type="service" id="order.repository"/>
            <argument type="service" id="promotion.repository"/>
            <argument type="service" id="shopware.rate_limiter"/>
        </service>

        <service id="Shopware\Core\Checkout\Order\SalesChannel\CancelOrderRoute" public="true">
            <argument type="service" id="Shopware\Core\Checkout\Order\SalesChannel\OrderService"/>
            <argument type="service" id="order.repository"/>
        </service>

        <service id="Shopware\Core\Checkout\Order\SalesChannel\SetPaymentOrderRoute" public="true">
            <argument type="service" id="Shopware\Core\Checkout\Order\SalesChannel\OrderService"/>
            <argument type="service" id="order.repository"/>
            <argument type="service" id="Shopware\Core\Checkout\Payment\SalesChannel\PaymentMethodRoute"/>
            <argument type="service" id="Shopware\Core\Checkout\Cart\Order\OrderConverter"/>
            <argument type="service" id="Shopware\Core\Checkout\Cart\CartRuleLoader"/>
            <argument type="service" id="event_dispatcher"/>
            <argument type="service" id="Shopware\Core\System\StateMachine\Loader\InitialStateIdLoader"/>
        </service>

        <!-- events -->
        <service id="Shopware\Core\Checkout\Order\Listener\OrderStateChangeEventListener">
            <argument type="service" id="order.repository"/>
            <argument type="service" id="order_transaction.repository"/>
            <argument type="service" id="order_delivery.repository"/>
            <argument type="service" id="event_dispatcher"/>
            <tag name="kernel.event_subscriber"/>
            <argument type="service" id="Shopware\Core\Framework\Event\BusinessEventCollector"/>
            <argument type="service" id="state_machine_state.repository"/>
        </service>

        <service id="Shopware\Core\Checkout\Order\Subscriber\OrderSalutationSubscriber">
            <argument type="service" id="Doctrine\DBAL\Connection"/>
            <tag name="kernel.event_subscriber"/>
        </service>
    </services>
</container>
