Skip to content

Commit

Permalink
Fix for setting read status to false (mosip#791)
Browse files Browse the repository at this point in the history
Co-authored-by: Loganathan Sekar <[email protected]>
Signed-off-by: Ritik Jain <[email protected]>
  • Loading branch information
2 people authored and Ritik Jain committed Oct 31, 2023
1 parent ec294f1 commit 26d7cb2
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -452,7 +452,7 @@ public CredentialRequestStatusResponseDto getStatus(String requestId) {
return credentialRequestStatusResponseDto;
}

public CredentialReqestDto prepareCredentialRequest(ResidentCredentialRequestDto residentCreDto, String individualId) {
private CredentialReqestDto prepareCredentialRequest(ResidentCredentialRequestDto residentCreDto, String individualId) {
CredentialReqestDto crDto = new CredentialReqestDto();
if(Utility.isSecureSession()){
crDto.setId(individualId);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,20 +50,20 @@ public void updateAuthTypeStatus(EventModel eventModel) throws ResidentServiceCh
auditUtil.setAuditRequestDto(EventEnum.UPDATE_AUTH_TYPE_STATUS);
try{
logger.info( "WebSubUpdateAuthTypeServiceImpl::updateAuthTypeStatus()::partnerId");
String eventId = insertInResidentTransactionTable(eventModel,"COMPLETED");
String eventId = updateInResidentTransactionTable(eventModel,"COMPLETED");
sendNotificationV2(TemplateType.SUCCESS,eventId);
}
catch (Exception e) {
logger.error(LoggerFileConstant.SESSIONID.toString(), LoggerFileConstant.APPLICATIONID.toString(),
LoggerFileConstant.APPLICATIONID.toString(), "WebSubUpdateAuthTypeServiceImpl::updateAuthTypeStatus()::exception");
String eventId = insertInResidentTransactionTable(eventModel,"FAILED");
String eventId = updateInResidentTransactionTable(eventModel,"FAILED");
sendNotificationV2(TemplateType.FAILURE, eventId);
throw new ResidentServiceCheckedException(ResidentErrorCode.RESIDENT_WEBSUB_UPDATE_AUTH_TYPE_FAILED.getErrorCode(),
ResidentErrorCode.RESIDENT_WEBSUB_UPDATE_AUTH_TYPE_FAILED.getErrorMessage(), e);
}
}

private String insertInResidentTransactionTable(EventModel eventModel, String status) {
private String updateInResidentTransactionTable(EventModel eventModel, String status) {

logger.debug(LoggerFileConstant.SESSIONID.toString(), LoggerFileConstant.APPLICATIONID.toString(),
LoggerFileConstant.APPLICATIONID.toString(), "WebSubUpdateAuthTypeServiceImpl::insertInResidentTransactionTable()::entry");
Expand All @@ -76,6 +76,7 @@ private String insertInResidentTransactionTable(EventModel eventModel, String s
if(residentTransactionEntity!=null){
residentTransactionEntity.stream().forEach(residentTransactionEntity1 -> {
residentTransactionEntity1.setStatusCode(status);
residentTransactionEntity1.setReadStatus(false);
});
residentTransactionRepository.saveAll(residentTransactionEntity);
}
Expand Down

0 comments on commit 26d7cb2

Please sign in to comment.