RED-8823 - Add soft deleted time to type response #463
@ -273,6 +273,7 @@ public class DictionaryService {
|
||||
.systemManaged(typeResult.isSystemManaged())
|
||||
.autoHideSkipped(typeResult.isAutoHideSkipped())
|
||||
.dossierDictionaryOnly(typeResult.isDossierDictionaryOnly())
|
||||
.softDeletedTime(typeResult.getSoftDeletedTime())
|
||||
.build())
|
||||
.collect(Collectors.toList());
|
||||
return new TypeResponse(typeValues);
|
||||
|
||||
@ -1,6 +1,10 @@
|
||||
package com.iqser.red.service.peristence.v1.server.integration.tests;
|
||||
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||
import static org.junit.jupiter.api.Assertions.assertNotNull;
|
||||
import static org.junit.jupiter.api.Assertions.assertNull;
|
||||
import static org.junit.jupiter.api.Assertions.assertTrue;
|
||||
|
||||
import org.assertj.core.util.Lists;
|
||||
import org.junit.jupiter.api.Test;
|
||||
@ -119,4 +123,31 @@ public class TypeTest extends AbstractPersistenceServerServiceTest {
|
||||
assertThat(savedColors.getAppliedRedactionColor()).isEqualTo(colors.getAppliedRedactionColor());
|
||||
}
|
||||
|
||||
|
||||
@Test
|
||||
public void testSoftDeletedTimeForTypes() {
|
||||
|
||||
var dossierTemplate = dossierTemplateTesterAndProvider.provideTestTemplate();
|
||||
var type1 = typeProvider.testAndProvideType(dossierTemplate, "type1", 100);
|
||||
var type2 = typeProvider.testAndProvideType(dossierTemplate, "type2", 101);
|
||||
|
||||
var types = dictionaryClient.getAllTypes(dossierTemplate.getId(), null, true);
|
||||
assertEquals(types.getTypes().size(), 2);
|
||||
assertTrue(types.getTypes().stream().allMatch(typeValue -> typeValue.getSoftDeletedTime() == null));
|
||||
|
||||
dictionaryClient.deleteType(type2.getType(), dossierTemplate.getId());
|
||||
types = dictionaryClient.getAllTypes(dossierTemplate.getId(), null, true);
|
||||
assertEquals(types.getTypes().size(), 2);
|
||||
assertNull(types.getTypes()
|
||||
.stream()
|
||||
.filter(t -> t.getType().equals(type1.getType()))
|
||||
.findFirst()
|
||||
.get().getSoftDeletedTime());
|
||||
assertNotNull(types.getTypes()
|
||||
.stream()
|
||||
.filter(t -> t.getType().equals(type2.getType()))
|
||||
.findFirst()
|
||||
.get().getSoftDeletedTime());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -1,7 +1,8 @@
|
||||
package com.iqser.red.service.persistence.service.v1.api.shared.model;
|
||||
|
||||
import java.time.OffsetDateTime;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.AccessLevel;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
@ -65,4 +66,7 @@ public class TypeValue {
|
||||
@Schema(description = "Flag to indicate the dictionary is on dossier level only")
|
||||
private boolean dossierDictionaryOnly;
|
||||
|
||||
@Schema(description = "Time of soft deletion, will be null if it's not soft deleted")
|
||||
private OffsetDateTime softDeletedTime;
|
||||
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user