<?xml version="1.0" encoding="UTF-8"?>
<changelog xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="https://www.liquigraph.org/schema/1.0/liquigraph.xsd">
  
    <changeset id="NR-823_add_distribution_profile_kollectivenr:1" author="npatel">
        <query>
            MATCH (identity:Identity )
            WHERE identity.email in [
                'adam.udell@kollectivenr.com',
                'bessie.norman@kollectivenr.com',
                'dave.akomiah@kollectivenr.com',
                'harry.stanhope@kollectivenr.com',
                'holly.forth@kollectivenr.com',
                'jackie.eden@kollectivenr.com',
                'luke.cowie@kollectivenr.com',
                'paula.adams@kollectivenr.com',
                'sunny.winter@kollectivenr.com'
            ]
            MATCH (increment:IncrementId {nodeName: 'Profile'})
                SET increment.id = increment.id + 1
            CREATE (profile:Profile {
                profileId: (increment.id-1),
                profileType: 'DistributionProfile',
                profileName: 'Distribution Profile',
                uuid: apoc.create.uuid(),
                roles: ['manage_nr_deliveries'],
                fullCatalogAccess: true
            })
            MERGE (identity)-[:HAS_PROFILE]->(profile)
            WITH profile
            MATCH (v:Vendor {id: '*'})
            MERGE (profile)-[:HAS_ACCESS_TO]->(v)
        </query>
    </changeset>
  
</changelog>
