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(); DictionaryEntryType dictionaryEntryType = manualRequestWithRemoveFromDictionary.getDictionaryEntryType();
Set<String> typeIdsOfModifiedDictionaries = new HashSet<>(); Set<String> typeIdsOfModifiedDictionaries = new HashSet<>();
String dossierTemplateDictionaryTypeId = toTypeId(manualRequestWithRemoveFromDictionary.getType(), manualRequestWithRemoveFromDictionary.getDossierTemplateId()); String dossierTemplateDictionaryTypeId = toTypeId(manualRequestWithRemoveFromDictionary.getTypeToRemove(), manualRequestWithRemoveFromDictionary.getDossierTemplateId());
String dossierDictionaryTypeId = toTypeId(manualRequestWithRemoveFromDictionary.getType(), String dossierDictionaryTypeId = toTypeId(manualRequestWithRemoveFromDictionary.getTypeToRemove(),
manualRequestWithRemoveFromDictionary.getDossierTemplateId(), manualRequestWithRemoveFromDictionary.getDossierTemplateId(),
manualRequestWithRemoveFromDictionary.getDossierId()); manualRequestWithRemoveFromDictionary.getDossierId());

View File

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

View File

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

View File

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

View File

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

View File

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