Merge branch 'RED-8826' into 'master'
RED-8826: Added experimetal flag to entity types Closes RED-8826 See merge request redactmanager/persistence-service!462
This commit is contained in:
commit
7acc0889b7
@ -60,6 +60,8 @@ public class TypeEntity {
|
||||
private boolean autoHideSkipped;
|
||||
@Column
|
||||
private OffsetDateTime softDeletedTime;
|
||||
@Column
|
||||
private boolean experimental;
|
||||
|
||||
@Column
|
||||
private boolean dossierDictionaryOnly;
|
||||
|
||||
@ -106,7 +106,8 @@ public class DictionaryManagementService {
|
||||
typeRequest.isHasDictionary(),
|
||||
typeRequest.isSystemManaged(),
|
||||
typeRequest.isAutoHideSkipped(),
|
||||
typeRequest.isDossierDictionaryOnly()), Type.class, new TypeMapper());
|
||||
typeRequest.isDossierDictionaryOnly(),
|
||||
typeRequest.isExperimental()), Type.class, new TypeMapper());
|
||||
}
|
||||
|
||||
|
||||
@ -275,8 +276,11 @@ public class DictionaryManagementService {
|
||||
|
||||
|
||||
public void checkForDossierTypeExistenceAndCreate(String typeId) {
|
||||
checkForDossierTypeExistenceAndCreate(typeId,false);
|
||||
|
||||
checkForDossierTypeExistenceAndCreate(typeId, false);
|
||||
}
|
||||
|
||||
|
||||
public void checkForDossierTypeExistenceAndCreate(String typeId, boolean includeDeleted) {
|
||||
// check for the existence of dossier type and create in case it does not exist
|
||||
if (isDossierTypeId(typeId)) {
|
||||
@ -289,7 +293,7 @@ public class DictionaryManagementService {
|
||||
log.info("--> " + dossierId + " - " + dossierTemplateId);
|
||||
checkDossierMatchesDossierTemplate(dossierId, dossierTemplateId);
|
||||
// type not found, it should be created based on the info from the dossier template type
|
||||
var dossierTemplateType = dictionaryPersistenceService.getType(getDosssierTemplateTypeIdFromTypeId(typeId),includeDeleted);
|
||||
var dossierTemplateType = dictionaryPersistenceService.getType(getDosssierTemplateTypeIdFromTypeId(typeId), includeDeleted);
|
||||
Type dossierDictionaryType = MagicConverter.convert(dossierTemplateType, Type.class);
|
||||
dossierDictionaryType.setVersion(0);
|
||||
dossierDictionaryType.setDossierId(dossierId);
|
||||
|
||||
@ -274,6 +274,7 @@ public class DictionaryService {
|
||||
.autoHideSkipped(typeResult.isAutoHideSkipped())
|
||||
.dossierDictionaryOnly(typeResult.isDossierDictionaryOnly())
|
||||
.softDeletedTime(typeResult.getSoftDeletedTime())
|
||||
.experimental(typeResult.isExperimental())
|
||||
.build())
|
||||
.collect(Collectors.toList());
|
||||
return new TypeResponse(typeValues);
|
||||
@ -331,6 +332,7 @@ public class DictionaryService {
|
||||
.systemManaged(dictionaryForType.isSystemManaged())
|
||||
.autoHideSkipped(dictionaryForType.isAutoHideSkipped())
|
||||
.dossierDictionaryOnly(dictionaryForType.isDossierDictionaryOnly())
|
||||
.experimental(dictionaryForType.isExperimental())
|
||||
.build();
|
||||
}
|
||||
|
||||
@ -392,6 +394,7 @@ public class DictionaryService {
|
||||
.systemManaged(entity.isSystemManaged())
|
||||
.autoHideSkipped(entity.isAutoHideSkipped())
|
||||
.dossierDictionaryOnly(entity.isDossierDictionaryOnly())
|
||||
.experimental(entity.isExperimental())
|
||||
.build();
|
||||
dictionaries.add(dict);
|
||||
});
|
||||
|
||||
@ -174,7 +174,8 @@ public class DossierTemplateCloneService {
|
||||
t.isHasDictionary(),
|
||||
t.isSystemManaged(),
|
||||
t.isAutoHideSkipped(),
|
||||
t.isDossierDictionaryOnly());
|
||||
t.isDossierDictionaryOnly(),
|
||||
t.isExperimental());
|
||||
entryPersistenceService.cloneEntries(t.getId(), type.getId());
|
||||
}
|
||||
}
|
||||
|
||||
@ -53,7 +53,8 @@ public class DictionaryPersistenceService {
|
||||
boolean hasDictionary,
|
||||
boolean systemManaged,
|
||||
boolean autoHideSkipped,
|
||||
boolean dossierDictionaryOnly) {
|
||||
boolean dossierDictionaryOnly,
|
||||
boolean experimental) {
|
||||
|
||||
checkRankAlreadyExists(type, dossierTemplateId, rank, dossierId);
|
||||
|
||||
@ -78,6 +79,7 @@ public class DictionaryPersistenceService {
|
||||
.autoHideSkipped(autoHideSkipped)
|
||||
.softDeletedTime(null)
|
||||
.dossierDictionaryOnly(dossierDictionaryOnly)
|
||||
.experimental(experimental)
|
||||
.build();
|
||||
|
||||
return typeRepository.saveAndFlush(t);
|
||||
@ -90,7 +92,12 @@ public class DictionaryPersistenceService {
|
||||
if (!existingTypesForRank.isEmpty()) {
|
||||
for (var existingTypeValueForRank : existingTypesForRank) {
|
||||
if (!existingTypeValueForRank.isDeleted() && !existingTypeValueForRank.getType().equalsIgnoreCase(type)) {
|
||||
throw new ConflictException("Rank already exists: " + rank + " on type: " + existingTypeValueForRank.getType() + " type id: " + existingTypeValueForRank.getId());
|
||||
throw new ConflictException("Rank already exists: "
|
||||
+ rank
|
||||
+ " on type: "
|
||||
+ existingTypeValueForRank.getType()
|
||||
+ " type id: "
|
||||
+ existingTypeValueForRank.getId());
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -298,6 +305,7 @@ public class DictionaryPersistenceService {
|
||||
|
||||
}
|
||||
|
||||
|
||||
@Transactional
|
||||
public void updateRankForType(String typeId, int newRank) {
|
||||
|
||||
|
||||
@ -199,3 +199,5 @@ databaseChangeLog:
|
||||
file: db/changelog/tenant/sql/207-acl-migration-cleanup.sql
|
||||
- include:
|
||||
file: db/changelog/tenant/125-add-max-size-for-legal-basis-in-manual-legal-basis-change.yaml
|
||||
- include:
|
||||
file: db/changelog/tenant/126-add-experimental-flag-to-entity.yaml
|
||||
@ -0,0 +1,12 @@
|
||||
databaseChangeLog:
|
||||
- changeSet:
|
||||
id: add-experimental-flag-to-entity
|
||||
author: dom
|
||||
changes:
|
||||
- addColumn:
|
||||
columns:
|
||||
- column:
|
||||
name: experimental
|
||||
type: BOOLEAN
|
||||
defaultValueBoolean: false
|
||||
tableName: entity
|
||||
@ -66,6 +66,9 @@ public class TypeValue {
|
||||
@Schema(description = "Flag to indicate the dictionary is on dossier level only")
|
||||
private boolean dossierDictionaryOnly;
|
||||
|
||||
@Schema(description = "Flag to indicate if a entity is experimental and should not be show in default mode")
|
||||
private boolean experimental;
|
||||
|
||||
@Schema(description = "Time of soft deletion, will be null if it's not soft deleted")
|
||||
private OffsetDateTime softDeletedTime;
|
||||
|
||||
|
||||
@ -70,4 +70,7 @@ public class Dictionary {
|
||||
@Schema(description = "Flag to indicate the dictionary is on dossier level only")
|
||||
private boolean dossierDictionaryOnly;
|
||||
|
||||
@Schema(description = "Flag to indicate if a entity is experimental and should not be show in default mode")
|
||||
private boolean experimental;
|
||||
|
||||
}
|
||||
|
||||
@ -42,6 +42,7 @@ public class Type {
|
||||
private boolean systemManaged;
|
||||
private boolean autoHideSkipped;
|
||||
private OffsetDateTime softDeletedTime;
|
||||
private boolean experimental;
|
||||
|
||||
|
||||
// For auto-mappers
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user