import { getGrpcClientAsync } from 'killrvideo-nodejs-common';
import { USER_MANAGEMENT_SERVICE } from '../services/user-management';

/**
 * Adds a sample user.
 */
export function addSampleUser() {
  return getGrpcClientAsync(USER_MANAGEMENT_SERVICE)
    .then(client => {
      throw new Error('Not implemented');
    });
};

export default addSampleUser;
@@ -1,16 +1,89 @@
+import uuid from 'uuid';%0Aimport %7B internet, name, random %7D from 'faker';%0A
 import %7B getGrpc
@@ -199,16 +199,135 @@
 gement';
+%0Aimport %7B stringToUuid %7D from '../utils/protobuf-conversions';%0Aimport %7B getCassandraClient %7D from '../utils/cassandra';
 %0A%0A/**%0A *
@@ -358,16 +358,22 @@
 %0Aexport 
+async 
 function
@@ -397,14 +397,74 @@
 %7B%0A  
-return
+// Generate a user and add using Grpc service%0A  let client = await
  get
@@ -507,78 +507,532 @@
 ICE)
+;%0A
 %0A  
-  .then(clien
+let userId = uuid.v4();%0A  let firstName = name.firstName();%0A  let lastName = name.lastName();%0A  let reques
 t =
-%3E
  %7B%0A    
-  throw new Error('Not implemented');%0A    %7D
+userId: stringToUuid(userId),%0A    firstName,%0A    lastName,%0A    password: internet.password(random.number(%7B min: 7, max: 20 %7D)),%0A    email: internet.exampleEmail(firstName, lastName)%0A  %7D;%0A  await client.createUserAsync(request);%0A%0A  // Save the User's Id so we can use it in other sample data%0A  let cass = getCassandraClient();%0A  await cass.executeAsync('INSERT INTO users (userid) VALUES (?)', %5B userId %5D
 );%0A%7D

Add sample user impl