RED-5624: Refactoring of justifications

readded decription to reports
changed filter to filter out null technicalnames
This commit is contained in:
yhampe 2024-08-12 09:42:42 +02:00
parent 030aafcc5f
commit ddc16419e9

View File

@ -190,9 +190,17 @@ public class EntityLogConverterService {
private static String getJustificationReason(List<EntityLogLegalBasis> legalBasisMappings, EntityLogEntry entry) {
return legalBasisMappings.stream()
.filter((EntityLogLegalBasis lbm) -> lbm.getTechnicalName().equalsIgnoreCase(entry.getLegalBasis()))
.filter((EntityLogLegalBasis lbm) -> {
if (lbm.getTechnicalName() == null) {
return false;
}
if (lbm.getTechnicalName().equalsIgnoreCase(entry.getLegalBasis())) {
return true;
}
return false;
})
.findAny()
.map(EntityLogLegalBasis::getTechnicalName)
.map(EntityLogLegalBasis::getDescription)
.orElse("");
}