<?xml version="1.0" encoding="UTF-8"?>
<changelog xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="./schema.xsd"> 
    <changeset id="WAR-1136_kroll_test_users:1" author="jviletto" run-always="true">
        <cypherquery>
            <![CDATA[
            WITH [
    {
        identityId: "2759bdbf-f68b-42ba-9ff9-b971fd3ada55",
        email: "ed.cradock+accounting-user1@kroll.com",
        firstName: "Kroll",
        lastName: "CA User 1",
        name: "Kroll CA User 1",
        auth0UserId: "651c78cce649077e7ce87989"
    },
    {
        identityId: "bc9588af-39c0-44e3-934a-954f0f0b329e",
        email: "ed.cradock+accounting-user2@kroll.com",
        firstName: "Kroll",
        lastName: "CA User 2",
        name: "Kroll CA User 2",
        auth0UserId: "651c79fe9ef766b2ff3d114a"
    },
    {
        identityId: "b0a5bd4c-63b1-475c-acc9-026507282124",
        email: "ed.cradock+collaborator-user1@kroll.com",
        firstName: "Kroll",
        lastName: "Collaborator User 1",
        name: "Kroll Collaborator User 1",
        auth0UserId: "651c7b2125be13b27511a155"
    },
    {
        identityId: "dd6f08d8-eb86-4dff-bc99-0ee8f621d699",
        email: "ed.cradock+collaborator-user2@kroll.com",
        firstName: "Kroll",
        lastName: "Collaborator User 2",
        name: "Kroll Collaborator User 2",
        auth0UserId: "651c7b75dc19f32877fe5580"
    }
] AS users
UNWIND range(0, size(users) - 1) AS i
WITH i, users[i].email AS email, users[i].identityId as identityId, users[i].firstName as firstName, users[i].lastName as lastName, users[i].name as name, users[i].auth0UserId as auth0UserId
MERGE (identity:Identity {id: identityId})
ON CREATE SET
    identity.email = email,
    identity.auth0UserId = auth0UserId,
    identity.localization = 'en',
    identity.lastName = lastName,
    identity.defaultBrand = 'theorchard',
    identity.userTypes = ['label'],
    identity.active = 'Y',
    identity.firstName = firstName,
    identity.numberFormat = 'us',
    identity.name = name;
            ]]>
        </cypherquery>
    </changeset>
    <changeset id="WAR-1136_kroll_test_users:2" author="jviletto" run-always="true">
        <cypherquery>
            <![CDATA[
            MATCH (i:Identity {email: 'ed.cradock+accounting-user1@kroll.com'}), (v:Vendor {id: 72810})
    WITH i, v
    MERGE(i)-[:HAS_PROFILE]->(p:Profile {profileType: 'MoneyhubProfile'})-[:HAS_ACCESS_TO]->(v)
        ON CREATE SET
    p.profileId = 90000039,
    p.profileName = 'MoneyhubProfile',
    p.uuid = apoc.create.uuid(),
    p.roles = ['accounting'];
            ]]>
        </cypherquery>
    </changeset>
    <changeset id="WAR-1136_kroll_test_users:3" author="jviletto" run-always="true">
        <cypherquery>
            <![CDATA[
            MATCH (i:Identity {email: 'ed.cradock+accounting-user2@kroll.com'}), (v:Vendor {id: 72810})
    WITH i, v
    MERGE(i)-[:HAS_PROFILE]->(p:Profile {profileType: 'MoneyhubProfile'})-[:HAS_ACCESS_TO]->(v)
        ON CREATE SET
    p.profileId = 90000040,
    p.profileName = 'MoneyhubProfile',
    p.uuid = apoc.create.uuid(),
    p.roles = ['accounting'];
            ]]>
        </cypherquery>
    </changeset>
    <changeset id="WAR-1136_kroll_test_users:4" author="jviletto" run-always="true">
        <cypherquery>
            <![CDATA[
            MATCH (i:Identity {email: 'ed.cradock+collaborator-user1@kroll.com'}), (v:Vendor {id: 36299})
    WITH i, v
    MERGE(i)-[:HAS_PROFILE]->(p:Profile {profileType: 'CollaboratorsProfile'})-[:HAS_ACCESS_TO]->(v)
        ON CREATE SET
    p.profileId = 90000041,
    p.profileName = 'CollaboratorsProfile',
    p.uuid = apoc.create.uuid(),
    p.roles = ['royalties'];
            ]]>
        </cypherquery>
    </changeset>
    <changeset id="WAR-1136_kroll_test_users:5" author="jviletto" run-always="true">
        <cypherquery>
            <![CDATA[
            MATCH (i:Identity {email: 'ed.cradock+collaborator-user2@kroll.com'}), (v:Vendor {id: 36299})
    WITH i, v
    MERGE(i)-[:HAS_PROFILE]->(p:Profile {profileType: 'CollaboratorsProfile'})-[:HAS_ACCESS_TO]->(v)
        ON CREATE SET
    p.profileId = 90000042,
    p.profileName = 'CollaboratorsProfile',
    p.uuid = apoc.create.uuid(),
    p.roles = ['royalties'];
            ]]>
        </cypherquery>
    </changeset>
</changelog>
