<?xml version="1.0" encoding="UTF-8"?>
<changelog xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://www.liquigraph.org/schema/1.0/liquigraph.xsd">
    <changeset id="DOC-334-grant-admin-access:1" author="j0shua" run-on-change="true">
        <query>
            <![CDATA[
                MATCH (v:Vendor { id: "*" })

                MATCH (identity:Identity {email: "aurora.drummond@kollectivenr.com"})

                MERGE (inc:IncrementId {nodeName: 'Profile'})
                    ON CREATE SET inc.id = 2
                    ON MATCH SET inc.id = inc.id + 1

                // create a new DocumentsProfile for their Identity
                MERGE (identity)-[hp:HAS_PROFILE]->(p:Profile { profileType: 'DocumentsProfile' })
                ON CREATE SET
                    p.createdAt = datetime(),
                    p.uuid = apoc.create.uuid(),
                    p.profileId = inc.id - 1,
                    p.profileName = identity.name,
                    p.fullCatalogAccess = true,
                    p.roles = ['payee_management']
                SET
                    p.updatedBy = 'database/DOC-334-grant-admin-access',
                    p.updatedOn = datetime(),
                    p.lastModifiedAt = datetime(),
                    p.lastModifiedBy = 'database/DOC-334-grant-admin-access',

                    hp.createdAt = datetime(),
                    hp.updatedBy = 'database/DOC-334-grant-admin-access',
                    hp.updatedOn = datetime()

                MERGE (p)-[hat:HAS_ACCESS_TO]->(v)
                SET
                    hat.createdAt = datetime(),
                    hat.updatedOn = datetime(),
                    hat.updatedBy = 'database/DOC-334-grant-admin-access'
            ]]>
        </query>
    </changeset>
    <changeset id="DOC-334-grant-admin-access:2" author="j0shua" run-on-change="true">
        <query>
            <![CDATA[
                MATCH (v:Vendor { id: "*" })

                MATCH (identity:Identity {email: "jackie.eden@kollectivenr.com"})

                MERGE (inc:IncrementId {nodeName: 'Profile'})
                    ON CREATE SET inc.id = 2
                    ON MATCH SET inc.id = inc.id + 1

                // create a new DocumentsProfile for their Identity
                MERGE (identity)-[hp:HAS_PROFILE]->(p:Profile { profileType: 'DocumentsProfile' })
                ON CREATE SET
                    p.createdAt = datetime(),
                    p.uuid = apoc.create.uuid(),
                    p.profileId = inc.id - 1,
                    p.profileName = identity.name,
                    p.fullCatalogAccess = true,
                    p.roles = ['payee_management']
                SET
                    p.updatedBy = 'database/DOC-334-grant-admin-access',
                    p.updatedOn = datetime(),
                    p.lastModifiedAt = datetime(),
                    p.lastModifiedBy = 'database/DOC-334-grant-admin-access',

                    hp.createdAt = datetime(),
                    hp.updatedBy = 'database/DOC-334-grant-admin-access',
                    hp.updatedOn = datetime()

                MERGE (p)-[hat:HAS_ACCESS_TO]->(v)
                SET
                    hat.createdAt = datetime(),
                    hat.updatedOn = datetime(),
                    hat.updatedBy = 'database/DOC-334-grant-admin-access'
            ]]>
        </query>
    </changeset>
    <changeset id="DOC-334-grant-admin-access:3" author="j0shua" run-on-change="true">
        <query>
            <![CDATA[
                MATCH (v:Vendor { id: "*" })

                MATCH (identity:Identity {email: "lewis.white@kollectivenr.com"})

                MERGE (inc:IncrementId {nodeName: 'Profile'})
                    ON CREATE SET inc.id = 2
                    ON MATCH SET inc.id = inc.id + 1

                // create a new DocumentsProfile for their Identity
                MERGE (identity)-[hp:HAS_PROFILE]->(p:Profile { profileType: 'DocumentsProfile' })
                ON CREATE SET
                    p.createdAt = datetime(),
                    p.uuid = apoc.create.uuid(),
                    p.profileId = inc.id - 1,
                    p.profileName = identity.name,
                    p.fullCatalogAccess = true,
                    p.roles = ['payee_management']
                SET
                    p.updatedBy = 'database/DOC-334-grant-admin-access',
                    p.updatedOn = datetime(),
                    p.lastModifiedAt = datetime(),
                    p.lastModifiedBy = 'database/DOC-334-grant-admin-access',

                    hp.createdAt = datetime(),
                    hp.updatedBy = 'database/DOC-334-grant-admin-access',
                    hp.updatedOn = datetime()

                MERGE (p)-[hat:HAS_ACCESS_TO]->(v)
                SET
                    hat.createdAt = datetime(),
                    hat.updatedOn = datetime(),
                    hat.updatedBy = 'database/DOC-334-grant-admin-access'
            ]]>
        </query>
    </changeset>
    <changeset id="DOC-334-grant-admin-access:4" author="j0shua" run-on-change="true">
        <query>
            <![CDATA[
                MATCH (v:Vendor { id: "*" })

                MATCH (identity:Identity {email: "tom.doherty@kollectivenr.com"})

                MERGE (inc:IncrementId {nodeName: 'Profile'})
                    ON CREATE SET inc.id = 2
                    ON MATCH SET inc.id = inc.id + 1

                // create a new DocumentsProfile for their Identity
                MERGE (identity)-[hp:HAS_PROFILE]->(p:Profile { profileType: 'DocumentsProfile' })
                ON CREATE SET
                    p.createdAt = datetime(),
                    p.uuid = apoc.create.uuid(),
                    p.profileId = inc.id - 1,
                    p.profileName = identity.name,
                    p.fullCatalogAccess = true,
                    p.roles = ['payee_management']
                SET
                    p.updatedBy = 'database/DOC-334-grant-admin-access',
                    p.updatedOn = datetime(),
                    p.lastModifiedAt = datetime(),
                    p.lastModifiedBy = 'database/DOC-334-grant-admin-access',

                    hp.createdAt = datetime(),
                    hp.updatedBy = 'database/DOC-334-grant-admin-access',
                    hp.updatedOn = datetime()

                MERGE (p)-[hat:HAS_ACCESS_TO]->(v)
                SET
                    hat.createdAt = datetime(),
                    hat.updatedOn = datetime(),
                    hat.updatedBy = 'database/DOC-334-grant-admin-access'
            ]]>
        </query>
    </changeset>
    <changeset id="DOC-334-grant-admin-access:5" author="j0shua" run-on-change="true">
        <query>
            <![CDATA[
                MATCH (v:Vendor { id: "*" })

                MATCH (identity:Identity {email: "heide.avent@kollectivenr.com"})

                MERGE (inc:IncrementId {nodeName: 'Profile'})
                    ON CREATE SET inc.id = 2
                    ON MATCH SET inc.id = inc.id + 1

                // create a new DocumentsProfile for their Identity
                MERGE (identity)-[hp:HAS_PROFILE]->(p:Profile { profileType: 'DocumentsProfile' })
                ON CREATE SET
                    p.createdAt = datetime(),
                    p.uuid = apoc.create.uuid(),
                    p.profileId = inc.id - 1,
                    p.profileName = identity.name,
                    p.fullCatalogAccess = true,
                    p.roles = ['payee_management']
                SET
                    p.updatedBy = 'database/DOC-334-grant-admin-access',
                    p.updatedOn = datetime(),
                    p.lastModifiedAt = datetime(),
                    p.lastModifiedBy = 'database/DOC-334-grant-admin-access',

                    hp.createdAt = datetime(),
                    hp.updatedBy = 'database/DOC-334-grant-admin-access',
                    hp.updatedOn = datetime()

                MERGE (p)-[hat:HAS_ACCESS_TO]->(v)
                SET
                    hat.createdAt = datetime(),
                    hat.updatedOn = datetime(),
                    hat.updatedBy = 'database/DOC-334-grant-admin-access'
            ]]>
        </query>
    </changeset>
    <changeset id="DOC-334-grant-admin-access:6" author="j0shua" run-on-change="true">
        <query>
            <![CDATA[
                MATCH (v:Vendor { id: "*" })

                MATCH (identity:Identity {email: "natalie.parsons@kollectivenr.com"})

                MERGE (inc:IncrementId {nodeName: 'Profile'})
                    ON CREATE SET inc.id = 2
                    ON MATCH SET inc.id = inc.id + 1

                // create a new DocumentsProfile for their Identity
                MERGE (identity)-[hp:HAS_PROFILE]->(p:Profile { profileType: 'DocumentsProfile' })
                ON CREATE SET
                    p.createdAt = datetime(),
                    p.uuid = apoc.create.uuid(),
                    p.profileId = inc.id - 1,
                    p.profileName = identity.name,
                    p.fullCatalogAccess = true,
                    p.roles = ['payee_management']
                SET
                    p.updatedBy = 'database/DOC-334-grant-admin-access',
                    p.updatedOn = datetime(),
                    p.lastModifiedAt = datetime(),
                    p.lastModifiedBy = 'database/DOC-334-grant-admin-access',

                    hp.createdAt = datetime(),
                    hp.updatedBy = 'database/DOC-334-grant-admin-access',
                    hp.updatedOn = datetime()

                MERGE (p)-[hat:HAS_ACCESS_TO]->(v)
                SET
                    hat.createdAt = datetime(),
                    hat.updatedOn = datetime(),
                    hat.updatedBy = 'database/DOC-334-grant-admin-access'
            ]]>
        </query>
    </changeset>
    <changeset id="DOC-334-grant-admin-access:7" author="j0shua" run-on-change="true">
        <query>
            <![CDATA[
                MATCH (v:Vendor { id: "*" })

                MATCH (identity:Identity {email: "henry.riggs@kollectivenr.com"})

                MERGE (inc:IncrementId {nodeName: 'Profile'})
                    ON CREATE SET inc.id = 2
                    ON MATCH SET inc.id = inc.id + 1

                // create a new DocumentsProfile for their Identity
                MERGE (identity)-[hp:HAS_PROFILE]->(p:Profile { profileType: 'DocumentsProfile' })
                ON CREATE SET
                    p.createdAt = datetime(),
                    p.uuid = apoc.create.uuid(),
                    p.profileId = inc.id - 1,
                    p.profileName = identity.name,
                    p.fullCatalogAccess = true,
                    p.roles = ['payee_management']
                SET
                    p.updatedBy = 'database/DOC-334-grant-admin-access',
                    p.updatedOn = datetime(),
                    p.lastModifiedAt = datetime(),
                    p.lastModifiedBy = 'database/DOC-334-grant-admin-access',

                    hp.createdAt = datetime(),
                    hp.updatedBy = 'database/DOC-334-grant-admin-access',
                    hp.updatedOn = datetime()

                MERGE (p)-[hat:HAS_ACCESS_TO]->(v)
                SET
                    hat.createdAt = datetime(),
                    hat.updatedOn = datetime(),
                    hat.updatedBy = 'database/DOC-334-grant-admin-access'
            ]]>
        </query>
    </changeset>
    <changeset id="DOC-334-grant-admin-access:8" author="j0shua" run-on-change="true">
        <query>
            <![CDATA[
                // Grant Kuhuk Goyal Vendor:* access
                // he already has a profile

                MATCH (v:Vendor { id: "*" })

                MATCH (identity:Identity {email: "kgoyal@theorchard.com"})
                    -[hp:HAS_PROFILE]->(p:Profile { profileType: 'DocumentsProfile' })

                MERGE (p)-[hat:HAS_ACCESS_TO]->(v)
                SET
                    p.fullCatalogAccess = true,
                    p.lastModifiedAt = datetime(),
                    p.lastModifiedBy = 'database/DOC-334-grant-admin-access',

                    hat.createdAt = datetime(),
                    hat.updatedOn = datetime(),
                    hat.updatedBy = 'database/DOC-334-grant-admin-access'
            ]]>
        </query>
    </changeset>

</changelog>
