use of eu.cryptoeuro.accountmapper.error.HasActiveAccountException in project account-identity by cryptofiat.
the class EscrowController method getEscrow.
@RequestMapping(method = RequestMethod.GET, value = "/{idCode}")
public ResponseEntity<AccountActivationResponse> getEscrow(@PathVariable("idCode") @Valid long idCode) throws IOException {
if (accountService.hasActivatedAccount(idCode)) {
throw new HasActiveAccountException();
}
;
if (ldapService.lookupIdCode(idCode) == null) {
throw new LdapNotFoundException();
}
;
EthereumAccount account;
account = escrowService.approveEscrowAccountForId(idCode);
AccountActivationResponse aaResponse = AccountActivationResponse.builder().authenticationStatus(AuthenticationStatus.LOGIN_SUCCESS.name()).ownerId(account.getOwnerId()).address(account.getAddress()).transactionHash(account.getTransactionHash()).build();
return new ResponseEntity<AccountActivationResponse>(aaResponse, HttpStatus.OK);
}
Aggregations