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 #397: Replace status OTP_VERIFICATION_PENDING by VERIFICATION_PENDING #398

Merged
merged 1 commit into from
Sep 26, 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 @@ -46,8 +46,7 @@ public interface IdentityVerificationRepository extends CrudRepository<IdentityV
"WHERE i.activationId = :activationId " +
"AND i.status IN (" +
"com.wultra.app.enrollmentserver.model.enumeration.IdentityVerificationStatus.IN_PROGRESS, " +
"com.wultra.app.enrollmentserver.model.enumeration.IdentityVerificationStatus.VERIFICATION_PENDING, " +
"com.wultra.app.enrollmentserver.model.enumeration.IdentityVerificationStatus.OTP_VERIFICATION_PENDING" +
"com.wultra.app.enrollmentserver.model.enumeration.IdentityVerificationStatus.VERIFICATION_PENDING" +
")")
int failRunningVerifications(String activationId, Date timestamp);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,6 @@ public enum IdentityVerificationStatus {
*/
VERIFICATION_PENDING,

/**
Copy link
Member Author

Choose a reason for hiding this comment

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

* OTP code verification is pending.
*/
OTP_VERIFICATION_PENDING,

/**
* All submitted documents have been verified and accepted as valid documents and OTP has been verified.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,8 +121,8 @@ public void resendOtp(IdentityVerificationEntity identityVerification) throws On
@Transactional
public void sendOtp(IdentityVerificationEntity identityVerification) throws OnboardingProcessException, OnboardingOtpDeliveryException {
identityVerification.setPhase(IdentityVerificationPhase.OTP_VERIFICATION);
identityVerification.setStatus(IdentityVerificationStatus.OTP_VERIFICATION_PENDING);
logger.info("Switched to OTP_VERIFICATION/OTP_VERIFICATION_PENDING; process ID: {}", identityVerification.getProcessId());
identityVerification.setStatus(IdentityVerificationStatus.VERIFICATION_PENDING);
logger.info("Switched to OTP_VERIFICATION/VERIFICATION_PENDING; process ID: {}", identityVerification.getProcessId());
sendOtpCode(identityVerification.getProcessId(), false);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ public enum OnboardingState {

PRESENCE_CHECK_VERIFICATION_PENDING(IdentityVerificationPhase.PRESENCE_CHECK, IdentityVerificationStatus.VERIFICATION_PENDING),

OTP_VERIFICATION_PENDING(IdentityVerificationPhase.OTP_VERIFICATION, IdentityVerificationStatus.OTP_VERIFICATION_PENDING),
OTP_VERIFICATION_PENDING(IdentityVerificationPhase.OTP_VERIFICATION, IdentityVerificationStatus.VERIFICATION_PENDING),

COMPLETED_ACCEPTED(IdentityVerificationPhase.COMPLETED, IdentityVerificationStatus.ACCEPTED),
COMPLETED_FAILED(IdentityVerificationPhase.COMPLETED, IdentityVerificationStatus.FAILED),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ void testDocumentVerificationTransitionToSendingOtp() throws Exception {
when(identityVerificationConfig.isVerificationOtpEnabled()).thenReturn(true);
doAnswer(args -> {
idVerification.setPhase(IdentityVerificationPhase.OTP_VERIFICATION);
idVerification.setStatus(IdentityVerificationStatus.OTP_VERIFICATION_PENDING);
idVerification.setStatus(IdentityVerificationStatus.VERIFICATION_PENDING);
return null;
}).when(identityVerificationOtpService).sendOtp(idVerification);

Expand All @@ -126,7 +126,7 @@ void testDocumentVerificationTransitionToSendingOtp() throws Exception {
.test();

assertEquals(IdentityVerificationPhase.OTP_VERIFICATION, idVerification.getPhase());
assertEquals(IdentityVerificationStatus.OTP_VERIFICATION_PENDING, idVerification.getStatus());
assertEquals(IdentityVerificationStatus.VERIFICATION_PENDING, idVerification.getStatus());
verify(identityVerificationOtpService).sendOtp(idVerification);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ void testOtpNotVerified() throws Exception {

private IdentityVerificationEntity createIdentityVerification() {
return super.createIdentityVerification(
IdentityVerificationPhase.OTP_VERIFICATION, IdentityVerificationStatus.OTP_VERIFICATION_PENDING
IdentityVerificationPhase.OTP_VERIFICATION, IdentityVerificationStatus.VERIFICATION_PENDING
);
}

Expand Down