From 80e602fb074a4c7dbdfa0d1a30b71dca574e7adc Mon Sep 17 00:00:00 2001 From: Kilian Schuettler Date: Wed, 30 Aug 2023 15:32:22 +0200 Subject: [PATCH] RED-7317: Endpoint to change entity types of dict-based annotations * rebased --- .../ManualRedactionDictionaryUpdateHandler.java | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/persistence-service-v1/persistence-service-processor-v1/src/main/java/com/iqser/red/service/persistence/management/v1/processor/service/manualredactions/ManualRedactionDictionaryUpdateHandler.java b/persistence-service-v1/persistence-service-processor-v1/src/main/java/com/iqser/red/service/persistence/management/v1/processor/service/manualredactions/ManualRedactionDictionaryUpdateHandler.java index 5df5433ff..4c07842f9 100644 --- a/persistence-service-v1/persistence-service-processor-v1/src/main/java/com/iqser/red/service/persistence/management/v1/processor/service/manualredactions/ManualRedactionDictionaryUpdateHandler.java +++ b/persistence-service-v1/persistence-service-processor-v1/src/main/java/com/iqser/red/service/persistence/management/v1/processor/service/manualredactions/ManualRedactionDictionaryUpdateHandler.java @@ -68,7 +68,7 @@ public class ManualRedactionDictionaryUpdateHandler { private Set addToDossierTemplateDictionary(String fileId, String value, ManualRequestWithAddToDictionary manualRequestWithAddToDictionary, Set typeIdsOfModifiedDictionaries) { List dictionaryEntriesToUnDelete = dictionaryManagementService.getAllEntriesInDossierTemplate(manualRequestWithAddToDictionary.getDossierTemplateTypeId(), - value); + value, manualRequestWithAddToDictionary.getDictionaryEntryType()); dictionaryEntriesToUnDelete.forEach(entry -> { typeIdsOfModifiedDictionaries.add(entry.getTypeId()); addToDictionary(entry.getTypeId(), value, @@ -111,7 +111,7 @@ public class ManualRedactionDictionaryUpdateHandler { Set typeIdsOfModifiedDictionaries = new HashSet<>(); if (manualRequestWithRemoveFromDictionary.isRemoveFromAllDossiers()) { var dictionaryEntriesToRemove = dictionaryManagementService.getAllEntriesInDossierTemplate(toTypeId(redactionLogEntry.getType(), dossierTemplateId), - redactionLogEntry.getValue()); + redactionLogEntry.getValue(), DictionaryEntryType.ENTRY); dictionaryEntriesToRemove.forEach(entry -> { typeIdsOfModifiedDictionaries.add(entry.getTypeId()); removeFromDictionary(entry.getTypeId(), entry.getValue(), dossierId, fileId, DictionaryEntryType.ENTRY); @@ -212,9 +212,7 @@ public class ManualRedactionDictionaryUpdateHandler { public void revertAddToDictionary(String value, DictionaryEntryType dictionaryEntryType, String fileId, String dossierId, Set typeIdsOfModifiedDictionaries) { - typeIdsOfModifiedDictionaries.forEach(typeId -> { - removeFromDictionary(typeId, value, dossierId, fileId, dictionaryEntryType); - }); + typeIdsOfModifiedDictionaries.forEach(typeId -> removeFromDictionary(typeId, value, dossierId, fileId, dictionaryEntryType)); }