DM-504: always exclude hard deleted files
* adjusted error message * also removed annotationStatus since it is always APPROVED anyway * removed inactive options from FilteredEntityLogRequest
This commit is contained in:
parent
6ec370ad01
commit
781b761aad
@ -98,7 +98,7 @@ public class FileControllerV2 implements FileResource {
|
||||
FileStatus status = statusController.getFileStatus(dossierId, fileId);
|
||||
|
||||
if (status.getHardDeletedTime() != null) {
|
||||
throw new NotFoundException(String.format("The requested file has been hard deleted on %s.", status.getHardDeletedTime().format(DateTimeFormatter.ISO_LOCAL_DATE)));
|
||||
throw new NotFoundException("File not found");
|
||||
}
|
||||
|
||||
if (!includeSoftDeleted && status.getSoftDeletedTime() != null) {
|
||||
|
||||
@ -41,7 +41,7 @@ public class EntityLogService {
|
||||
}
|
||||
|
||||
if (excludedTypes != null) {
|
||||
redactionLog.getEntityLogEntry().removeIf(nextEntry -> excludedTypes.contains(nextEntry.getType()));
|
||||
redactionLog.getEntityLogEntry().removeIf(entry -> excludedTypes.contains(entry.getType()));
|
||||
}
|
||||
|
||||
return redactionLog;
|
||||
@ -68,9 +68,8 @@ public class EntityLogService {
|
||||
}
|
||||
}
|
||||
for (var manualChange : redactionLogEntry.getManualChanges()) {
|
||||
if (manualChange.getProcessedDate() != null && manualChange.getProcessedDate()
|
||||
.isAfter(filteredEntityLogRequest.getSpecifiedDate()) || manualChange.getRequestedDate() != null && manualChange.getRequestedDate()
|
||||
.isAfter(filteredEntityLogRequest.getSpecifiedDate())) {
|
||||
if (manualChange.getProcessedDate() != null && manualChange.getProcessedDate().isAfter(filteredEntityLogRequest.getSpecifiedDate()) || //
|
||||
manualChange.getRequestedDate() != null && manualChange.getRequestedDate().isAfter(filteredEntityLogRequest.getSpecifiedDate())) {
|
||||
isAfterSpecifiedDate = true;
|
||||
break;
|
||||
}
|
||||
|
||||
@ -1,6 +1,5 @@
|
||||
package com.iqser.red.service.persistence.management.v1.processor.service.layoutparsing;
|
||||
|
||||
import java.util.Map;
|
||||
import java.util.Optional;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
|
||||
@ -15,8 +15,6 @@ import lombok.NoArgsConstructor;
|
||||
public class FilteredEntityLogRequest {
|
||||
|
||||
private List<String> excludedTypes;
|
||||
private boolean withManualRedactions;
|
||||
private boolean includeFalsePositives;
|
||||
private OffsetDateTime specifiedDate;
|
||||
|
||||
}
|
||||
|
||||
@ -4,7 +4,6 @@ import java.time.OffsetDateTime;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import com.iqser.red.service.persistence.service.v1.api.shared.model.annotations.AnnotationStatus;
|
||||
import com.iqser.red.service.persistence.service.v1.api.shared.model.annotations.entitymapped.BaseAnnotation;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
@ -18,7 +17,6 @@ import lombok.NoArgsConstructor;
|
||||
@Builder
|
||||
public class ManualChange {
|
||||
|
||||
private AnnotationStatus annotationStatus;
|
||||
private ManualRedactionType manualRedactionType;
|
||||
private OffsetDateTime processedDate;
|
||||
private OffsetDateTime requestedDate;
|
||||
@ -29,7 +27,6 @@ public class ManualChange {
|
||||
public static ManualChange from(BaseAnnotation baseAnnotation) {
|
||||
|
||||
ManualChange manualChange = new ManualChange();
|
||||
manualChange.annotationStatus = baseAnnotation.getStatus();
|
||||
manualChange.processedDate = baseAnnotation.getProcessedDate();
|
||||
manualChange.requestedDate = baseAnnotation.getRequestDate();
|
||||
manualChange.userId = baseAnnotation.getUser();
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user