<?xml version="1.0"?>
<!--
/**
 * @author Amasty Team
 * @copyright Copyright (c) Amasty (https://www.amasty.com)
 * @package Shipping Rules for Magento 2
 */-->

<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
    <type name="Amasty\Shiprules\Controller\Adminhtml\Rule\Delete">
        <arguments>
            <argument name="ruleModel" xsi:type="object" shared="false">Amasty\Shiprules\Model\Rule</argument>
            <argument name="resource" xsi:type="object">Amasty\Shiprules\Model\ResourceModel\Rule</argument>
        </arguments>
    </type>

    <type name="Amasty\Shiprules\Controller\Adminhtml\Rule\Duplicate">
        <arguments>
            <argument name="ruleModel" xsi:type="object" shared="false">Amasty\Shiprules\Model\Rule</argument>
            <argument name="resource" xsi:type="object">Amasty\Shiprules\Model\ResourceModel\Rule</argument>
        </arguments>
    </type>

    <type name="Amasty\Shiprules\Controller\Adminhtml\Rule\Edit">
        <arguments>
            <argument name="ruleModel" xsi:type="object" shared="false">Amasty\Shiprules\Model\Rule</argument>
            <argument name="resource" xsi:type="object">Amasty\Shiprules\Model\ResourceModel\Rule</argument>
        </arguments>
    </type>

    <type name="Amasty\Shiprules\Controller\Adminhtml\Rule\MassAction">
        <arguments>
            <argument name="collection" xsi:type="object" shared="false">Amasty\Shiprules\Model\ResourceModel\Rule\Collection</argument>
            <argument name="resource" xsi:type="object">Amasty\Shiprules\Model\ResourceModel\Rule</argument>
        </arguments>
    </type>

    <type name="Amasty\Shiprules\Controller\Adminhtml\Rule\Save">
        <arguments>
            <argument name="ruleModel" xsi:type="object" shared="false">Amasty\Shiprules\Model\Rule</argument>
            <argument name="resource" xsi:type="object">Amasty\Shiprules\Model\ResourceModel\Rule</argument>
        </arguments>
    </type>

    <type name="Amasty\Shiprules\Ui\Component\Grid\Rule\DataProvider">
        <arguments>
            <argument name="modifiersPool" xsi:type="object">Amasty\Shiprules\Ui\Component\Grid\Rule\Modifier\Pool</argument>
        </arguments>
    </type>

    <virtualType name="Amasty\Shiprules\Ui\Component\Grid\Rule\Modifier\Pool" type="Magento\Ui\DataProvider\Modifier\Pool">
        <arguments>
            <argument name="modifiers" xsi:type="array">
                <item name="modify_stores" xsi:type="array">
                    <item name="class" xsi:type="string">Amasty\Shiprules\Ui\Component\Grid\Rule\Modifiers\ModifyStores</item>
                    <item name="sortOrder" xsi:type="number">10</item>
                </item>
                <item name="modify_cust_groups" xsi:type="array">
                    <item name="class" xsi:type="string">Amasty\Shiprules\Ui\Component\Grid\Rule\Modifiers\ModifyCustGroups</item>
                    <item name="sortOrder" xsi:type="number">20</item>
                </item>
            </argument>
        </arguments>
    </virtualType>

    <type name="Amasty\Shiprules\Block\Adminhtml\System\Config\SuggestNotification">
        <arguments>
            <argument name="suggestModules" xsi:type="array">
                <item name="shipping_rules_hyva" xsi:type="string">Amasty_ShippingRulesHyva</item>
                <item name="shipping_rules_hyva_checkout" xsi:type="string">Amasty_ShippingRulesHyvaCheckout</item>
                <item name="shipping_rules_export" xsi:type="string">Amasty_ShipRulesExportEntity</item>
                <item name="shipping_rules_import" xsi:type="string">Amasty_ShipRulesImportEntity</item>
            </argument>
        </arguments>
    </type>

    <!-- import entities promo start -->
    <virtualType name="AmastyShiprulesAreaImport" type="Amasty\ImportCore\Import\Config\DemoEntityConfig">
        <arguments>
            <argument name="data" xsi:type="array">
                <item name="entity_code" xsi:type="string">amasty_shipping_area</item>
                <item name="name" xsi:type="string">Shipping Area</item>
                <item name="group" xsi:type="string">Amasty Shipping Area</item>
                <item name="is_hidden_in_lists" xsi:type="boolean">false</item>
                <item name="additional_data" xsi:type="array">
                    <item name="promoLink" xsi:type="string">https://amasty.com/docs/doku.php?id=magento_2:shipping-rules&amp;utm_source=extension&amp;utm_medium=backend&amp;utm_campaign=suggest_shiprules#additional_packages_provided_in_composer_suggestions</item>
                </item>
            </argument>
        </arguments>
    </virtualType>
    <virtualType name="AmastyShiprulesRuleImport" type="Amasty\ImportCore\Import\Config\DemoEntityConfig">
        <arguments>
            <argument name="data" xsi:type="array">
                <item name="entity_code" xsi:type="string">amasty_shiprules_rule</item>
                <item name="name" xsi:type="string">Shipping Rules</item>
                <item name="group" xsi:type="string">Amasty Shipping Rules</item>
                <item name="is_hidden_in_lists" xsi:type="boolean">false</item>
                <item name="additional_data" xsi:type="array">
                    <item name="promoLink" xsi:type="string">https://amasty.com/docs/doku.php?id=magento_2:shipping-rules&amp;utm_source=extension&amp;utm_medium=backend&amp;utm_campaign=suggest_shiprules#additional_packages_provided_in_composer_suggestions</item>
                </item>
            </argument>
        </arguments>
    </virtualType>

    <type name="Amasty\ImportCore\Import\Config\DemoEntitiesPool">
        <arguments>
            <argument name="demoEntities" xsi:type="array">
                <item name="amasty_shipping_area" xsi:type="object">AmastyShiprulesAreaImport</item>
                <item name="amasty_shiprules_rule" xsi:type="object">AmastyShiprulesRuleImport</item>
            </argument>
        </arguments>
    </type>
    <!-- import entities promo end -->

    <!-- export entities promo start -->
    <virtualType name="AmastyShiprulesAreaExport" type="Amasty\ExportCore\Export\Config\DemoEntityConfig">
        <arguments>
            <argument name="data" xsi:type="array">
                <item name="entity_code" xsi:type="string">amasty_shipping_area</item>
                <item name="name" xsi:type="string">Shipping Area</item>
                <item name="group" xsi:type="string">Amasty Shipping Area</item>
                <item name="is_hidden_in_lists" xsi:type="boolean">false</item>
                <item name="additional_data" xsi:type="array">
                    <item name="promoLink" xsi:type="string">https://amasty.com/docs/doku.php?id=magento_2:shipping-rules&amp;utm_source=extension&amp;utm_medium=backend&amp;utm_campaign=suggest_shiprules#additional_packages_provided_in_composer_suggestions</item>
                </item>
            </argument>
        </arguments>
    </virtualType>
    <virtualType name="AmastyShiprulesRuleExport" type="Amasty\ExportCore\Export\Config\DemoEntityConfig">
        <arguments>
            <argument name="data" xsi:type="array">
                <item name="entity_code" xsi:type="string">amasty_shiprules_rule</item>
                <item name="name" xsi:type="string">Shipping Rules</item>
                <item name="group" xsi:type="string">Amasty Shipping Rules</item>
                <item name="is_hidden_in_lists" xsi:type="boolean">false</item>
                <item name="additional_data" xsi:type="array">
                    <item name="promoLink" xsi:type="string">https://amasty.com/docs/doku.php?id=magento_2:shipping-rules&amp;utm_source=extension&amp;utm_medium=backend&amp;utm_campaign=suggest_shiprules#additional_packages_provided_in_composer_suggestions</item>
                </item>
            </argument>
        </arguments>
    </virtualType>

    <type name="Amasty\ExportCore\Export\Config\DemoEntitiesPool">
        <arguments>
            <argument name="demoEntities" xsi:type="array">
                <item name="amasty_shipping_area" xsi:type="object">AmastyShiprulesAreaExport</item>
                <item name="amasty_shiprules_rule" xsi:type="object">AmastyShiprulesRuleExport</item>
            </argument>
        </arguments>
    </type>
    <!-- export entities promo end -->
</config>
