<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
    <!-- Inject Guzzle into your Auth Service -->
    <type name="Gti\Salesforce\Service\Auth">
        <arguments>
            <argument name="client" xsi:type="object">GuzzleHttp\Client</argument>
        </arguments>
    </type>

    <!-- Configure the Custom Logger with the Custom Handler -->
    <type name="Gti\Salesforce\Model\Logger\Logger">
        <arguments>
            <argument name="name" xsi:type="string">salesforceLogger</argument>
            <argument name="handlers" xsi:type="array">
                <item name="system" xsi:type="object">Gti\Salesforce\Model\Logger\Handler</item>
            </argument>
        </arguments>
    </type>

    <!-- Inject the Custom Logger into the Controller -->
    <type name="Gti\Salesforce\Controller\Adminhtml\System\Config\Test">
        <arguments>
            <argument name="logger" xsi:type="object">Gti\Salesforce\Model\Logger\Logger</argument>
        </arguments>
    </type>

    <type name="Gti\Salesforce\Service\OrderSync">
        <arguments>
            <argument name="logger" xsi:type="object">Gti\Salesforce\Model\Logger\Logger</argument>
            <argument name="httpClient" xsi:type="object">GuzzleHttp\Client</argument>
        </arguments>
    </type>

    <type name="Magento\Framework\Console\CommandList">
        <arguments>
            <argument name="commands" xsi:type="array">
                <item name="gti_sf_sync" xsi:type="object">Gti\Salesforce\Console\Command\SyncOrdersCommand</item>
            </argument>
        </arguments>
    </type>
</config>
