<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
    <preference for="Yeboyebo\Sync\Api\Sales\Orders\SynchronizedInterface" type="Yeboyebo\Sync\Model\Sales\Orders\Synchronized"/>
    <preference for="Yeboyebo\Sync\Api\Sales\Orders\OrdersInterface" type="Yeboyebo\Sync\Model\Sales\Orders\ListOrders"/>
    
    <preference for="Yeboyebo\Sync\Api\Sales\Orders\SetStateInterface" type="Yeboyebo\Sync\Model\Sales\Orders\SetState"/>
    <preference for="Yeboyebo\Sync\Api\Catalog\Products\GetProductsInterface" type="Yeboyebo\Sync\Model\Catalog\Products\GetProducts"/>
    <preference for="Yeboyebo\Sync\Api\Sales\Orders\GenerateRefundPaypalInterface" type="Yeboyebo\Sync\Model\Sales\Orders\GenerateRefundPaypal"/>
    <preference for="Yeboyebo\Sync\Api\Sales\Orders\GenerateRefundStoreInterface" type="Yeboyebo\Sync\Model\Sales\Orders\GenerateRefundStore"/>
    <preference for="Yeboyebo\Sync\Api\Sales\Orders\GeneratePickupECIInterface" type="Yeboyebo\Sync\Model\Sales\Orders\GeneratePickupECI"/>


    <preference for="Magento\Customer\Model\EmailNotification" type="Yeboyebo\Sync\Model\Customer\Model\EmailNotification" />
    <preference for="Magento\CatalogUrlRewrite\Model\ProductUrlPathGenerator" type="Yeboyebo\Sync\Model\ProductUrlPathGenerator" />
    <preference for="Magento\Customer\Controller\Account\CreatePost" type="Yeboyebo\Sync\Controller\Account\CreatePost" />
    <preference for="Magento\Catalog\Api\ProductRepositoryInterface" type="Yeboyebo\Sync\Model\Catalog\CatalogRepository"/>
    <preference for="Yeboyebo\Sync\Api\Catalog\Products\StockIncremental" type="Yeboyebo\Sync\Model\Catalog\Products\StockIncremental"/>
    <preference for="Yeboyebo\Sync\Api\Catalog\Products\StockCanalVenta" type="Yeboyebo\Sync\Model\Catalog\Products\StockCanalVenta"/>
    <preference for="Magento\Catalog\Model\Product\Price\Validation\TierPriceValidator" type="Yeboyebo\Sync\Model\Product\Price\Validation\TierPriceValidator"/>
    <!-- El core no casa website_id al borrar tier prices (tier-prices-delete) -->
    <type name="Magento\Catalog\Api\TierPriceStorageInterface">
        <plugin name="yeboyebo_sync_tier_price_delete_website" type="Yeboyebo\Sync\Plugin\Catalog\TierPriceStorageDeletePlugin"/>
    </type>

    <preference for="Yeboyebo\Sync\Api\Rma\SetStateInterface" type="Yeboyebo\Sync\Model\Rma\SetState"/>
    <type name="Magento\Framework\Webapi\Validator\EntityArrayValidator">
        <arguments>
            <argument name="complexArrayItemLimit" xsi:type="number">10000</argument>
        </arguments>
    </type>

    <!-- Sincronizar credits memo de pedido sin ser rmas -->
    <preference for="Magento\Sales\Controller\Adminhtml\Order\Creditmemo\Save" type="Yeboyebo\Sync\Controller\Adminhtml\Order\Creditmemo\Save"/>
    
    <preference for="Yeboyebo\Sync\Api\Catalog\Products\AssignRelatedProducts" type="Yeboyebo\Sync\Model\Catalog\Products\AssignRelatedProducts"/>

    <!-- Comando sincronizar contactos de GoogleAds -->
    <type name="Magento\Framework\Console\CommandList">
        <arguments>
            <argument name="commands" xsi:type="array">
                <item name="sincronizaContactsGoogleAds" xsi:type="object">Yeboyebo\Sync\Console\SincronizaContactos</item>
            </argument>
        </arguments>
    </type>
</config>