<!--
  ~ Copyright (c) 2023-2024 Evolveum and contributors
  ~
  ~ This work is dual-licensed under the Apache License 2.0
  ~ and European Union Public License. See LICENSE file for details.
  -->
<c:resource xmlns="http://midpoint.evolveum.com/xml/ns/public/common/common-3"
            xmlns:c="http://midpoint.evolveum.com/xml/ns/public/common/common-3"
            xmlns:q="http://prism.evolveum.com/xml/ns/public/query-3"
            xmlns:icfc="http://midpoint.evolveum.com/xml/ns/public/connector/icf-1/connector-schema-3"
            xmlns:ri="http://midpoint.evolveum.com/xml/ns/public/resource/instance-3"
            oid="fd4e5dce-b4c4-4777-b7cb-facc6ed8cec8">

    <c:name>HR</c:name>

    <connectorRef type="ConnectorType">
        <filter>
            <q:equal>
                <q:path>c:connectorType</q:path>
                <q:value>com.evolveum.polygon.connector.csv.CsvConnector</q:value>
            </q:equal>
        </filter>
    </connectorRef>

    <connectorConfiguration>
        <icfc:configurationProperties
                xmlns:icfccsvfile="http://midpoint.evolveum.com/xml/ns/public/connector/icf-1/bundle/com.evolveum.polygon.connector-csv/com.evolveum.polygon.connector.csv.CsvConnector">
            <icfccsvfile:filePath>TODO-PATH/hr.csv</icfccsvfile:filePath> <!-- TODO set the correct path here -->
            <icfccsvfile:encoding>utf-8</icfccsvfile:encoding>
            <icfccsvfile:fieldDelimiter>,</icfccsvfile:fieldDelimiter>
            <icfccsvfile:multivalueDelimiter>;</icfccsvfile:multivalueDelimiter>
            <icfccsvfile:uniqueAttribute>empNo</icfccsvfile:uniqueAttribute>
        </icfc:configurationProperties>
    </connectorConfiguration>

    <schemaHandling>
        <objectType>
            <kind>account</kind>
            <intent>default</intent>
            <default>true</default>
            <delineation>
                <objectClass>ri:AccountObjectClass</objectClass>
            </delineation>
            <focus>
                <type>UserType</type>
                <archetypeRef oid="00000000-0000-0000-0000-000000000702"/>
            </focus>
            <attribute>
                <ref>ri:empNo</ref>
                <correlator>
                    <focusItem>personalNumber</focusItem>
                </correlator>
                <inbound>
                    <name>personalNumber</name>
                    <strength>strong</strength>
                    <target>
                        <path>personalNumber</path>
                    </target>
                </inbound>
            </attribute>
            <attribute>
                <ref>ri:firstName</ref>
                <inbound>
                    <name>givenName</name>
                    <strength>strong</strength>
                    <target>
                        <path>givenName</path>
                    </target>
                </inbound>
            </attribute>
            <attribute>
                <ref>ri:lastName</ref>
                <inbound>
                    <name>familyName</name>
                    <strength>strong</strength>
                    <target>
                        <path>familyName</path>
                    </target>
                </inbound>
            </attribute>
            <attribute>
                <ref>ri:phone</ref>
                <inbound>
                    <name>telephoneNumber</name>
                    <strength>strong</strength>
                    <target>
                        <path>telephoneNumber</path>
                    </target>
                </inbound>
            </attribute>
            <attribute>
                <ref>ri:department</ref>
                <inbound>
                    <name>organizationalUnit</name>
                    <strength>strong</strength>
                    <target>
                        <path>organizationalUnit</path>
                    </target>
                </inbound>
            </attribute>
            <synchronization>
                <reaction>
                    <name>unmatched</name>
                    <situation>unmatched</situation>
                    <actions>
                        <addFocus/>
                    </actions>
                </reaction>
                <reaction>
                    <name>unlinked</name>
                    <situation>unlinked</situation>
                    <actions>
                        <link/>
                    </actions>
                </reaction>
                <reaction>
                    <name>linked</name>
                    <situation>linked</situation>
                    <actions>
                        <synchronize/>
                    </actions>
                </reaction>
                <reaction>
                    <name>deleted</name>
                    <situation>deleted</situation>
                    <actions>
                        <inactivateFocus/>
                    </actions>
                </reaction>
            </synchronization>
        </objectType>
    </schemaHandling>
</c:resource>
