<?xml version="1.0"?>

<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
    <!-- Overrides -->
    <preference for="Magento\Sales\Model\Order\Address\Validator" type="BlueLogic\ExtendedSales\Model\Order\Address\Validator" />
    <preference for="Magento\Sales\Model\Order\Pdf\Items\Invoice\DefaultInvoice" type="BlueLogic\ExtendedSales\Model\Order\Pdf\Items\Invoice\DefaultInvoice" />
    <preference for="Magento\Sales\Model\Order\Pdf\Invoice" type="BlueLogic\ExtendedSales\Model\Order\Pdf\Invoice" />
    <type name="Magento\SalesRule\Model\Rule">
        <plugin name="customer_promo_save"
                type="BlueLogic\ExtendedSales\Plugin\CustomerPromoSave"
                sortOrder="1"/>
    </type>
    <preference for="BlueLogic\ExtendedSales\Api\Data\ConsumerPromoInterface"
                type="BlueLogic\ExtendedSales\Model\ConsumerPromo"/>
    <preference for="BlueLogic\ExtendedSales\Api\ConsumerPromoRepositoryInterface"
                type="BlueLogic\ExtendedSales\Model\ConsumerPromoRepository"/>
    <preference for="Amasty\RulesPro\Model\Rule\Condition\Customer" type="BlueLogic\ExtendedSales\Model\Rule\Condition\Customer" />
    <preference for="Magento\SalesRule\Model\Utility" type="BlueLogic\ExtendedSales\Model\Utility"/>

    <type name="Magento\Framework\View\Element\UiComponent\DataProvider\CollectionFactory">
		<plugin
			name="sales_order_additional_columns"
			type="BlueLogic\ExtendedSales\Plugin\AdditionalFields\CollectionFactory"
			sortOrder="1"
			disabled="false"
		/>
	</type>
    <type name="Magento\Sales\Model\Order\StatusLabel">
        <arguments>
            <argument name="maskStatusesMapping" xsi:type="array">
                <item name="frontend" xsi:type="array">
                    <item name="payment_review" xsi:type="const">Magento\Sales\Model\Order::STATE_PAYMENT_REVIEW</item>
                </item>
            </argument>
        </arguments>
    </type>
    <type name="Magento\Sales\Block\Adminhtml\Order\View">
       <plugin name="addAccptedButton" type="BlueLogic\ExtendedSales\Plugin\Adminhtml\Sales\Block\Order\AcceptButton"/>
   </type>
    <virtualType name="Magento\Sales\Model\ResourceModel\Order\Grid" type="Magento\Sales\Model\ResourceModel\Grid">
        <arguments>
            <argument name="columns" xsi:type="array">
                <item name="order_accepted" xsi:type="string">sales_order.order_accepted</item>
            </argument>
        </arguments>
    </virtualType>
    <type name="Magento\Quote\Model\Quote">
		<plugin name="BlueLogic_ExtendedSales_Plugin_Magento_Quote_Model_Quote" type="BlueLogic\ExtendedSales\Plugin\Quote\Model\Quote" sortOrder="10" disabled="false"/>
	</type>
    <type name="Magento\Quote\Model\Quote\Validator\MinimumOrderAmount\ValidationMessage">
		<plugin name="BlueLogic_ExtendedSales_Plugin_Magento_Quote_Model_Quote_Validator_MinimumOrderAmount_ValidationMessage" type="BlueLogic\ExtendedSales\Plugin\Quote\Model\Quote\Validator\MinimumOrderAmount\ValidationMessage" sortOrder="10" disabled="false"/>
	</type>
</config>
