RED-5809: updated processedTime when declining a requested force redaction

This commit is contained in:
Ali Oezyetimoglu 2022-12-21 09:55:40 +01:00
parent 42d97bccc9
commit 78bdb954e0
2 changed files with 5 additions and 6 deletions

View File

@ -77,10 +77,10 @@ public class ForceRedactionPersistenceService {
return new HashSet<>(forceRedactionRepository.findByFileIdIncludeDeletions(fileId, includeDeletions));
}
@Transactional
public void markAsProcessed(String annotationId, String fileId) {
public void markAsProcessed(ManualForceRedaction e) {
forceRedactionRepository.markAsProcessed(new AnnotationEntityId(e.getAnnotationId(), e.getFileId()), OffsetDateTime.now().truncatedTo(ChronoUnit.MILLIS));
forceRedactionRepository.markAsProcessed(new AnnotationEntityId(annotationId, fileId), OffsetDateTime.now().truncatedTo(ChronoUnit.MILLIS));
}
}

View File

@ -97,7 +97,6 @@ public class ManualRedactionService {
private final RabbitTemplate rabbitTemplate;
private final ObjectMapper objectMapper;
private final RedactionLogService redactionLogService;
private final ForceRedactionRepository forceRedactionRepository;
private final HashFunction hashFunction = Hashing.murmur3_128();
@ -623,7 +622,7 @@ public class ManualRedactionService {
boolean isDeclined = forceRedaction.getStatus() == AnnotationStatus.REQUESTED && annotationStatus == AnnotationStatus.DECLINED;
actionPerformed = actionPerformed || !isDeclined;
if (isDeclined) {
forceRedactionRepository.markAsProcessed(new AnnotationEntityId(annotationId, fileId), OffsetDateTime.now().truncatedTo(ChronoUnit.MILLIS));
forceRedactionPersistenceService.markAsProcessed(annotationId, fileId);
}
}
@ -758,7 +757,7 @@ public class ManualRedactionService {
if (manualRedactions.getForceRedactions() != null) {
manualRedactions.getForceRedactions().forEach(e -> {
if (!e.getStatus().equals(AnnotationStatus.REQUESTED) && e.getProcessedDate() == null) {
forceRedactionPersistenceService.markAsProcessed(e);
forceRedactionPersistenceService.markAsProcessed(e.getAnnotationId(), e.getFileId());
}
});
}