<?xml version="1.0" encoding="UTF-8"?>
<databaseChangeLog xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                   xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
                   xmlns:neo4j="http://www.liquibase.org/xml/ns/dbchangelog-ext"
                   xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-latest.xsd">
    <changeSet id="FS-4361_onboarding_black_river_ent_users:1" author="ozhovnuvatyi">
        <neo4j:cypher>
            <![CDATA[
                MERGE (increment:IncrementId {nodeName: 'Profile'})
                    ON CREATE SET increment.id = 2
                    ON MATCH SET increment.id = increment.id + 1
                CREATE (profile:Profile {
                    brand: 'sme',
                    profileId: (increment.id-1),
                    profileType: 'AudienceProfile',
                    profileName: 'Grace Watson',
                    roles: ['audience'],
                    fullCatalogAccess: false,
                    uuid: apoc.create.uuid(),
                    createdAt: datetime(),
                    lastModifiedAt: datetime(),
                    createdBy: 'https://theorchard.atlassian.net/browse/FS-4361',
                    updatedBy: 'https://theorchard.atlassian.net/browse/FS-4361'
                })
                WITH profile
                MATCH (i:Identity {id: '32f263a5-2fe7-4ced-8842-975c877e7ff4' }),
                    (v1:Vendor {id: 22240 })
                MERGE (profile)-[:HAS_ACCESS_TO]->(v1)
                WITH profile,i
                MERGE (i)-[:HAS_PROFILE]->(profile)
            ]]>
        </neo4j:cypher>
    </changeSet>
    <changeSet id="FS-4361_onboarding_black_river_ent_users:2" author="ozhovnuvatyi">
        <neo4j:cypher>
            <![CDATA[
                MERGE (increment:IncrementId {nodeName: 'Profile'})
                    ON CREATE SET increment.id = 2
                    ON MATCH SET increment.id = increment.id + 1
                CREATE (profile:Profile {
                    brand: 'sme',
                    profileId: (increment.id-1),
                    profileType: 'AudienceProfile',
                    profileName: 'Marie Demetriades',
                    roles: ['audience'],
                    fullCatalogAccess: false,
                    uuid: apoc.create.uuid(),
                    createdAt: datetime(),
                    lastModifiedAt: datetime(),
                    createdBy: 'https://theorchard.atlassian.net/browse/FS-4361',
                    updatedBy: 'https://theorchard.atlassian.net/browse/FS-4361'
                })
                WITH profile
                MATCH (i:Identity {id: '45b3f989-e71f-45f7-82da-25e54f345996' }),
                    (v1:Vendor {id: 22240 })
                MERGE (profile)-[:HAS_ACCESS_TO]->(v1)
                WITH profile,i
                MERGE (i)-[:HAS_PROFILE]->(profile)
            ]]>
        </neo4j:cypher>
    </changeSet>
    <changeSet id="FS-4361_onboarding_black_river_ent_users:3" author="ozhovnuvatyi">
        <neo4j:cypher>
            <![CDATA[
                MERGE (increment:IncrementId {nodeName: 'Profile'})
                    ON CREATE SET increment.id = 2
                    ON MATCH SET increment.id = increment.id + 1
                CREATE (profile:Profile {
                    brand: 'sme',
                    profileId: (increment.id-1),
                    profileType: 'AudienceProfile',
                    profileName: 'Whitney Nevitt',
                    roles: ['audience'],
                    fullCatalogAccess: false,
                    uuid: apoc.create.uuid(),
                    createdAt: datetime(),
                    lastModifiedAt: datetime(),
                    createdBy: 'https://theorchard.atlassian.net/browse/FS-4361',
                    updatedBy: 'https://theorchard.atlassian.net/browse/FS-4361'
                })
                WITH profile
                MATCH (i:Identity {id: '9ac3869a-4407-4a47-a48f-886892b9bd5d' }),
                    (v1:Vendor {id: 22240 })
                MERGE (profile)-[:HAS_ACCESS_TO]->(v1)
                WITH profile,i
                MERGE (i)-[:HAS_PROFILE]->(profile)
            ]]>
        </neo4j:cypher>
    </changeSet>
    <changeSet id="FS-4361_onboarding_black_river_ent_users:4" author="ozhovnuvatyi">
        <neo4j:cypher>
            <![CDATA[
                MATCH (i:Identity {id: '260cbeee-52a5-47ce-9386-4bfa0248f673'})
                SET
                    i.email= 'lgreene@blackriverent.com',
                    i.updatedBy= 'https://theorchard.atlassian.net/browse/FS-4361'
            ]]>
        </neo4j:cypher>
    </changeSet>
    <changeSet id="FS-4361_onboarding_black_river_ent_users:5" author="ozhovnuvatyi">
        <neo4j:cypher>
            <![CDATA[
                MATCH (i:Identity {id: '938c0d6a-2647-4373-96a8-61acd1e8468d'})
                SET
                    i.email= 'tschrage@blackriverent.com',
                    i.updatedBy= 'https://theorchard.atlassian.net/browse/FS-4361'
            ]]>
        </neo4j:cypher>
    </changeSet>
</databaseChangeLog>
