Skip to content

Commit

Permalink
Log document verification
Browse files Browse the repository at this point in the history
Issue #484
  • Loading branch information
banterCZ committed Nov 3, 2022
1 parent 26ca0fe commit c3d9dee
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -264,14 +264,17 @@ public void startVerification(OwnerId ownerId, IdentityVerificationEntity identi
.map(DocumentVerificationEntity::getUploadId)
.collect(Collectors.toList());

DocumentsVerificationResult result = documentVerificationProvider.verifyDocuments(ownerId, uploadIds);
auditService.auditDocumentVerificationProvider(identityVerification, "Documents verified: {} for user: {}", result.getStatus(), ownerId.getUserId());
final DocumentsVerificationResult result = documentVerificationProvider.verifyDocuments(ownerId, uploadIds);
final String verificationId = result.getVerificationId();
final DocumentVerificationStatus status = result.getStatus();
logger.info("Verified documents upload ID: {}, verification ID: {}, status: {}, {}", uploadIds, verificationId, status, ownerId);
auditService.auditDocumentVerificationProvider(identityVerification, "Documents verified: {} for user: {}", status, ownerId.getUserId());

moveToPhaseAndStatus(identityVerification, IdentityVerificationPhase.DOCUMENT_VERIFICATION, IdentityVerificationStatus.IN_PROGRESS, ownerId);

docVerifications.forEach(docVerification -> {
docVerification.setStatus(DocumentStatus.VERIFICATION_IN_PROGRESS);
docVerification.setVerificationId(result.getVerificationId());
docVerification.setVerificationId(verificationId);
docVerification.setTimestampLastUpdated(ownerId.getTimestamp());
auditService.auditDebug(docVerification, "Started document verification for user: {}", ownerId.getUserId());
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -431,9 +431,11 @@ private void processDocsSubmitResults(OwnerId ownerId, DocumentVerificationEntit

private void verifyDocumentWithUpload(OwnerId ownerId, DocumentVerificationEntity docVerification, String uploadId) {
try {
DocumentsVerificationResult docsVerificationResult =
documentVerificationProvider.verifyDocuments(ownerId, List.of(uploadId));
docVerification.setVerificationId(docsVerificationResult.getVerificationId());
final DocumentsVerificationResult result = documentVerificationProvider.verifyDocuments(ownerId, List.of(uploadId));
final String verificationId = result.getVerificationId();
final DocumentVerificationStatus status = result.getStatus();
logger.info("Verified document upload ID: {}, verification ID: {}, status: {}, {}", uploadId, verificationId, status, ownerId);
docVerification.setVerificationId(verificationId);
} catch (DocumentVerificationException | RemoteCommunicationException e) {
logger.debug("Unable to verify document with uploadId: {}, {}", uploadId, ownerId, e);
logger.warn("Unable to verify document with uploadId: {}, reason: {}, {}", uploadId, e.getMessage(), ownerId);
Expand Down

0 comments on commit c3d9dee

Please sign in to comment.