private User createUser(UserForm form, String profileId) {
   User user = new User();
   user.setUserId(form.getUserName());
   user.setProfileId(profileId);
   user.setTenantId(form.getTenantId());
   user.setCreatedBy(form.getStaffFirstName() + " " + form.getStaffLastName());
   user.setCreatedDate(new Date());
   Role role = new Role();
   role.setPrimary(STAFF_ROLE);
   role.setSecondary(form.getRole());
   user.setRole(role);
   return user;
 }
 private Profile createProfile(UserForm form) {
   Profile profile = new Profile();
   profile.setFirstName(form.getFirstName());
   profile.setLastName(form.getLastName());
   profile.setDateOfBirth(AppUtil.getDateFromStr(form.getDateOfBirth()));
   profile.setAddress(form.getAddress());
   profile.setEmailAddress(form.getEmailAddress());
   profile.setPhone(form.getPhoneNo());
   profile.setTenantId(form.getUserTenandId());
   profile.setSex(form.getSex());
   profile.setCreatedBy(form.getStaffFirstName() + " " + form.getStaffLastName());
   profile.setCreatedDate(new Date());
   return profile;
 }