Skip to content

Commit

Permalink
fix: promote to Uat (#16)
Browse files Browse the repository at this point in the history
Co-authored-by: DanieleRanaldo <[email protected]>
Co-authored-by: DanieleRanaldo <[email protected]>
Co-authored-by: Vitolo-Andrea <[email protected]>
  • Loading branch information
4 people authored Dec 6, 2024
1 parent bb803f2 commit 810f4f4
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public CitizenConsentValidationServiceImpl(CitizenRepository citizenRepository,
@Override
public Mono<CitizenConsentDTO> handleExistingConsent(CitizenConsent existingConsent, String tppId, CitizenConsent citizenConsent) {
if (existingConsent.getConsents().containsKey(tppId)) {
return Mono.just(mapperToDTO.map(existingConsent));
return Mono.just(mapperToDTO.map(citizenConsent));
} else {
return validateTppAndUpdateConsent(existingConsent, tppId, citizenConsent);
}
Expand All @@ -55,7 +55,7 @@ public Mono<CitizenConsentDTO> validateTppAndSaveConsent(String fiscalCode, Stri
log.info("[EMD][CREATE-CITIZEN-CONSENT] Created new citizen consent for fiscal code: {}", Utils.createSHA256(fiscalCode));
bloomFilterService.add(fiscalCode);
})
.map(mapperToDTO::map);
.map(savedConsent -> mapperToDTO.map(citizenConsent));
} else {
return Mono.error(exceptionMap.throwException(ExceptionName.TPP_NOT_FOUND, "TPP is not active or is invalid"));
}
Expand All @@ -70,7 +70,7 @@ private Mono<CitizenConsentDTO> validateTppAndUpdateConsent(CitizenConsent exist
existingConsent.getConsents().put(tppId, citizenConsent.getConsents().get(tppId));
return citizenRepository.save(existingConsent)
.doOnSuccess(savedConsent -> log.info("[EMD][CREATE-CITIZEN-CONSENT] Updated citizen consent for TPP: {}", tppId))
.flatMap(savedConsent -> Mono.just(mapperToDTO.map(savedConsent)));
.map(savedConsent -> mapperToDTO.map(citizenConsent));
});
}
}

0 comments on commit 810f4f4

Please sign in to comment.