<?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="DJOGlobal\ErpInvoiceSync\Api\Data\ErpInvoiceInterface" type="DJOGlobal\ErpInvoiceSync\Model\ErpInvoice"/>
    <preference for="DJOGlobal\ErpInvoiceSync\Api\Data\ErpInvoiceSearchResultsInterface" type="Magento\Framework\Api\SearchResults"/>
    <preference for="DJOGlobal\ErpInvoiceSync\Api\ErpInvoiceRepositoryInterface" type="DJOGlobal\ErpInvoiceSync\Model\ErpInvoiceRepository"/>

    <type name="Magento\Sales\Api\InvoiceRepositoryInterface">
        <plugin name="DJOGlobal_ErpInvoiceSync:AddErpInvoiceExtensionAttributes" type="DJOGlobal\ErpInvoiceSync\Plugin\AddErpInvoiceExtensionAttributes"/>
        <plugin name="DJOGlobal_ErpInvoiceSync:SaveErpInvoiceRowAfterInvoiceSave" type="DJOGlobal\ErpInvoiceSync\Plugin\SaveErpInvoiceRowAfterInvoiceSave"/>
    </type>

    <type name="DJOGlobal\ErpInvoiceSync\Logger\Handler">
        <arguments>
            <argument name="filesystem" xsi:type="object">Magento\Framework\Filesystem\Driver\File</argument>
        </arguments>
    </type>
    <type name="DJOGlobal\ErpInvoiceSync\Logger\Logger">
        <arguments>
            <argument name="name" xsi:type="string">erp_invoice_sync</argument>
            <argument name="handlers"  xsi:type="array">
                <item name="system" xsi:type="object">DJOGlobal\ErpInvoiceSync\Logger\Handler</item>
            </argument>
        </arguments>
    </type>
</config>
