Skip to content

Commit

Permalink
[MODCON-148] - removed tenantName from userTenant dto & change serial…
Browse files Browse the repository at this point in the history
…ization inclusing from NON_EMPTY to NON_NULL (#151)

* [MODCON-148] - removed tenantName from userTenant dto

* [MODCON-148] - removed tenantName from userTenant dto
  • Loading branch information
azizbekxm authored Apr 5, 2024
1 parent 8e335a3 commit 721e1aa
Show file tree
Hide file tree
Showing 5 changed files with 3 additions and 6 deletions.
4 changes: 3 additions & 1 deletion src/main/java/org/folio/consortia/config/AppConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
import org.springframework.web.client.RestTemplate;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.databind.DeserializationFeature;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.SerializationFeature;
Expand Down Expand Up @@ -45,7 +46,8 @@ public ObjectMapper objectMapper() {
final ObjectMapper objectMapper = new ObjectMapper();
objectMapper.findAndRegisterModules()
.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false)
.configure(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS, false);
.configure(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS, false)
.setSerializationInclusion(JsonInclude.Include.NON_NULL);
return objectMapper;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ public UserTenant convert(UserTenantEntity source) {
userTenant.setIsPrimary(source.getIsPrimary());
if (Objects.nonNull(source.getTenant())) {
userTenant.setTenantId(source.getTenant().getId());
userTenant.setTenantName(source.getTenant().getName());
}
return userTenant;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,6 @@ private UserTenantEntity toEntity(UserTenant userTenantDto, UUID consortiumId, U
UserTenantEntity entity = new UserTenantEntity();
TenantEntity tenant = new TenantEntity();
tenant.setId(userTenantDto.getTenantId());
tenant.setName(userTenantDto.getTenantName());
tenant.setConsortiumId(consortiumId);

if (Objects.nonNull(userTenantDto.getId())) {
Expand Down
2 changes: 0 additions & 2 deletions src/main/resources/swagger.api/schemas/userTenant.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@ UserTenant:
type: string
tenantId:
type: string
tenantName:
type: string
isPrimary:
type: boolean
centralTenantId:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -643,7 +643,6 @@ private ConsortiumEntity createConsortiumEntity() {
private UserTenant createUserTenantDtoEntity() {
UserTenant tenant = new UserTenant();
tenant.setTenantId("diku");
tenant.setTenantName("diku");
tenant.setUserId(UUID.randomUUID());
tenant.setId(UUID.randomUUID());
tenant.setUsername("Test");
Expand Down

0 comments on commit 721e1aa

Please sign in to comment.