From cdbfdf3d42a31063af0ba4685de7f035cca4e30a Mon Sep 17 00:00:00 2001 From: Yannick1712 <52333989+Yannick1712@users.noreply.github.com> Date: Sun, 22 Dec 2024 00:41:41 +0100 Subject: [PATCH] [NOTASK] fix externalReview ident bug --- src/subdomains/generic/kyc/services/kyc.service.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/subdomains/generic/kyc/services/kyc.service.ts b/src/subdomains/generic/kyc/services/kyc.service.ts index c9df6d166..d1ed340c4 100644 --- a/src/subdomains/generic/kyc/services/kyc.service.ts +++ b/src/subdomains/generic/kyc/services/kyc.service.ts @@ -516,7 +516,11 @@ export class KycService { break; case IdentShortResult.REVIEW: - await this.kycStepRepo.update(...kycStep.externalReview(dto)); + if ( + ![KycStepStatus.INTERNAL_REVIEW, KycStepStatus.MANUAL_REVIEW].includes(kycStep.status) && + kycStep.getResult() !== dto + ) + await this.kycStepRepo.update(...kycStep.externalReview(dto)); break; case IdentShortResult.SUCCESS: @@ -910,7 +914,7 @@ export class KycService { if (!data.success) errors.push(KycError.INVALID_RESULT); const userCountry = - identStep.userData.organizationCountry ?? identStep.userData.verifiedCountry ?? identStep.userData.country; + identStep.userData.organizationCountry ?? identStep.userData.verifiedCountry ?? identStep.userData.country; if (identStep.userData.accountType === AccountType.PERSONAL) { if (userCountry && !userCountry.dfxEnable) errors.push(KycError.COUNTRY_NOT_ALLOWED);