Skip to content

Commit

Permalink
Mosip 26314 fix for read status for auth lock status 2 (mosip#801)
Browse files Browse the repository at this point in the history
* Fix for setting read status to false

* Revert "Fix for setting read status to false (mosip#791)"

This reverts commit c00a051.

* Check test fix

* Fix NPE in test in github

* Test fix

* logic fix in test

* Test fix

* Test fix

* Minor fixes

* Ignoring test for build failure in github action. to be reverted and fixed

* Fix for setting read status to false (mosip#791)

Co-authored-by: Loganathan Sekar <[email protected]>

---------

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 26367a6 commit 762829a
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 @@ -454,7 +454,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 762829a

Please sign in to comment.