use of com.blockscore.models.Person in project workbench by all-of-us.
the class ProfileController method submitIdVerification.
@Override
public ResponseEntity<Profile> submitIdVerification(IdVerificationRequest request) {
// TODO(dmohs): Prevent this if the user has already attempted verification?
Person person = blockscoreService.createPerson(request.getFirstName(), request.getLastName(), new Address().setStreet1(request.getStreetLine1()).setStreet2(request.getStreetLine2()).setCity(request.getCity()).setSubdivision(request.getState()).setPostalCode(request.getZip()).setCountryCode("US"), request.getDob(), request.getDocumentType(), request.getDocumentNumber());
User user = userService.setBlockscoreIdVerification(person.getId(), person.isValid());
return getProfileResponse(user);
}
use of com.blockscore.models.Person in project workbench by all-of-us.
the class BlockscoreServiceImpl method createPerson.
@Override
public Person createPerson(String firstName, String lastName, Address address, String dobString, String documentType, String documentNumber) {
Person.Builder person = new Person.Builder(getClient());
person.setFirstName(firstName).setLastName(lastName).setAddress(address).setDocumentType(documentType).setDocumentValue(documentNumber);
SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd");
try {
person.setDateOfBirth(formatter.parse(dobString));
} catch (ParseException e) {
throw new RuntimeException(e);
}
return person.create();
}
Aggregations