RED-4075: Add legalBasis if Rule Entity overrides Ai Recommendation

This commit is contained in:
deiflaender 2022-05-23 13:54:27 +02:00
parent b1bad03090
commit c669f9a09a

View File

@ -166,6 +166,9 @@ public class EntitySearchUtils {
if (existing.getType().equals(found.getType())) { if (existing.getType().equals(found.getType())) {
existing.getEngines().addAll(found.getEngines()); existing.getEngines().addAll(found.getEngines());
existing.setLegalBasis(found.getLegalBasis());
existing.setMatchedRule(found.getMatchedRule());
existing.setRedactionReason(found.getRedactionReason());
if (existing.getEntityType().equals(EntityType.RECOMMENDATION) && found.getEntityType().equals(EntityType.ENTITY) if (existing.getEntityType().equals(EntityType.RECOMMENDATION) && found.getEntityType().equals(EntityType.ENTITY)
|| existing.getEntityType().equals(EntityType.ENTITY) && found.getEntityType().equals(EntityType.RECOMMENDATION)) { || existing.getEntityType().equals(EntityType.ENTITY) && found.getEntityType().equals(EntityType.RECOMMENDATION)) {
existing.setEntityType(EntityType.ENTITY); existing.setEntityType(EntityType.ENTITY);
@ -230,6 +233,9 @@ public class EntitySearchUtils {
} }
var existingEntity = existingOptional.get(); var existingEntity = existingOptional.get();
existingEntity.getEngines().addAll(toAdd.getEngines()); existingEntity.getEngines().addAll(toAdd.getEngines());
existingEntity.setLegalBasis(toAdd.getLegalBasis());
existingEntity.setMatchedRule(toAdd.getMatchedRule());
existingEntity.setRedactionReason(toAdd.getRedactionReason());
} else { } else {
existing.add(toAdd); existing.add(toAdd);
} }