Skip to content
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

fix: promote to Uat #16

Merged
merged 3 commits into from
Dec 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -55,4 +55,5 @@ public static class ConsentKeyWrapper {
private String k;
}


}
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));
});
}
}
Loading