<?xml version="1.0" encoding="UTF-8"?>
<changelog xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <changeset id="NR-2565_create_knr_reporting_user:1" author="gmaroulis" run-on-change="true">
        <cypherquery>
            <![CDATA[
            MERGE (i:Identity {email: "reporter@nr-ownership.io"})
            ON CREATE SET
                i.id = apoc.create.uuid(),
                i.localization = "en",
                i.lastName = "service user",
                i.defaultBrand = "theorchard",
                i.active = "Y",
                i.createdAt = datetime(),
                i.firstName = "ownership reporter",
                i.numberFormat = "us",
                i.name = "ownership reporter service user"
            ON MATCH SET
                i.updatedOn = datetime(),
                i.updatedBy = "NR-2565_create_knr_reporting_user.xml"
        ]]>
        </cypherquery>
    </changeset>
    <changeset id="NR-2565_create_knr_reporting_user:2" author="gmaroulis" run-on-change="true">
        <cypherquery>
            <![CDATA[
            MATCH (i:Identity {email: "reporter@nr-ownership.io"})
            MATCH (allLabels:Vendor { vendorId: "*" })
            MERGE (increment:IncrementId {nodeName: 'Profile'})
                ON CREATE SET increment.id = 3
                ON MATCH SET increment.id = increment.id + 3
            CREATE (contentProfile:Profile {
                profileId: (increment.id-2),
                profileType: 'ContentProfile',
                profileName: 'ownership reporter service ContentProfile',
                uuid: apoc.create.uuid(),
                fullCatalogAccess: true,
                roles: ['manage_nr_ownership']
            })
            MERGE (contentProfile)-[:HAS_ACCESS_TO]->(allLabels)
        ]]>
        </cypherquery>
    </changeset>
</changelog>