<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/ObjectManager/etc/config.xsd">
    <!-- API Interfaces -->
    <preference for="Reply\Invoice\Api\InvoiceBundlerInterface" type="Reply\Invoice\Model\InvoiceBundler"/>
    <preference for="Reply\Invoice\Api\VatRecordBundlerInterface" type="Reply\Invoice\Model\VatRecordBundler"/>
    <preference for="Reply\Invoice\Api\FileManagerInterface" type="Reply\Invoice\Model\FileManager"/>
    <preference for="Reply\Invoice\Api\SftpManagerInterface" type="Reply\Invoice\Model\SftpManager"/>
    <preference for="Reply\Invoice\Api\EmailManagerInterface" type="Reply\Invoice\Model\EmailManager"/>

    <!-- Custom logger -->
    <type name="Reply\Invoice\Logger\Handler">
        <arguments>
            <argument name="filesystem" xsi:type="object">Magento\Framework\Filesystem\Driver\File</argument>
        </arguments>
    </type>
    <type name="Reply\Invoice\Logger\Logger">
        <arguments>
            <argument name="name" xsi:type="string">FEMInvoiceLogger</argument>
            <argument name="handlers"  xsi:type="array">
                <item name="system" xsi:type="object">Reply\Invoice\Logger\Handler</item>
            </argument>
        </arguments>
    </type>

    <!-- Custom commands -->
    <type name="Magento\Framework\Console\CommandList">
        <arguments>
            <argument name="commands" xsi:type="array">
                <item name="vatrecord-bundle" xsi:type="object">Reply\Invoice\Command\InvoicesBundle</item>
            </argument>
        </arguments>
    </type>
    <type name="Magento\Framework\Console\CommandList">
        <arguments>
            <argument name="commands" xsi:type="array">
                <item name="invoices-bundle" xsi:type="object">Reply\Invoice\Command\VatRecordBundle</item>
            </argument>
        </arguments>
    </type>

    <!-- Unify the sequence for invoice and creditmemo -->
    <type name="Magento\SalesSequence\Model\Manager">
        <plugin name="reply_invoice_sequence_manager" type="Reply\Invoice\Plugin\ManagerPlugin"/>
    </type>

</config>
