<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Config:etc/system_file.xsd">
    <system>
        <tab id="autogedal" translate="label" sortOrder="500">
            <label>Autogedal</label>
        </tab>
        <section id="autogedal_stock_source_router" translate="label" sortOrder="110" showInDefault="1" showInWebsite="0" showInStore="0">
            <label>Stock Source Routing</label>
            <tab>autogedal</tab>
            <resource>Autogedal_StockSourceRouter::stock_source_router</resource>
            <group id="rules" translate="label" sortOrder="10" showInDefault="1" showInWebsite="0" showInStore="0">
                <label>Routing Rules</label>
                <field id="routing_rules" translate="label" sortOrder="10" showInDefault="1" showInWebsite="0" showInStore="0">
                    <label>Rules</label>
                    <frontend_model>Autogedal\StockSourceRouter\Block\Adminhtml\Form\Field\RoutingRules</frontend_model>
                    <backend_model>Magento\Config\Model\Config\Backend\Serialized\ArraySerialized</backend_model>
                    <comment>Define which source owns each SKU. When the primary source sets stock to 0, the fallback source takes over automatically. Separate multiple SKUs with comma.</comment>
                </field>
            </group>
        </section>
    </system>
</config>
