<?xml version="1.0" encoding="UTF-8"?>
<changelog xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="./schema.xsd">

    <changeset id="WAR-495_add_profiles_and_special_vendor_access:1" author="menger" run-on-change="true">
        <cypherquery>
            <![CDATA[

            MATCH (identity:Identity {email: 'agolovko@theorchard.com'})
            MERGE (increment:IncrementId {nodeName: 'Profile'})
                ON CREATE SET increment.id = 2
                ON MATCH SET increment.id = increment.id + 1
            CREATE (profile:Profile {
                profileId: (increment.id - 1),
                profileType: 'MoneyhubProfile',
                profileName: identity.name,
                brand: identity.defaultBrand,
                fullCatalogAccess: true,
                roles: ['accounting'],
                uuid: apoc.create.uuid()
            })
            MERGE (identity)-[:HAS_PROFILE]->(profile)
            WITH profile
            MATCH (vendor:Vendor {id: '*'})
            MERGE (profile)-[:HAS_ADMIN_ACCESS_TO]->(vendor)

            ]]>
        </cypherquery>
    </changeset>

    <changeset id="WAR-495_add_profiles_and_special_vendor_access:2" author="menger" run-on-change="true">
        <cypherquery>
            <![CDATA[

            MATCH (identity:Identity {email: 'ben.godding@awal.com'})
            MERGE (increment:IncrementId {nodeName: 'Profile'})
                ON CREATE SET increment.id = 2
                ON MATCH SET increment.id = increment.id + 1
            CREATE (profile:Profile {
                profileId: (increment.id - 1),
                profileType: 'MoneyhubProfile',
                profileName: identity.name,
                brand: identity.defaultBrand,
                fullCatalogAccess: true,
                roles: ['accounting'],
                uuid: apoc.create.uuid()
            })
            MERGE (identity)-[:HAS_PROFILE]->(profile)
            WITH profile
            MATCH (vendor:Vendor {id: '*'})
            MERGE (profile)-[:HAS_ADMIN_ACCESS_TO]->(vendor)

            ]]>
        </cypherquery>
    </changeset>

    <changeset id="WAR-495_add_profiles_and_special_vendor_access:3" author="menger" run-on-change="true">
        <cypherquery>
            <![CDATA[

            MATCH (identity:Identity {email: 'ciara.mcsorley@awal.com'})-[:HAS_PROFILE]->(profile:Profile {profileType: 'MoneyhubProfile'}),
                (vendor:Vendor {id: '*'})
            MERGE (profile)-[:HAS_ADMIN_ACCESS_TO]->(vendor)

            ]]>
        </cypherquery>
    </changeset>

    <changeset id="WAR-495_add_profiles_and_special_vendor_access:4" author="menger" run-on-change="true">
        <cypherquery>
            <![CDATA[

            MATCH (identity:Identity {email: 'epohrebna@theorchard.com'})
            MERGE (increment:IncrementId {nodeName: 'Profile'})
                ON CREATE SET increment.id = 2
                ON MATCH SET increment.id = increment.id + 1
            CREATE (profile:Profile {
                profileId: (increment.id - 1),
                profileType: 'MoneyhubProfile',
                profileName: identity.name,
                brand: identity.defaultBrand,
                fullCatalogAccess: true,
                roles: ['accounting'],
                uuid: apoc.create.uuid()
            })
            MERGE (identity)-[:HAS_PROFILE]->(profile)
            WITH profile
            MATCH (vendor:Vendor {id: '*'})
            MERGE (profile)-[:HAS_ADMIN_ACCESS_TO]->(vendor)

            ]]>
        </cypherquery>
    </changeset>

    <changeset id="WAR-495_add_profiles_and_special_vendor_access:5" author="menger" run-on-change="true">
        <cypherquery>
            <![CDATA[

            MATCH (identity:Identity {email: 'maxlester@theorchard.com'})
            MERGE (increment:IncrementId {nodeName: 'Profile'})
                ON CREATE SET increment.id = 2
                ON MATCH SET increment.id = increment.id + 1
            CREATE (profile:Profile {
                profileId: (increment.id - 1),
                profileType: 'MoneyhubProfile',
                profileName: identity.name,
                brand: identity.defaultBrand,
                fullCatalogAccess: true,
                roles: ['accounting'],
                uuid: apoc.create.uuid()
            })
            MERGE (identity)-[:HAS_PROFILE]->(profile)
            WITH profile
            MATCH (vendor:Vendor {id: '*'})
            MERGE (profile)-[:HAS_ADMIN_ACCESS_TO]->(vendor)

            ]]>
        </cypherquery>
    </changeset>

    <changeset id="WAR-495_add_profiles_and_special_vendor_access:6" author="menger" run-on-change="true">
        <cypherquery>
            <![CDATA[

            MATCH (identity:Identity {email: 'menger@theorchard.com'})
            MERGE (increment:IncrementId {nodeName: 'Profile'})
                ON CREATE SET increment.id = 2
                ON MATCH SET increment.id = increment.id + 1
            CREATE (profile:Profile {
                profileId: (increment.id - 1),
                profileType: 'MoneyhubProfile',
                profileName: identity.name,
                brand: identity.defaultBrand,
                fullCatalogAccess: true,
                roles: ['accounting'],
                uuid: apoc.create.uuid()
            })
            MERGE (identity)-[:HAS_PROFILE]->(profile)
            WITH profile
            MATCH (vendor:Vendor {id: '*'})
            MERGE (profile)-[:HAS_ADMIN_ACCESS_TO]->(vendor)

            ]]>
        </cypherquery>
    </changeset>

    <changeset id="WAR-495_add_profiles_and_special_vendor_access:7" author="menger" run-on-change="true">
        <cypherquery>
            <![CDATA[

            MATCH (identity:Identity {email: 'oyatsuk@theorchard.com'})
            MERGE (increment:IncrementId {nodeName: 'Profile'})
                ON CREATE SET increment.id = 2
                ON MATCH SET increment.id = increment.id + 1
            CREATE (profile:Profile {
                profileId: (increment.id - 1),
                profileType: 'MoneyhubProfile',
                profileName: identity.name,
                brand: identity.defaultBrand,
                fullCatalogAccess: true,
                roles: ['accounting'],
                uuid: apoc.create.uuid()
            })
            MERGE (identity)-[:HAS_PROFILE]->(profile)
            WITH profile
            MATCH (vendor:Vendor {id: '*'})
            MERGE (profile)-[:HAS_ADMIN_ACCESS_TO]->(vendor)

            ]]>
        </cypherquery>
    </changeset>

    <changeset id="WAR-495_add_profiles_and_special_vendor_access:8" author="menger" run-on-change="true">
        <cypherquery>
            <![CDATA[

            MATCH (identity:Identity {email: 'sgolden@theorchard.com'})
            MERGE (increment:IncrementId {nodeName: 'Profile'})
                ON CREATE SET increment.id = 2
                ON MATCH SET increment.id = increment.id + 1
            CREATE (profile:Profile {
                profileId: (increment.id - 1),
                profileType: 'MoneyhubProfile',
                profileName: identity.name,
                brand: identity.defaultBrand,
                fullCatalogAccess: true,
                roles: ['accounting'],
                uuid: apoc.create.uuid()
            })
            MERGE (identity)-[:HAS_PROFILE]->(profile)
            WITH profile
            MATCH (vendor:Vendor {id: '*'})
            MERGE (profile)-[:HAS_ADMIN_ACCESS_TO]->(vendor)

            ]]>
        </cypherquery>
    </changeset>

    <changeset id="WAR-495_add_profiles_and_special_vendor_access:9" author="menger" run-on-change="true">
        <cypherquery>
            <![CDATA[

            MATCH (identity:Identity {email: 'tkim@theorchard.com'})
            MERGE (increment:IncrementId {nodeName: 'Profile'})
                ON CREATE SET increment.id = 2
                ON MATCH SET increment.id = increment.id + 1
            CREATE (profile:Profile {
                profileId: (increment.id - 1),
                profileType: 'MoneyhubProfile',
                profileName: identity.name,
                brand: identity.defaultBrand,
                fullCatalogAccess: true,
                roles: ['accounting'],
                uuid: apoc.create.uuid()
            })
            MERGE (identity)-[:HAS_PROFILE]->(profile)
            WITH profile
            MATCH (vendor:Vendor {id: '*'})
            MERGE (profile)-[:HAS_ADMIN_ACCESS_TO]->(vendor)

            ]]>
        </cypherquery>
    </changeset>

</changelog>
