RED-8078: Removing an entity type should trigger complete reanalysis
added parameter to include deleted dictionary types
This commit is contained in:
parent
6a61033441
commit
c6d330f1df
@ -49,7 +49,7 @@ public class DictionaryInternalController implements DictionaryResource {
|
||||
@Override
|
||||
public Type getDictionaryForType(@PathVariable(TYPE_PARAMETER_NAME) String typeId, @RequestParam(value = FROM_VERSION_PARAM, required = false) Long fromVersion) {
|
||||
|
||||
var entity = dictionaryPersistenceService.getType(typeId);
|
||||
var entity = dictionaryPersistenceService.getType(typeId, true);
|
||||
var target = convert(entity, Type.class);
|
||||
target.setEntries(convert(entryPersistenceService.getEntries(typeId, DictionaryEntryType.ENTRY, fromVersion), DictionaryEntry.class));
|
||||
target.setFalsePositiveEntries(convert(entryPersistenceService.getEntries(typeId, DictionaryEntryType.FALSE_POSITIVE, fromVersion), DictionaryEntry.class));
|
||||
|
||||
@ -7,8 +7,6 @@ import java.util.Optional;
|
||||
import java.util.Set;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import jakarta.transaction.Transactional;
|
||||
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
@ -21,6 +19,7 @@ import com.iqser.red.service.persistence.management.v1.processor.service.persist
|
||||
import com.iqser.red.service.persistence.management.v1.processor.service.persistence.repository.dictionaryentry.EntryRepository;
|
||||
import com.iqser.red.service.persistence.service.v1.api.shared.model.dossiertemplate.type.DictionarySummaryResponse;
|
||||
|
||||
import jakarta.transaction.Transactional;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
|
||||
@Service
|
||||
@ -52,7 +51,8 @@ public class DictionaryPersistenceService {
|
||||
String dossierId,
|
||||
boolean hasDictionary,
|
||||
boolean systemManaged,
|
||||
boolean autoHideSkipped, boolean dossierDictionaryOnly) {
|
||||
boolean autoHideSkipped,
|
||||
boolean dossierDictionaryOnly) {
|
||||
|
||||
checkRankAlreadyExists(type, dossierTemplateId, rank, dossierId);
|
||||
|
||||
@ -168,6 +168,7 @@ public class DictionaryPersistenceService {
|
||||
return filterDeleted(types, includeDeleted);
|
||||
}
|
||||
|
||||
|
||||
public List<TypeEntity> getAllDossierTypesForDossierTemplateAndType(String dossierTemplateId, String type, boolean includeDeleted) {
|
||||
|
||||
var types = typeRepository.getAllDossierTypesForDossierTemplateAndType(dossierTemplateId, type);
|
||||
@ -189,9 +190,18 @@ public class DictionaryPersistenceService {
|
||||
}
|
||||
|
||||
|
||||
public TypeEntity getType(String typeId, boolean includeDeleted) {
|
||||
|
||||
if (includeDeleted) {
|
||||
return typeRepository.findById(typeId).orElseThrow(() -> new NotFoundException("Type: " + typeId + " not found"));
|
||||
}
|
||||
return typeRepository.findByIdAndNotDeleted(typeId).orElseThrow(() -> new NotFoundException("Type: " + typeId + " not found"));
|
||||
}
|
||||
|
||||
|
||||
public TypeEntity getType(String typeId) {
|
||||
|
||||
return typeRepository.findByIdAndNotDeleted(typeId).orElseThrow(() -> new NotFoundException("Type: " + typeId + " not found"));
|
||||
return getType(typeId, false);
|
||||
}
|
||||
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user