<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
	<type name="Magento\Sales\Api\OrderManagementInterface">
        <plugin name="ec" type="Anowave\Ec\Plugin\Order\PlaceAfter" sortOrder="99" />
    </type>
    <virtualType name="Anowave\Ec\Model\ResourceModel\Consent\Collection">
        <arguments>
            <argument name="mainTable" xsi:type="string">ae_ec_gdpr</argument>
            <argument name="eventPrefix" xsi:type="string">track_consent_grid_collection</argument>
        	<argument name="eventObject" xsi:type="string">consent_grid_collection</argument>
            <argument name="resourceModel" xsi:type="string">Anowave\Ec\Model\ResourceModel\Consent</argument>
        </arguments>
    </virtualType>
    <virtualType name="Anowave\Ec\Model\ResourceModel\ConsentCookie\Collection">
        <arguments>
            <argument name="mainTable" xsi:type="string">ae_ec_gdpr_cookies</argument>
            <argument name="eventPrefix" xsi:type="string">track_consentcookie_grid_collection</argument>
        	<argument name="eventObject" xsi:type="string">consentcookie_grid_collection</argument>
            <argument name="resourceModel" xsi:type="string">Anowave\Ec\Model\ResourceModel\ConsentCookie</argument>
        </arguments>
    </virtualType>
    <type name="Magento\Framework\View\Element\UiComponent\DataProvider\CollectionFactory">
        <arguments>
            <argument name="collections" xsi:type="array">
                <item name="track_consent_listing_data_source" xsi:type="string">Anowave\Ec\Model\ResourceModel\Consent\Grid\Collection</item>
                <item name="track_consentcookie_listing_data_source" xsi:type="string">Anowave\Ec\Model\ResourceModel\ConsentCookie\Grid\Collection</item>
            </argument>
        </arguments>
    </type>
    <virtualType name="LogFilterPool" type="Magento\Framework\View\Element\UiComponent\DataProvider\FilterPool">
        <arguments>
            <argument name="appliers" xsi:type="array">
                <item name="regular" xsi:type="object">Magento\Framework\View\Element\UiComponent\DataProvider\RegularFilter</item>
                <item name="fulltext" xsi:type="object">Magento\Framework\View\Element\UiComponent\DataProvider\FulltextFilter</item>
            </argument>
        </arguments>
    </virtualType>
    <virtualType name="LogFilterPool" type="Magento\Framework\View\Element\UiComponent\DataProvider\DataProvider">
        <arguments>
            <argument name="collection" xsi:type="object" shared="false">Anowave\Ec\Model\ResourceModel\Log\Collection</argument>
            <argument name="filterPool" xsi:type="object" shared="false">LogFilterPool</argument>
        </arguments>
    </virtualType>
	<type name="Anowave\Ec\Model\ResourceModel\Log\Grid\Collection">
	    <arguments>
	        <argument name="mainTable" xsi:type="string">ae_ec_log</argument>
	        <argument name="eventPrefix" xsi:type="string">track_log_grid_collection</argument>
	        <argument name="eventObject" xsi:type="string">log_grid_collection</argument>
	        <argument name="resourceModel" xsi:type="string">Anowave\Ec\Model\ResourceModel\Log</argument>
	    </arguments>
	</type>
	<type name="Magento\Framework\View\Element\UiComponent\DataProvider\CollectionFactory">
	    <arguments>
	        <argument name="collections" xsi:type="array">
	            <item name="track_log_listing_data_source" xsi:type="string">Anowave\Ec\Model\ResourceModel\Log\Grid\Collection</item>
	        </argument>
	    </arguments>
	</type>
	<type name="Anowave\Ec\Logger\Handler">
        <arguments>
            <argument name="filesystem" xsi:type="object">Magento\Framework\Filesystem\Driver\File</argument>
        </arguments>
    </type>
    <type name="Anowave\Ec\Logger\Logger">
        <arguments>
            <argument name="name" xsi:type="string">ec</argument>
            <argument name="handlers"  xsi:type="array">
                <item name="system" xsi:type="object">Anowave\Ec\Logger\Handler</item>
            </argument>
        </arguments>
    </type>
</config>