RED-7317: Endpoint to change entity types of dict-based annotations

* fix tests
This commit is contained in:
Kilian Schuettler 2023-08-30 15:46:49 +02:00
parent 80e602fb07
commit d40ef63116
2 changed files with 6 additions and 3 deletions

View File

@ -111,14 +111,14 @@ public class ManualRedactionDictionaryUpdateHandler {
Set<String> typeIdsOfModifiedDictionaries = new HashSet<>();
if (manualRequestWithRemoveFromDictionary.isRemoveFromAllDossiers()) {
var dictionaryEntriesToRemove = dictionaryManagementService.getAllEntriesInDossierTemplate(toTypeId(redactionLogEntry.getType(), dossierTemplateId),
redactionLogEntry.getValue(), DictionaryEntryType.ENTRY);
redactionLogEntry.getValue(), getDictionaryEntryType(redactionLogEntry));
dictionaryEntriesToRemove.forEach(entry -> {
typeIdsOfModifiedDictionaries.add(entry.getTypeId());
removeFromDictionary(entry.getTypeId(), entry.getValue(), dossierId, fileId, DictionaryEntryType.ENTRY);
removeFromDictionary(entry.getTypeId(), entry.getValue(), dossierId, fileId, getDictionaryEntryType(redactionLogEntry));
});
} else {
typeIdsOfModifiedDictionaries.add(toTypeId(redactionLogEntry.getType(), dossierTemplateId, dossierId));
removeFromDictionary(toTypeId(redactionLogEntry.getType(), dossierTemplateId, dossierId), redactionLogEntry.getValue(), dossierId, fileId, DictionaryEntryType.ENTRY);
removeFromDictionary(toTypeId(redactionLogEntry.getType(), dossierTemplateId, dossierId), redactionLogEntry.getValue(), dossierId, fileId, getDictionaryEntryType(redactionLogEntry));
}
// This is needed to remove resizeRedactions with addToDictionary.

View File

@ -52,6 +52,7 @@ import com.iqser.red.service.persistence.service.v1.api.shared.model.dossiertemp
import com.iqser.red.service.persistence.service.v1.api.shared.model.dossiertemplate.dossier.file.FileType;
import com.iqser.red.service.persistence.service.v1.api.shared.model.dossiertemplate.dossier.file.ProcessingStatus;
import com.iqser.red.service.persistence.service.v1.api.shared.model.dossiertemplate.dossier.file.WorkflowStatus;
import com.iqser.red.service.persistence.service.v1.api.shared.model.dossiertemplate.type.DictionaryEntryType;
import com.iqser.red.service.persistence.service.v1.api.shared.model.manual.AddCommentRequestModel;
import com.iqser.red.service.persistence.service.v1.api.shared.model.manual.AddRedactionRequestModel;
import com.iqser.red.service.persistence.service.v1.api.shared.model.manual.ForceRedactionRequestModel;
@ -371,6 +372,7 @@ public class FileTest extends AbstractPersistenceServerServiceTest {
.reason("1")
.value("test")
.legalBasis("1")
.dictionaryEntryType(DictionaryEntryType.ENTRY)
.build();
manualRedactionClient.addRedactionBulk(dossierId, fileId, Set.of(addRedactionRequest));
@ -440,6 +442,7 @@ public class FileTest extends AbstractPersistenceServerServiceTest {
.reason("1")
.value("test")
.legalBasis("1")
.dictionaryEntryType(DictionaryEntryType.ENTRY)
.build())).iterator().next();
var loadedFile = fileClient.getFileStatus(dossier.getId(), file.getId());