RED-8480: don't merge recategorizations for images, create pending entry instead

* TODO: remove filter in report-service and pdftron-redaction-service
This commit is contained in:
Kilian Schuettler 2024-03-28 15:42:12 +01:00 committed by Ali Oezyetimoglu
parent 5f3801a811
commit ca56c4881e
3 changed files with 5 additions and 4 deletions

View File

@ -52,7 +52,7 @@ public class ManualRedactionDictionaryUpdateHandler {
public Set<String> handleAddToDictionaryAndReturnModifiedTypeIds(String fileId, String value, ManualRequestWithAddToDictionary manualRequestWithAddToDictionary) {
if (!manualRequestWithAddToDictionary.isAddToDictionary()) {
if (!manualRequestWithAddToDictionary.isAddToDictionary() || value == null) {
return Collections.emptySet();
}
Set<String> typeIdsOfModifiedDictionaries = new HashSet<>();
@ -99,7 +99,7 @@ public class ManualRedactionDictionaryUpdateHandler {
public Set<String> handleRemoveFromDictionaryAndReturnModifiedTypeIds(String fileId, ManualRequestWithRemoveFromDictionary manualRequestWithRemoveFromDictionary) {
if (!manualRequestWithRemoveFromDictionary.isRemoveFromDictionary()) {
if (!manualRequestWithRemoveFromDictionary.isRemoveFromDictionary() || manualRequestWithRemoveFromDictionary.getValue() == null) {
return Collections.emptySet();
}
String dossierId = manualRequestWithRemoveFromDictionary.getDossierId();

View File

@ -155,13 +155,12 @@ public class ManualRedactionMapper {
.addToDictionary(recategorizationRequest.isAddToDictionary())
.addToAllDossiers(recategorizationRequest.isAddToAllDossiers())
.dictionaryEntryType(getDictionaryEntryType(entityLogEntry))
.value(entityLogEntry.getValue())
.value(recategorizationRequest.getValue())
.typeToRemove(entityLogEntry.getType())
.dossierTemplateTypeId(toTypeId(recategorizationRequest.getType(), dossierTemplateId))
.legalBasis(Optional.ofNullable(recategorizationRequest.getLegalBasis())
.orElse(""))
.section(recategorizationRequest.getSection())
.value(recategorizationRequest.getValue())
.build();
requests.add(build);
}

View File

@ -245,6 +245,7 @@ public class ManualRedactionService {
Set<String> typeIdsOfDictionariesWithAdd = manualRedactionDictionaryUpdateHandler.handleAddToDictionaryAndReturnModifiedTypeIds(fileId,
recategorizationRequest.getValue(),
recategorizationRequest);
Set<String> typeIdsOfDictionariesWithDelete = manualRedactionDictionaryUpdateHandler.handleRemoveFromDictionaryAndReturnModifiedTypeIds(fileId,
recategorizationRequest);
@ -261,6 +262,7 @@ public class ManualRedactionService {
response.add(ManualAddResponse.builder().annotationId(recategorizationRequest.getAnnotationId()).commentId(commentId)
.build());
}
reprocess(dossierId, fileId);
fileStatusPersistenceService.setLastManualChangeDate(fileId, OffsetDateTime.now());