From 52d17839126bb62c608f78f93cf80ca2653b1741 Mon Sep 17 00:00:00 2001 From: Loganathan Sekar Date: Mon, 13 Mar 2023 16:16:06 +0530 Subject: [PATCH] Fix for setting read status to false --- .../service/impl/ResidentCredentialServiceImpl.java | 2 +- .../service/impl/WebSubUpdateAuthTypeServiceImpl.java | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/resident/resident-service/src/main/java/io/mosip/resident/service/impl/ResidentCredentialServiceImpl.java b/resident/resident-service/src/main/java/io/mosip/resident/service/impl/ResidentCredentialServiceImpl.java index 32f8d9e83ff..fbc808b49b6 100644 --- a/resident/resident-service/src/main/java/io/mosip/resident/service/impl/ResidentCredentialServiceImpl.java +++ b/resident/resident-service/src/main/java/io/mosip/resident/service/impl/ResidentCredentialServiceImpl.java @@ -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); diff --git a/resident/resident-service/src/main/java/io/mosip/resident/service/impl/WebSubUpdateAuthTypeServiceImpl.java b/resident/resident-service/src/main/java/io/mosip/resident/service/impl/WebSubUpdateAuthTypeServiceImpl.java index 996513ccd41..e504998e757 100644 --- a/resident/resident-service/src/main/java/io/mosip/resident/service/impl/WebSubUpdateAuthTypeServiceImpl.java +++ b/resident/resident-service/src/main/java/io/mosip/resident/service/impl/WebSubUpdateAuthTypeServiceImpl.java @@ -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"); @@ -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); }