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

Fix #484: Final document verification #489

Merged
merged 14 commits into from
Nov 4, 2022

Conversation

banterCZ
Copy link
Member

@banterCZ banterCZ commented Nov 3, 2022

No description provided.

@banterCZ banterCZ force-pushed the issues/484-cross-document-verification branch from f724afb to edf2393 Compare November 3, 2022 10:36
@banterCZ banterCZ changed the title Fix #484: Consolidate ZenId verification ID Fix #484: Final document verification Nov 4, 2022
final OwnerId ownerId) {
documentVerifications.forEach(docVerification ->
auditService.audit(docVerification, "Document accepted at final verification for user: {}", identityVerification.getUserId()));
identityVerificationService.moveToPhaseAndStatus(identityVerification, DOCUMENT_VERIFICATION_FINAL, ACCEPTED, ownerId);
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not introduced as a separate state of state machine configuration yet. Added just for auditing reasons. For sync processing, this step makes sense to be done all at once. Should be added to the diagram.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I assume this may change with async processing, right?

@banterCZ banterCZ marked this pull request as ready for review November 4, 2022 08:57
Copy link
Member

@romanstrobl romanstrobl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This pull request should work as expected for common scenarios. There are some corner cases, I raised issues for them and left one for review. Let's proceed with testing and handle any additional changes based on test results as another pull request.

final OwnerId ownerId) {
documentVerifications.forEach(docVerification ->
auditService.audit(docVerification, "Document accepted at final verification for user: {}", identityVerification.getUserId()));
identityVerificationService.moveToPhaseAndStatus(identityVerification, DOCUMENT_VERIFICATION_FINAL, ACCEPTED, ownerId);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok.

final OwnerId ownerId) {
documentVerifications.forEach(docVerification ->
auditService.audit(docVerification, "Document accepted at final verification for user: {}", identityVerification.getUserId()));
identityVerificationService.moveToPhaseAndStatus(identityVerification, DOCUMENT_VERIFICATION_FINAL, ACCEPTED, ownerId);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I assume this may change with async processing, right?

@@ -125,9 +125,11 @@ public void processClientEvaluation(final IdentityVerificationEntity identityVer

private static String getVerificationId(final IdentityVerificationEntity identityVerification) {
return identityVerification.getDocumentVerifications().stream()
.filter(DocumentVerificationEntity::isUsedForVerification)
.filter(it -> it.getStatus() == DocumentStatus.ACCEPTED)
.findAny()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This check is still suboptimal. We rather want to executed findAll(), put all results into a Set and make sure this set has only one item which is the ID of verification we want to use. In case of multiple IDs found, this is a severe error in business logic and we want to abort the processing. I will raise an issue for future improvement request.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

reject(identityVerification, result, documentVerifications, ownerId);
break;
case IN_PROGRESS:
throw new DocumentVerificationException("Only sync mode is supported, " + ownerId);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See: #495

.map(DocumentVerificationEntity::getUploadId)
.collect(toList());

final DocumentsVerificationResult result = documentVerificationProvider.verifyDocuments(ownerId, uploadIds);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In case of an error during verifyDocuments call the identity verification may get stuck in this phase/status. Let's raise a ticket for handling this separately.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Raised as: #496

@banterCZ banterCZ merged commit ad40e52 into develop Nov 4, 2022
@banterCZ banterCZ deleted the issues/484-cross-document-verification branch November 4, 2022 15:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants