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

* fix test
* make it clear, which field does what
This commit is contained in:
Kilian Schuettler 2023-08-30 17:01:53 +02:00
parent 7fcb52c90f
commit 701c65eac7
6 changed files with 9 additions and 9 deletions

View File

@ -107,8 +107,8 @@ public class ManualRedactionDictionaryUpdateHandler {
DictionaryEntryType dictionaryEntryType = manualRequestWithRemoveFromDictionary.getDictionaryEntryType();
Set<String> typeIdsOfModifiedDictionaries = new HashSet<>();
String dossierTemplateDictionaryTypeId = toTypeId(manualRequestWithRemoveFromDictionary.getType(), manualRequestWithRemoveFromDictionary.getDossierTemplateId());
String dossierDictionaryTypeId = toTypeId(manualRequestWithRemoveFromDictionary.getType(),
String dossierTemplateDictionaryTypeId = toTypeId(manualRequestWithRemoveFromDictionary.getTypeToRemove(), manualRequestWithRemoveFromDictionary.getDossierTemplateId());
String dossierDictionaryTypeId = toTypeId(manualRequestWithRemoveFromDictionary.getTypeToRemove(),
manualRequestWithRemoveFromDictionary.getDossierTemplateId(),
manualRequestWithRemoveFromDictionary.getDossierId());

View File

@ -87,7 +87,7 @@ public class ManualRedactionMapper {
.removeFromAllDossiers(removeRedactionRequest.isRemoveFromAllDossiers())
.value(redactionLogEntry.getValue())
.dictionaryEntryType(getDictionaryEntryType(redactionLogEntry))
.type(redactionLogEntry.getType())
.typeToRemove(redactionLogEntry.getType())
.dossierId(dossierId)
.dossierTemplateId(dossierTemplateId);
@ -151,7 +151,7 @@ public class ManualRedactionMapper {
.addToAllDossiers(recategorizationRequest.isAddToAllDossiers())
.dictionaryEntryType(getDictionaryEntryType(redactionLogEntry))
.value(redactionLogEntry.getValue())
.type(recategorizationRequest.getType())
.typeToRemove(redactionLogEntry.getType())
.dossierTemplateTypeId(toTypeId(recategorizationRequest.getType(), dossierTemplateId))
.build();
requests.add(build);

View File

@ -116,7 +116,7 @@ public class ManualRedactionService {
for (RemoveRedactionRequest removeRedactionRequest : removeRedactionRequests) {
manualRedactionDictionaryUpdateHandler.validateDictionariesForDelete(removeRedactionRequest,
removeRedactionRequest.getType(),
removeRedactionRequest.getTypeToRemove(),
removeRedactionRequest.getDossierTemplateId());
removeRedactionPersistenceService.insert(fileId, removeRedactionRequest);
@ -218,7 +218,7 @@ public class ManualRedactionService {
for (var recategorizationRequest : recategorizationRequests) {
manualRedactionDictionaryUpdateHandler.validateDictionariesForAdd(recategorizationRequest, recategorizationRequest.getValue());
manualRedactionDictionaryUpdateHandler.validateDictionariesForDelete(recategorizationRequest,
recategorizationRequest.getType(),
recategorizationRequest.getTypeToRemove(),
recategorizationRequest.getDossierTemplateId());
recategorizationPersistenceService.insert(fileId, recategorizationRequest);

View File

@ -9,7 +9,7 @@ public interface ManualRequestWithRemoveFromDictionary extends BaseManualRequest
String getValue();
String getType();
String getTypeToRemove();
String getDossierTemplateId();

View File

@ -20,7 +20,7 @@ public class RecategorizationRequest implements ManualRequestWithAddToDictionary
String user;
String value;
AnnotationStatus status;
String type;
String typeToRemove;
String dossierTemplateId;
String dossierId;
String dossierTemplateTypeId;

View File

@ -22,7 +22,7 @@ public class RemoveRedactionRequest implements ManualRequestWithRemoveFromDictio
String user;
String dossierId;
String dossierTemplateId;
String type;
String typeToRemove;
AnnotationStatus status;
boolean removeFromDictionary;
boolean removeFromAllDossiers;