<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
    <!--DATA-->
    <preference for="Mirasvit\GeoIp\Api\Data\RuleInterface" type="Mirasvit\GeoIp\Model\Rule"/>

    <!-- GeoLocation Module Registry -->
    <type name="Mirasvit\GeoLocation\Service\GeoLocationModuleRegistry">
        <arguments>
            <argument name="modulesPool" xsi:type="array">
                <item name="Mirasvit_GeoIp" xsi:type="array">
                    <item name="label" xsi:type="string">IP Geolocation Redirect</item>
                </item>
            </argument>
        </arguments>
    </type>

    <!--Entity Manager-->
    <type name="Magento\Framework\EntityManager\MetadataPool">
        <arguments>
            <argument name="metadata" xsi:type="array">
                <item name="Mirasvit\GeoIp\Api\Data\RuleInterface" xsi:type="array">
                    <item name="entityTableName" xsi:type="const">Mirasvit\GeoIp\Api\Data\RuleInterface::TABLE_NAME</item>
                    <item name="identifierField" xsi:type="const">Mirasvit\GeoIp\Api\Data\RuleInterface::ID</item>
                </item>
            </argument>
        </arguments>
    </type>
    <type name="Magento\Framework\EntityManager\HydratorPool">
        <arguments>
            <argument name="hydrators" xsi:type="array">
                <item name="Mirasvit\GeoIp\Api\Data\RuleInterface" xsi:type="string">Magento\Framework\EntityManager\AbstractModelHydrator</item>
            </argument>
        </arguments>
    </type>

    <!--UI-->
    <type name="Magento\Framework\View\Element\UiComponent\DataProvider\CollectionFactory">
        <arguments>
            <argument name="collections" xsi:type="array">
                <item name="geoIp_rule_listing_data_source" xsi:type="string">Mirasvit\GeoIp\Model\ResourceModel\Rule\Grid</item>
            </argument>
        </arguments>
    </type>

    <!--Validator-->
    <type name="Mirasvit\Core\Api\Service\ValidationServiceInterface">
        <arguments>
            <argument name="validators" xsi:type="array">
                <item name="geoip" xsi:type="object">Mirasvit\GeoIp\Service\ValidationService</item>
            </argument>
        </arguments>
    </type>
</config>
