-
Notifications
You must be signed in to change notification settings - Fork 176
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
MOSIP-34112 code changes #1895
MOSIP-34112 code changes #1895
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,45 +1,49 @@ | ||
package io.mosip.registration.processor.biodedupe.constants; | ||
|
||
public class BioDedupeConstants { | ||
|
||
/** The Constant FILE_SEPARATOR. */ | ||
public static final String FILE_SEPARATOR = "\\"; | ||
|
||
/** The Constant INDIVIDUAL_BIOMETRICS. */ | ||
public static final String INDIVIDUAL_BIOMETRICS = "individualBiometrics"; | ||
|
||
public static final String VALUE = "value"; | ||
|
||
public static final String CBEFF_PRESENT_IN_PACKET = "Cbeff is present in the packet, destination stage is abis_handler"; | ||
|
||
public static final String CBEFF_NOT_PRESENT_IN_PACKET = "Cbeff is not present in the packet. This will be sent to manual verification."; | ||
|
||
public static final String CBEFF_ABSENT_IN_PACKET = "Cbeff is absent in the packet for child, destination stage is UIN"; | ||
|
||
public static final String UPDATE_PACKET_BIOMETRIC_NOT_NULL = "Update packet individual biometric not null, destination stage is abis_handler"; | ||
|
||
public static final String UPDATE_PACKET_BIOMETRIC_NULL = "Update packet individual biometric null, destination stage is UIN"; | ||
|
||
public static final String ABIS_RESPONSE_NOT_NULL = "ABIS response Details not null, destination stage is Manual_verification"; | ||
|
||
public static final String ABIS_RESPONSE_NULL = "ABIS response Details null, destination stage is UIN"; | ||
|
||
public static final String CBEFF_NOT_FOUND = "Cbeff not found for the lost packet"; | ||
|
||
public static final String APPLICANT_TYPE_CHILD = "Applicant type is child and Cbeff not present returning false"; | ||
|
||
public static final String APPLICANT_TYPE_ADULT = "Applicant type is adult and Cbeff not present throwing exception"; | ||
|
||
public static final String LOST_PRE_ABIS_IDENTITIFICATION = "Lost Packet Pre abis identification"; | ||
|
||
public static final String NO_MATCH_FOUND_FOR_LOST = "No match found, rejecting the lost packet for "; | ||
|
||
public static final String FOUND_UIN_IN_BIO_CHECK = "Found a matching UIN in bio check for the lost packet "; | ||
|
||
public static final String FOUND_UIN_IN_DEMO_CHECK = "Found a matching UIN in demo check for the lost packet "; | ||
|
||
public static final String MULTIPLE_RID_FOUND = "Multiple matched regId found, saving data in manual verification"; | ||
|
||
/** The Constant INTERNAL_ERROR. */ | ||
private static final String INTERNAL_ERROR = "Internal error occurred in bio-dedupe stage while processing for registrationId "; | ||
} | ||
package io.mosip.registration.processor.biodedupe.constants; | ||
|
||
public class BioDedupeConstants { | ||
|
||
/** The Constant FILE_SEPARATOR. */ | ||
public static final String FILE_SEPARATOR = "\\"; | ||
|
||
/** The Constant INDIVIDUAL_BIOMETRICS. */ | ||
public static final String INDIVIDUAL_BIOMETRICS = "individualBiometrics"; | ||
|
||
public static final String VALUE = "value"; | ||
|
||
public static final String CBEFF_PRESENT_IN_PACKET = "Cbeff is present in the packet, destination stage is abis_handler"; | ||
|
||
public static final String CBEFF_NOT_PRESENT_IN_PACKET = "Cbeff is not present in the packet. This will be sent to manual verification."; | ||
|
||
public static final String CBEFF_ABSENT_IN_PACKET = "Cbeff is absent in the packet for child, destination stage is UIN"; | ||
|
||
public static final String UPDATE_PACKET_BIOMETRIC_NOT_NULL = "Update packet individual biometric not null, destination stage is abis_handler"; | ||
|
||
public static final String UPDATE_PACKET_BIOMETRIC_NULL = "Update packet individual biometric null, destination stage is UIN"; | ||
|
||
public static final String ABIS_RESPONSE_NOT_NULL = "ABIS response Details not null, destination stage is Manual_verification"; | ||
|
||
public static final String ABIS_RESPONSE_NULL = "ABIS response Details null, destination stage is UIN"; | ||
|
||
public static final String CBEFF_NOT_FOUND = "Cbeff not found for the lost packet"; | ||
|
||
public static final String APPLICANT_TYPE_CHILD = "Applicant type is child and Cbeff not present returning false"; | ||
|
||
public static final String APPLICANT_TYPE_ADULT = "Applicant type is adult and Cbeff not present throwing exception"; | ||
|
||
public static final String LOST_PRE_ABIS_IDENTITIFICATION = "Lost Packet Pre abis identification"; | ||
|
||
public static final String NO_MATCH_FOUND_FOR_LOST = "No match found, rejecting the lost packet for "; | ||
|
||
public static final String FOUND_UIN_IN_BIO_CHECK = "Found a matching UIN in bio check for the lost packet "; | ||
|
||
public static final String FOUND_UIN_IN_DEMO_CHECK = "Found a matching UIN in demo check for the lost packet "; | ||
|
||
public static final String MULTIPLE_RID_FOUND = "Multiple matched regId found, saving data in manual verification"; | ||
|
||
/** The Constant INTERNAL_ERROR. */ | ||
private static final String INTERNAL_ERROR = "Internal error occurred in bio-dedupe stage while processing for registrationId "; | ||
|
||
public static final String ABIS_RESPONSE_MATCHING = "ABIS response Details matching, destination stage is UIN"; | ||
|
||
public static final String NO_MATCH_FOUND_FOR_UPDATE = "No match found, rejecting the Update packet for "; | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,6 +5,7 @@ | |
import java.util.LinkedHashMap; | ||
import java.util.List; | ||
import java.util.Map; | ||
import java.util.Optional; | ||
import java.util.Set; | ||
|
||
import org.apache.commons.lang3.exception.ExceptionUtils; | ||
|
@@ -132,6 +133,9 @@ public class BioDedupeProcessor { | |
@Value("${registration.processor.missing.biometric.verification.enabled:true}") | ||
private boolean missingBiometricVerificationEnabled; | ||
|
||
@Value("${registration.processor.biometric.autoreject.enabled:false}") | ||
private boolean biometricAutorejectEnable; | ||
|
||
/** The reg proc logger. */ | ||
private static Logger regProcLogger = RegProcessorLogger.getLogger(BioDedupeProcessor.class); | ||
|
||
|
@@ -435,6 +439,36 @@ private void postAbisIdentification(InternalRegistrationStatusDto registrationSt | |
registrationStatusDto.getRegistrationId(), BioDedupeConstants.ABIS_RESPONSE_NULL); | ||
|
||
} else { | ||
if (registrationType.equalsIgnoreCase(RegistrationType.UPDATE.name()) && matchedRegIds.size() == 1 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. what if the matchedRegIds size is 4 and all belongs to the same UIN ? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. resolved |
||
&& biometricAutorejectEnable) { | ||
Optional<String> optionalMatchedRegId = matchedRegIds.stream().findFirst(); | ||
String matchedRegId = optionalMatchedRegId.get(); | ||
String uin = idRepoService.getUinByRid(matchedRegId, utilities.getGetRegProcessorDemographicIdentity()); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If the RID is not latest (lets assume last RID for that user was demographic update), will idrepo still give the correct UIN ? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. On this line one more question, what if this RID was partially processed and UIN is not yet associated. In that case. what will the method return ? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. resolved |
||
String updateUin = utilities.getUIn(registrationStatusDto.getRegistrationId(), registrationType, | ||
ProviderStageName.BIO_AUTH); | ||
if (StringUtils.equals(uin, updateUin)) { | ||
registrationStatusDto | ||
.setLatestTransactionStatusCode(RegistrationTransactionStatusCode.SUCCESS.toString()); | ||
object.setIsValid(Boolean.TRUE); | ||
registrationStatusDto.setStatusCode(RegistrationStatusCode.PROCESSING.name()); | ||
registrationStatusDto.setStatusComment(StatusUtil.BIO_DEDUPE_SUCCESS.getMessage()); | ||
registrationStatusDto.setSubStatusCode(StatusUtil.BIO_DEDUPE_SUCCESS.getCode()); | ||
regProcLogger.info(LoggerFileConstant.SESSIONID.toString(), | ||
LoggerFileConstant.REGISTRATIONID.toString(), registrationStatusDto.getRegistrationId(), | ||
BioDedupeConstants.ABIS_RESPONSE_MATCHING); | ||
} else { | ||
registrationStatusDto | ||
.setLatestTransactionStatusCode(RegistrationTransactionStatusCode.FAILED.toString()); | ||
object.setIsValid(Boolean.FALSE); | ||
registrationStatusDto.setStatusCode(RegistrationStatusCode.REJECTED.name()); | ||
registrationStatusDto.setStatusComment(StatusUtil.UPDATE_PACKET_BIOMETRICS_NOT_FOUND.getMessage()); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This case is not about matching with someone else biometrics ? But message says biometrics not found ? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. resolved |
||
registrationStatusDto.setSubStatusCode(StatusUtil.UPDATE_PACKET_BIOMETRICS_NOT_FOUND.getCode()); | ||
regProcLogger.info(LoggerFileConstant.SESSIONID.toString(), | ||
LoggerFileConstant.REGISTRATIONID.toString(), registrationStatusDto.getRegistrationId(), | ||
BioDedupeConstants.NO_MATCH_FOUND_FOR_UPDATE + registrationStatusDto.getRegistrationId()); | ||
} | ||
|
||
}else { | ||
registrationStatusDto.setStatusCode(RegistrationStatusCode.FAILED.name()); | ||
registrationStatusDto.setStatusComment(StatusUtil.BIO_DEDUPE_POTENTIAL_MATCH.getMessage()); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. How are we planning to handle this case, where there is more than one match and the country does not have a manual adjudication system ? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. resolved |
||
registrationStatusDto.setSubStatusCode(StatusUtil.BIO_DEDUPE_POTENTIAL_MATCH.getCode()); | ||
|
@@ -451,7 +485,7 @@ private void postAbisIdentification(InternalRegistrationStatusDto registrationSt | |
|
||
regProcLogger.info(LoggerFileConstant.SESSIONID.toString(), LoggerFileConstant.REGISTRATIONID.toString(), | ||
registrationStatusDto.getRegistrationId(), BioDedupeConstants.ABIS_RESPONSE_NOT_NULL); | ||
|
||
} | ||
} | ||
} | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think auto reject is two words and camel case to be corrected.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lets rename as below.
registration.processor.biometrics-update.single-match.auto-reject.enabled
biometricsUpdateSingleMatchAutoReject
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
resolved