Merge branch 'RED-8043-section' into 'master'

RED-8043 - Save section for manual redactions and unprocessed manual redactions

Closes RED-8043

See merge request redactmanager/persistence-service!299
This commit is contained in:
Andrei Isvoran 2024-01-09 16:02:24 +01:00
commit 3d1d7bcbf2
2 changed files with 4 additions and 0 deletions

View File

@ -41,6 +41,7 @@ public class AddRedactionPersistenceService {
manualRedactionEntry.setPositions(convert(addRedactionRequest.getPositions()));
manualRedactionEntry.setTypeId(addRedactionRequest.getDossierTemplateTypeId());
manualRedactionEntry.setDictionaryEntryType(addRedactionRequest.getDictionaryEntryType());
manualRedactionEntry.setSection(addRedactionRequest.getSection());
return manualRedactionRepository.saveAndFlush(manualRedactionEntry);

View File

@ -54,6 +54,9 @@ public class RedactionAnalysisResponseReceiver {
manualRedactionEntry.setTextBefore(unprocessedManualEntity.getTextBefore());
manualRedactionEntry.setTextAfter(unprocessedManualEntity.getTextAfter());
manualRedactionEntry.setPositions(convertPositions(unprocessedManualEntity.getPositions()));
if (manualRedactionEntry.getSection() == null ||!manualRedactionEntry.getSection().equals(unprocessedManualEntity.getSection())) {
manualRedactionEntry.setSection(unprocessedManualEntity.getSection());
}
addRedactionPersistenceService.update(manualRedactionEntry);
}