Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Log document verification #492

Merged
merged 1 commit into from
Nov 3, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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