<model>
    <mount>//tests/OPNsense/TestModel</mount>
    <version>1.0.0</version>
    <description>OPNsense RecursiveModel test</description>
    <items>
        <!-- container -->
        <general>
            <!-- fields -->
            <FromEmail type="EmailField">
                <Default>sample@example.com</Default>
                <Required>Y</Required>
            </FromEmail>
        </general>
        <arraytypes>
            <item type="ArrayField">
                <number type="IntegerField">
                    <MinimumValue>1</MinimumValue>
                    <MaximumValue>65535</MaximumValue>
                    <ValidationMessage>not a valid number</ValidationMessage>
                    <Required>Y</Required>
                    <Constraints>
                        <check001>
                            <ValidationMessage>number should be unique</ValidationMessage>
                            <type>UniqueConstraint</type>
                            <addFields>
                                <field1>optfield</field1>
                            </addFields>
                        </check001>
                    </Constraints>
                </number>
                <optfield type="TextField">
                </optfield>
            </item>
        </arraytypes>
        <AllOrNone>
            <value1 type="TextField">
                <Constraints>
                    <check001>
                        <ValidationMessage>All fields should contain data or none of them</ValidationMessage>
                        <type>AllOrNoneConstraint</type>
                        <addFields>
                            <field2>value2</field2>
                            <field3>value3</field3>
                        </addFields>
                    </check001>
                </Constraints>
            </value1>
            <value2 type="TextField">
                <Constraints>
                    <check001>
                        <reference>value1.check001</reference>
                    </check001>
                </Constraints>
            </value2>
            <value3 type="TextField">
                <Constraints>
                    <check001>
                        <reference>value1.check001</reference>
                    </check001>
                </Constraints>
            </value3>
        </AllOrNone>
        <SingleSelect>
            <value1 type="TextField">
                <Constraints>
                    <check001>
                        <ValidationMessage>Only one option could be selected</ValidationMessage>
                        <type>SingleSelectConstraint</type>
                        <addFields>
                            <field2>value2</field2>
                            <field3>value3</field3>
                        </addFields>
                    </check001>
                </Constraints>
            </value1>
            <value2 type="TextField">
                <Constraints>
                    <check001>
                        <reference>value1.check001</reference>
                    </check001>
                </Constraints>
            </value2>
            <value3 type="TextField">
                <Constraints>
                    <check001>
                        <reference>value1.check001</reference>
                    </check001>
                </Constraints>
            </value3>
        </SingleSelect>
        <DependConstraint>
            <value1 type="BooleanField">
                <Default>0</Default>
                <Required>Y</Required>
                <Constraints>
                    <check001>
                        <reference>value2.check001</reference>
                    </check001>
                </Constraints>
            </value1>
            <value2 type="TextField">
                <Constraints>
                    <check001>
                        <type>DependConstraint</type>
                        <ValidationMessage>when value1 is enabled value2 is required</ValidationMessage>
                        <addFields>
                            <field1>value1</field1>
                        </addFields>
                    </check001>
                </Constraints>
            </value2>
        </DependConstraint>
        <simpleList>
            <items type="ArrayField">
                <number type="IntegerField"/>
            </items>
        </simpleList>
    </items>
</model>
