package com.orasi.apps.bluesource.employeesPage;

import com.orasi.utils.Randomness;

public class Employee {
    private String username; 
    private String firstName;
    private String lastName; 
    private String title; 
    private String role;
    private String manager;
    private String status;
    private String bridgeTime;
    private String location;
    private String startDate;
    private String cellPhone;
    private String officePhone;
    private String email;
    private String imName; 
    private String imClient;
    private String department;
    
    public String getUsername() {return username;}
    public String getFirstName() {return firstName.substring(0, 1).toUpperCase() + firstName.substring(1).toLowerCase();}
    public String getLastName() {return lastName.substring(0, 1).toUpperCase() + lastName.substring(1).toLowerCase();}
    public String getTitle() {return title;}
    public String getRole() {return role;}
    public String getManager() {return manager;}
    public String getStatus() {return status;}
    public String getBridgeTime() {return bridgeTime;}
    public String getLocation() {return location;}
    public String getStartDate() {return startDate;}
  //  public Date getStartDateAsDate() {return startDate;}    
    public String getCellPhone() {return cellPhone;}
    public String getOfficePhone() {return officePhone;}
    public String getEmail() {return email;}
    public String getImName() {return imName;}
    public String getImClient() {return imClient;}
    public String getDepartment() {return department;}
    
    public void setUsername(String username) {this.username = username;}
    public void setFirstName(String firstName) {this.firstName = firstName.substring(0, 1).toUpperCase() + firstName.substring(1).toLowerCase();}
    public void setLastName(String lastName) {this.lastName = lastName.substring(0, 1).toUpperCase() + lastName.substring(1).toLowerCase();}
    public void setTitle(String title) {this.title = title;}
    public void setRole(String role) {this.role = role;}
    public void setManager(String manager) {this.manager = manager;}
    public void setStatus(String status) {this.status = status;}
    public void setBridgeTime(String bridgeTime) {this.bridgeTime= bridgeTime;}
    public void setLocation(String location) {this.location = location;}
    public void setStartDate(String startDate) {this.startDate = startDate;}
    public void setCellPhone(String cellPhone) {this.cellPhone = cellPhone;}
    public void setOfficePhone(String officePhone) {this.officePhone = officePhone;}
    public void setEmail(String email) {this.email = email;}
    public void setImName(String imName) {this.imName = imName;}
    public void setImClient(String imClient) {this.imClient = imClient;}
    public void setDepartment(String department) {this.department = department;}
    
    public Employee (){
	this.firstName = Randomness.randomAlphaNumeric(8);
	this.lastName = Randomness.randomAlphaNumeric(8);
	this.username = getFirstName() + "." + getLastName();
	this.title = "Contractor";
	this.role = "Base";
	this.manager = "Jim Azar";
	this.status = "Contractor";
	this.bridgeTime = "1";
	this.location = "Remote";
	this.startDate = "2013-01-20";
	this.cellPhone = "(336) 358-1321";
	this.officePhone = "(336) 358-1321";
	this.email = getUsername() + "@random.com";
	this.imName = getEmail();
	this.imClient = "Skype";
	this.department = "Services";	
    }   
}

@@ -43,16 +43,145 @@
 sPage;%0A%0A
+import java.io.IOException;%0A%0Aimport com.fasterxml.jackson.databind.JsonNode;%0Aimport com.orasi.api.restServices.core.RestService;%0A
 import c
@@ -3028,111 +3028,454 @@
 ()%7B%0A
-%09this.firstName = Randomness.randomAlphaNumeric(8);%0A%09this.lastName = Randomness.randomAlphaNumeric(8
+    %09//Generate pretty name%0A    %09RestService rest = new RestService();%0A    %09String response = %22%22;%0A    %09JsonNode node = null;%0A    %09try %7B%0A%09%09response = %09rest.sendGetRequest(%22http://api.randomuser.me/?nat=us%22);%0A%09%09node = rest.mapJSONToTree(response);%0A%09%09%7D catch (IOException e) %7B%0A%09%09%09// TODO Auto-generated catch block%0A%09%09%09e.printStackTrace();%0A%09%09%7D%0A%0A%09%09setFirstName(node.findValue(%22first%22).textValue());%0A%09%09setLastName(node.findValue(%22last%22).textValue()
 );%0A
+%09
 %09thi
@@ -3521,24 +3521,25 @@
 LastName();%0A
+%09
 %09this.title 
@@ -3550,24 +3550,25 @@
 ontractor%22;%0A
+%09
 %09this.role =
@@ -3572,24 +3572,25 @@
 e = %22Base%22;%0A
+%09
 %09this.manage
@@ -3598,19 +3598,25 @@
  = %22
-Jim Azar
+Company Admin
 %22;%0A
+%09
 %09thi
@@ -3640,16 +3640,17 @@
 actor%22;%0A
+%09
 %09this.br
@@ -3661,24 +3661,25 @@
 Time = %221%22;%0A
+%09
 %09this.locati
@@ -3689,24 +3689,25 @@
 = %22Remote%22;%0A
+%09
 %09this.startD
@@ -3726,16 +3726,17 @@
 01-20%22;%0A
+%09
 %09this.ce
@@ -3759,24 +3759,25 @@
  358-1321%22;%0A
+%09
 %09this.office
@@ -3802,16 +3802,17 @@
 -1321%22;%0A
+%09
 %09this.em
@@ -3848,16 +3848,17 @@
 m.com%22;%0A
+%09
 %09this.im
@@ -3876,16 +3876,17 @@
 mail();%0A
+%09
 %09this.im
@@ -3903,16 +3903,17 @@
 Skype%22;%0A
+%09
 %09this.de
@@ -3924,24 +3924,18 @@
 ment = %22
-Services
+HR
 %22;%09%0A    

Update to use rest service for pretty name