Pull request #109: RED-2590: Do not delete text on exclude from redaction to reindex after undelete, fixed reanalyse after include for redaction
Merge in RED/persistence-service from RED-2590 to master * commit 'ac760c6718f80d2da61cce538c67ee38a93df812': RED-2590: Do not delete text on exclude from redaction to reindex after undelete, fixed reanalyse after include for redaction
This commit is contained in:
commit
29bc3dcad4
@ -108,7 +108,7 @@ public interface FileRepository extends JpaRepository<FileEntity, String> {
|
||||
int setCurrentReviewer(String fileId, String currentReviewer, String lastReviewer, OffsetDateTime lastUpdated,
|
||||
WorkflowStatus workflowStatus);
|
||||
|
||||
@Modifying
|
||||
@Modifying(clearAutomatically = true)
|
||||
@Query("update FileEntity f set f.excluded = :excluded, f.lastUpdated = :lastUpdated where f.id = :fileId")
|
||||
int toggleExclusion(String fileId, boolean excluded, OffsetDateTime lastUpdated);
|
||||
|
||||
|
||||
@ -296,7 +296,6 @@ public class FileStatusService {
|
||||
OffsetDateTime now = OffsetDateTime.now();
|
||||
// remove everything related to redaction
|
||||
fileManagementStorageService.deleteObject(dossierId, fileId, FileType.REDACTION_LOG);
|
||||
fileManagementStorageService.deleteObject(dossierId, fileId, FileType.TEXT);
|
||||
fileManagementStorageService.deleteObject(dossierId, fileId, FileType.SECTION_GRID);
|
||||
|
||||
// wipe comments
|
||||
|
||||
@ -127,4 +127,29 @@ public class FileProcessingTest extends AbstractPersistenceServerServiceTest {
|
||||
|
||||
}
|
||||
|
||||
|
||||
@Test
|
||||
public void testFileReanlyseAfterToggleExclusion(){
|
||||
var dossier = dossierTesterAndProvider.provideTestDossier();
|
||||
|
||||
var file = fileTesterAndProvider.testAndProvideFile(dossier);
|
||||
|
||||
fileProcessingClient.analysisSuccessful(dossier.getId(), file.getId(), AnalyzeResult.builder()
|
||||
.analysisVersion(100)
|
||||
.fileId(file.getId())
|
||||
.dossierId(dossier.getId())
|
||||
.build());
|
||||
var loadedFile = fileClient.getFileStatus(dossier.getId(), file.getId());
|
||||
assertThat(loadedFile.getProcessingStatus()).isEqualTo(ProcessingStatus.PROCESSED);
|
||||
|
||||
fileClient.toggleExclusion(file.getDossierId(), file.getId(), true);
|
||||
|
||||
fileClient.toggleExclusion(file.getDossierId(), file.getId(), false);
|
||||
|
||||
loadedFile = fileClient.getFileStatus(dossier.getId(), file.getId());
|
||||
|
||||
assertThat(loadedFile.getProcessingStatus()).isEqualTo(ProcessingStatus.PROCESSING);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user