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

    <changeset id="WAR-1452-add_moneyhub_vendor_star_access:1" author="menger" run-on-change="true">
        <cypherquery>
            <![CDATA[
            MATCH (identity:Identity {id: 'd6533e33-c7bb-4c8d-9511-7ee2143097cf'})
            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_ACCESS_TO]->(vendor)
            ]]>
        </cypherquery>
    </changeset>

    <changeset id="WAR-1452-add_moneyhub_vendor_star_access:2" author="menger" run-on-change="true">
        <cypherquery>
            <![CDATA[
            MATCH (identity:Identity {id: '554bcdde-aaa1-4d33-a271-c1334e56bb0c'})
            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_ACCESS_TO]->(vendor)
            ]]>
        </cypherquery>
    </changeset>

    <changeset id="WAR-1452-add_moneyhub_vendor_star_access:3" author="menger" run-on-change="true">
        <cypherquery>
            <![CDATA[
            MATCH (identity:Identity {id: 'a9f0b1fa-7243-49e6-a47e-8ad1e5017109'})
            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_ACCESS_TO]->(vendor)
            ]]>
        </cypherquery>
    </changeset>

    <changeset id="WAR-1452-add_moneyhub_vendor_star_access:4" author="menger" run-on-change="true">
        <cypherquery>
            <![CDATA[
            MATCH (identity:Identity {id: '876bc74f-29a1-4d89-9099-51aae32034d6'})
            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_ACCESS_TO]->(vendor)
            ]]>
        </cypherquery>
    </changeset>

    <changeset id="WAR-1452-add_moneyhub_vendor_star_access:5" author="menger" run-on-change="true">
        <cypherquery>
            <![CDATA[
            MATCH (identity:Identity {id: '06e7962f-6f6a-41fb-8ba7-ea845aff25a1'})
            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_ACCESS_TO]->(vendor)
            ]]>
        </cypherquery>
    </changeset>

    <changeset id="WAR-1452-add_moneyhub_vendor_star_access:6" author="menger" run-on-change="true">
        <cypherquery>
            <![CDATA[
            MATCH (identity:Identity {id: 'f21f6490-a962-45be-81db-39d7a7eee99b'})
            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_ACCESS_TO]->(vendor)
            ]]>
        </cypherquery>
    </changeset>

    <changeset id="WAR-1452-add_moneyhub_vendor_star_access:7" author="menger" run-on-change="true">
        <cypherquery>
            <![CDATA[
            MATCH (identity:Identity {id: '4f1a398c-147b-4440-8998-ae0731b82063'})
            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_ACCESS_TO]->(vendor)
            ]]>
        </cypherquery>
    </changeset>

</changelog>
