From beb36c772c050d35b383312b24c262803845d3ee Mon Sep 17 00:00:00 2001 From: Martin Kaeser Date: Wed, 6 Dec 2023 13:04:10 +0100 Subject: [PATCH 1/3] refactor(DTO): Restructure SiteDto/SiteVerboseDto --- .../bridge/dummy/dto/DtoConversionHelper.kt | 15 ++++++-- .../bridge/dummy/service/PoolUpdateService.kt | 6 ++-- .../catenax/bpdm/bridge/dummy/BridgeSyncIT.kt | 6 ++-- .../dummy/testdata/GateRequestValues.kt | 1 - .../tractusx/bpdm/common/dto/IBaseSiteDto.kt | 2 +- ...{IBaseSiteStateDto.kt => ISiteStateDto.kt} | 2 +- .../bpdm/gate/api/model/SiteGateDto.kt | 3 +- .../bpdm/gate/api/model}/SiteStateDto.kt | 9 +++-- .../orchestrator/api/model/SiteStateDto.kt | 5 +-- .../bpdm/pool/api/PoolLegalEntityApi.kt | 2 +- .../tractusx/bpdm/pool/api/PoolSiteApi.kt | 6 ++-- .../tractusx/bpdm/pool/api/model}/SiteDto.kt | 10 +++--- .../bpdm/pool/api/model/SiteStateDto.kt | 36 +++++++++++++++++++ .../pool/api/model}/SiteStateVerboseDto.kt | 2 +- .../bpdm/pool/api/model}/SiteVerboseDto.kt | 2 +- .../model}/request/SiteBpnSearchRequest.kt | 4 ++- .../model/request/SitePartnerCreateRequest.kt | 3 +- .../model/request/SitePartnerUpdateRequest.kt | 5 +-- .../api/model/response/SiteMatchVerboseDto.kt | 2 +- .../response/SitePartnerCreateVerboseDto.kt | 2 +- ...to.kt => SiteWithMainAddressVerboseDto.kt} | 4 +-- .../pool/controller/LegalEntityController.kt | 6 ++-- .../bpdm/pool/controller/SiteController.kt | 7 ++-- .../service/BusinessPartnerBuildService.kt | 2 +- .../bpdm/pool/service/ResponseMappings.kt | 4 +-- .../tractusx/bpdm/pool/service/SiteService.kt | 10 +++--- .../bpdm/pool/controller/SiteControllerIT.kt | 20 +++++------ .../TaskStepFetchAndReserveServiceTest.kt | 15 ++++---- .../util/BusinessPartnerNonVerboseValues.kt | 5 +-- .../pool/util/BusinessPartnerVerboseValues.kt | 2 -- 30 files changed, 121 insertions(+), 77 deletions(-) rename bpdm-common/src/main/kotlin/org/eclipse/tractusx/bpdm/common/dto/{IBaseSiteStateDto.kt => ISiteStateDto.kt} (97%) rename {bpdm-common/src/main/kotlin/org/eclipse/tractusx/bpdm/common/dto => bpdm-gate-api/src/main/kotlin/org/eclipse/tractusx/bpdm/gate/api/model}/SiteStateDto.kt (91%) rename {bpdm-common/src/main/kotlin/org/eclipse/tractusx/bpdm/common/dto => bpdm-pool-api/src/main/kotlin/org/eclipse/tractusx/bpdm/pool/api/model}/SiteDto.kt (87%) create mode 100644 bpdm-pool-api/src/main/kotlin/org/eclipse/tractusx/bpdm/pool/api/model/SiteStateDto.kt rename {bpdm-common/src/main/kotlin/org/eclipse/tractusx/bpdm/common/dto/response => bpdm-pool-api/src/main/kotlin/org/eclipse/tractusx/bpdm/pool/api/model}/SiteStateVerboseDto.kt (97%) rename {bpdm-common/src/main/kotlin/org/eclipse/tractusx/bpdm/common/dto/response => bpdm-pool-api/src/main/kotlin/org/eclipse/tractusx/bpdm/pool/api/model}/SiteVerboseDto.kt (97%) rename {bpdm-common/src/main/kotlin/org/eclipse/tractusx/bpdm/common/dto => bpdm-pool-api/src/main/kotlin/org/eclipse/tractusx/bpdm/pool/api/model}/request/SiteBpnSearchRequest.kt (95%) rename bpdm-pool-api/src/main/kotlin/org/eclipse/tractusx/bpdm/pool/api/model/response/{SitePoolVerboseDto.kt => SiteWithMainAddressVerboseDto.kt} (94%) diff --git a/bpdm-bridge-dummy/src/main/kotlin/com/catenax/bpdm/bridge/dummy/dto/DtoConversionHelper.kt b/bpdm-bridge-dummy/src/main/kotlin/com/catenax/bpdm/bridge/dummy/dto/DtoConversionHelper.kt index ecf8599c6..2293dc943 100644 --- a/bpdm-bridge-dummy/src/main/kotlin/com/catenax/bpdm/bridge/dummy/dto/DtoConversionHelper.kt +++ b/bpdm-bridge-dummy/src/main/kotlin/com/catenax/bpdm/bridge/dummy/dto/DtoConversionHelper.kt @@ -23,19 +23,21 @@ import org.eclipse.tractusx.bpdm.common.dto.* import org.eclipse.tractusx.bpdm.common.dto.response.AlternativePostalAddressVerboseDto import org.eclipse.tractusx.bpdm.common.dto.response.LogisticAddressVerboseDto import org.eclipse.tractusx.bpdm.common.dto.response.PhysicalPostalAddressVerboseDto -import org.eclipse.tractusx.bpdm.common.dto.response.SiteVerboseDto import org.eclipse.tractusx.bpdm.common.exception.BpdmNullMappingException import org.eclipse.tractusx.bpdm.gate.api.model.* import org.eclipse.tractusx.bpdm.pool.api.model.LegalEntityVerboseDto +import org.eclipse.tractusx.bpdm.pool.api.model.SiteVerboseDto import kotlin.reflect.KProperty import org.eclipse.tractusx.bpdm.gate.api.model.LegalEntityClassificationDto as Gate_LegalEntityClassificationDto import org.eclipse.tractusx.bpdm.gate.api.model.LegalEntityDto as Gate_LegalEntityDto import org.eclipse.tractusx.bpdm.gate.api.model.LegalEntityIdentifierDto as Gate_LegalEntityIdentifierDto import org.eclipse.tractusx.bpdm.gate.api.model.LegalEntityStateDto as Gate_LegalEntityStateDto +import org.eclipse.tractusx.bpdm.gate.api.model.SiteStateDto as Gate_SiteStateDto import org.eclipse.tractusx.bpdm.pool.api.model.LegalEntityClassificationDto as Pool_LegalEntityClassificationDto import org.eclipse.tractusx.bpdm.pool.api.model.LegalEntityDto as Pool_LegalEntityDto import org.eclipse.tractusx.bpdm.pool.api.model.LegalEntityIdentifierDto as Pool_LegalEntityIdentifierDto import org.eclipse.tractusx.bpdm.pool.api.model.LegalEntityStateDto as Pool_LegalEntityStateDto +import org.eclipse.tractusx.bpdm.pool.api.model.SiteStateDto as Pool_SiteStateDto fun gateToPoolLegalEntity(gateDto: Gate_LegalEntityDto): Pool_LegalEntityDto { return Pool_LegalEntityDto( @@ -73,6 +75,15 @@ fun gateToPoolLegalEntityClassification(gateDto: Gate_LegalEntityClassificationD ) } +fun gateToPoolSiteState(gateDto: Gate_SiteStateDto): Pool_SiteStateDto { + return Pool_SiteStateDto( + validFrom = gateDto.validFrom, + validTo = gateDto.validTo, + type = gateDto.type, + description = gateDto.description + ) +} + fun gateToPoolLogisticAddress(gateDto: LogisticAddressGateDto): LogisticAddressDto { return LogisticAddressDto( name = gateDto.nameParts.firstOrNull(), @@ -168,7 +179,7 @@ fun poolToGateLegalEntity(legalEntity: LegalEntityVerboseDto): Gate_LegalEntityD fun poolToGateSite(site: SiteVerboseDto): SiteGateDto { val states = site.states.map { - SiteStateDto( + Gate_SiteStateDto( description = it.description, validFrom = it.validFrom, validTo = it.validTo, diff --git a/bpdm-bridge-dummy/src/main/kotlin/com/catenax/bpdm/bridge/dummy/service/PoolUpdateService.kt b/bpdm-bridge-dummy/src/main/kotlin/com/catenax/bpdm/bridge/dummy/service/PoolUpdateService.kt index e3be3e397..3eba2769c 100644 --- a/bpdm-bridge-dummy/src/main/kotlin/com/catenax/bpdm/bridge/dummy/service/PoolUpdateService.kt +++ b/bpdm-bridge-dummy/src/main/kotlin/com/catenax/bpdm/bridge/dummy/service/PoolUpdateService.kt @@ -23,9 +23,9 @@ import com.catenax.bpdm.bridge.dummy.dto.* import mu.KotlinLogging import org.eclipse.tractusx.bpdm.common.dto.BusinessPartnerType import org.eclipse.tractusx.bpdm.common.dto.LogisticAddressDto -import org.eclipse.tractusx.bpdm.common.dto.SiteDto import org.eclipse.tractusx.bpdm.gate.api.client.GateClient import org.eclipse.tractusx.bpdm.pool.api.client.PoolApiClient +import org.eclipse.tractusx.bpdm.pool.api.model.SiteDto import org.eclipse.tractusx.bpdm.pool.api.model.request.* import org.eclipse.tractusx.bpdm.pool.api.model.response.* import org.springframework.stereotype.Service @@ -75,7 +75,7 @@ class PoolUpdateService( SitePartnerCreateRequest( site = SiteDto( name = entry.site.nameParts.firstOrNull() ?: "", - states = entry.site.states, + states = entry.site.states.map(::gateToPoolSiteState), mainAddress = gateToPoolLogisticAddress(entry.mainAddress), ), index = entry.externalId, @@ -99,7 +99,7 @@ class PoolUpdateService( SitePartnerUpdateRequest( site = SiteDto( name = it.site.nameParts.firstOrNull() ?: "", - states = it.site.states, + states = it.site.states.map(::gateToPoolSiteState), mainAddress = gateToPoolLogisticAddress(it.mainAddress), ), bpns = it.bpn!! diff --git a/bpdm-bridge-dummy/src/test/kotlin/com/catenax/bpdm/bridge/dummy/BridgeSyncIT.kt b/bpdm-bridge-dummy/src/test/kotlin/com/catenax/bpdm/bridge/dummy/BridgeSyncIT.kt index 90656abde..d4323d07e 100644 --- a/bpdm-bridge-dummy/src/test/kotlin/com/catenax/bpdm/bridge/dummy/BridgeSyncIT.kt +++ b/bpdm-bridge-dummy/src/test/kotlin/com/catenax/bpdm/bridge/dummy/BridgeSyncIT.kt @@ -30,7 +30,6 @@ import com.catenax.bpdm.bridge.dummy.util.TestHelpers import org.assertj.core.api.Assertions.assertThat import org.eclipse.tractusx.bpdm.common.dto.request.AddressPartnerBpnSearchRequest import org.eclipse.tractusx.bpdm.common.dto.request.PaginationRequest -import org.eclipse.tractusx.bpdm.common.dto.request.SiteBpnSearchRequest import org.eclipse.tractusx.bpdm.common.dto.response.LogisticAddressVerboseDto import org.eclipse.tractusx.bpdm.gate.api.client.GateClient import org.eclipse.tractusx.bpdm.gate.api.model.SharingStateType @@ -42,8 +41,9 @@ import org.eclipse.tractusx.bpdm.gate.api.model.response.SharingStateDto import org.eclipse.tractusx.bpdm.pool.api.client.PoolApiClient import org.eclipse.tractusx.bpdm.pool.api.model.request.ChangelogSearchRequest import org.eclipse.tractusx.bpdm.pool.api.model.request.LegalEntityPropertiesSearchRequest +import org.eclipse.tractusx.bpdm.pool.api.model.request.SiteBpnSearchRequest import org.eclipse.tractusx.bpdm.pool.api.model.response.LegalEntityMatchVerboseDto -import org.eclipse.tractusx.bpdm.pool.api.model.response.SitePoolVerboseDto +import org.eclipse.tractusx.bpdm.pool.api.model.response.SiteWithMainAddressVerboseDto import org.junit.jupiter.api.BeforeEach import org.junit.jupiter.api.Test import org.springframework.beans.factory.annotation.Autowired @@ -456,7 +456,7 @@ class BridgeSyncIT @Autowired constructor( assertThat(poolVersion.legalAddress.alternativePostalAddress?.city).isEqualTo(gateVersion.legalAddress.alternativePostalAddress?.city) } - private fun assertEqualSite(gateVersion: SiteGateInputRequest, poolVersion: SitePoolVerboseDto) { + private fun assertEqualSite(gateVersion: SiteGateInputRequest, poolVersion: SiteWithMainAddressVerboseDto) { assertThat(poolVersion.site.name).isEqualTo(gateVersion.site.nameParts.first()) assertThat(poolVersion.site.states.map { it.description }).isEqualTo(gateVersion.site.states.map { it.description }) assertThat(poolVersion.mainAddress.physicalPostalAddress.street?.name).isEqualTo(gateVersion.mainAddress.physicalPostalAddress.street?.name) diff --git a/bpdm-bridge-dummy/src/test/kotlin/com/catenax/bpdm/bridge/dummy/testdata/GateRequestValues.kt b/bpdm-bridge-dummy/src/test/kotlin/com/catenax/bpdm/bridge/dummy/testdata/GateRequestValues.kt index 578de7925..8b590970a 100644 --- a/bpdm-bridge-dummy/src/test/kotlin/com/catenax/bpdm/bridge/dummy/testdata/GateRequestValues.kt +++ b/bpdm-bridge-dummy/src/test/kotlin/com/catenax/bpdm/bridge/dummy/testdata/GateRequestValues.kt @@ -20,7 +20,6 @@ package com.catenax.bpdm.bridge.dummy.testdata import org.eclipse.tractusx.bpdm.common.dto.GeoCoordinateDto -import org.eclipse.tractusx.bpdm.common.dto.SiteStateDto import org.eclipse.tractusx.bpdm.gate.api.model.* import org.eclipse.tractusx.bpdm.gate.api.model.request.AddressGateInputRequest import org.eclipse.tractusx.bpdm.gate.api.model.request.LegalEntityGateInputRequest diff --git a/bpdm-common/src/main/kotlin/org/eclipse/tractusx/bpdm/common/dto/IBaseSiteDto.kt b/bpdm-common/src/main/kotlin/org/eclipse/tractusx/bpdm/common/dto/IBaseSiteDto.kt index b430de58b..34f3c22d8 100644 --- a/bpdm-common/src/main/kotlin/org/eclipse/tractusx/bpdm/common/dto/IBaseSiteDto.kt +++ b/bpdm-common/src/main/kotlin/org/eclipse/tractusx/bpdm/common/dto/IBaseSiteDto.kt @@ -30,7 +30,7 @@ interface IBaseSiteDto { val name: String? @get:ArraySchema(arraySchema = Schema(description = SiteDescription.states)) - val states: Collection + val states: Collection // TODO OpenAPI description for complex field does not work!! @get:Schema(description = SiteDescription.mainAddress) diff --git a/bpdm-common/src/main/kotlin/org/eclipse/tractusx/bpdm/common/dto/IBaseSiteStateDto.kt b/bpdm-common/src/main/kotlin/org/eclipse/tractusx/bpdm/common/dto/ISiteStateDto.kt similarity index 97% rename from bpdm-common/src/main/kotlin/org/eclipse/tractusx/bpdm/common/dto/IBaseSiteStateDto.kt rename to bpdm-common/src/main/kotlin/org/eclipse/tractusx/bpdm/common/dto/ISiteStateDto.kt index 58a385584..8119b602b 100644 --- a/bpdm-common/src/main/kotlin/org/eclipse/tractusx/bpdm/common/dto/IBaseSiteStateDto.kt +++ b/bpdm-common/src/main/kotlin/org/eclipse/tractusx/bpdm/common/dto/ISiteStateDto.kt @@ -26,7 +26,7 @@ import org.eclipse.tractusx.bpdm.common.model.BusinessStateType import java.time.LocalDateTime @Schema(description = SiteDescription.header) -interface IBaseSiteStateDto : IBaseStateDto { +interface ISiteStateDto : IBaseStateDto { @get:Schema(description = SiteStateDescription.description) override val description: String? diff --git a/bpdm-gate-api/src/main/kotlin/org/eclipse/tractusx/bpdm/gate/api/model/SiteGateDto.kt b/bpdm-gate-api/src/main/kotlin/org/eclipse/tractusx/bpdm/gate/api/model/SiteGateDto.kt index 6a90d4c77..760d40732 100644 --- a/bpdm-gate-api/src/main/kotlin/org/eclipse/tractusx/bpdm/gate/api/model/SiteGateDto.kt +++ b/bpdm-gate-api/src/main/kotlin/org/eclipse/tractusx/bpdm/gate/api/model/SiteGateDto.kt @@ -22,9 +22,10 @@ package org.eclipse.tractusx.bpdm.gate.api.model import io.swagger.v3.oas.annotations.media.ArraySchema import io.swagger.v3.oas.annotations.media.Schema import org.eclipse.tractusx.bpdm.common.dto.BusinessPartnerRole -import org.eclipse.tractusx.bpdm.common.dto.SiteStateDto import org.eclipse.tractusx.bpdm.common.dto.openapidescription.SiteDescription +// TODO: This DTO does not implement IBaseSiteDto because it is missing a [name] property. +// Removing this from IBaseSiteDto has lots of implications. And this DTO is only used in a deprecated API anyways! @Schema(description = SiteDescription.header) data class SiteGateDto( diff --git a/bpdm-common/src/main/kotlin/org/eclipse/tractusx/bpdm/common/dto/SiteStateDto.kt b/bpdm-gate-api/src/main/kotlin/org/eclipse/tractusx/bpdm/gate/api/model/SiteStateDto.kt similarity index 91% rename from bpdm-common/src/main/kotlin/org/eclipse/tractusx/bpdm/common/dto/SiteStateDto.kt rename to bpdm-gate-api/src/main/kotlin/org/eclipse/tractusx/bpdm/gate/api/model/SiteStateDto.kt index 3be145ddd..2fc7f57a5 100644 --- a/bpdm-common/src/main/kotlin/org/eclipse/tractusx/bpdm/common/dto/SiteStateDto.kt +++ b/bpdm-gate-api/src/main/kotlin/org/eclipse/tractusx/bpdm/gate/api/model/SiteStateDto.kt @@ -17,9 +17,10 @@ * SPDX-License-Identifier: Apache-2.0 ******************************************************************************/ -package org.eclipse.tractusx.bpdm.common.dto +package org.eclipse.tractusx.bpdm.gate.api.model import io.swagger.v3.oas.annotations.media.Schema +import org.eclipse.tractusx.bpdm.common.dto.ISiteStateDto import org.eclipse.tractusx.bpdm.common.dto.openapidescription.SiteStateDescription import org.eclipse.tractusx.bpdm.common.model.BusinessStateType import java.time.LocalDateTime @@ -28,10 +29,8 @@ import java.time.LocalDateTime data class SiteStateDto( override val description: String?, - override val validFrom: LocalDateTime?, - override val validTo: LocalDateTime?, - override val type: BusinessStateType -) : IBaseSiteStateDto \ No newline at end of file + +) : ISiteStateDto diff --git a/bpdm-orchestrator-api/src/main/kotlin/org/eclipse/tractusx/orchestrator/api/model/SiteStateDto.kt b/bpdm-orchestrator-api/src/main/kotlin/org/eclipse/tractusx/orchestrator/api/model/SiteStateDto.kt index af559658e..d6ba4512f 100644 --- a/bpdm-orchestrator-api/src/main/kotlin/org/eclipse/tractusx/orchestrator/api/model/SiteStateDto.kt +++ b/bpdm-orchestrator-api/src/main/kotlin/org/eclipse/tractusx/orchestrator/api/model/SiteStateDto.kt @@ -19,14 +19,15 @@ package org.eclipse.tractusx.orchestrator.api.model -import org.eclipse.tractusx.bpdm.common.dto.IBaseSiteStateDto +import org.eclipse.tractusx.bpdm.common.dto.ISiteStateDto import org.eclipse.tractusx.bpdm.common.model.BusinessStateType import java.time.LocalDateTime data class SiteStateDto( + override val description: String?, override val validFrom: LocalDateTime?, override val validTo: LocalDateTime?, override val type: BusinessStateType -) : IBaseSiteStateDto +) : ISiteStateDto diff --git a/bpdm-pool-api/src/main/kotlin/org/eclipse/tractusx/bpdm/pool/api/PoolLegalEntityApi.kt b/bpdm-pool-api/src/main/kotlin/org/eclipse/tractusx/bpdm/pool/api/PoolLegalEntityApi.kt index 2feef8180..095e1038f 100644 --- a/bpdm-pool-api/src/main/kotlin/org/eclipse/tractusx/bpdm/pool/api/PoolLegalEntityApi.kt +++ b/bpdm-pool-api/src/main/kotlin/org/eclipse/tractusx/bpdm/pool/api/PoolLegalEntityApi.kt @@ -29,7 +29,7 @@ import io.swagger.v3.oas.annotations.responses.ApiResponses import org.eclipse.tractusx.bpdm.common.dto.request.PaginationRequest import org.eclipse.tractusx.bpdm.common.dto.response.LogisticAddressVerboseDto import org.eclipse.tractusx.bpdm.common.dto.response.PageDto -import org.eclipse.tractusx.bpdm.common.dto.response.SiteVerboseDto +import org.eclipse.tractusx.bpdm.pool.api.model.SiteVerboseDto import org.eclipse.tractusx.bpdm.pool.api.model.request.LegalEntityPartnerCreateRequest import org.eclipse.tractusx.bpdm.pool.api.model.request.LegalEntityPartnerUpdateRequest import org.eclipse.tractusx.bpdm.pool.api.model.request.LegalEntityPropertiesSearchRequest diff --git a/bpdm-pool-api/src/main/kotlin/org/eclipse/tractusx/bpdm/pool/api/PoolSiteApi.kt b/bpdm-pool-api/src/main/kotlin/org/eclipse/tractusx/bpdm/pool/api/PoolSiteApi.kt index 2a169d2e8..753c1596e 100644 --- a/bpdm-pool-api/src/main/kotlin/org/eclipse/tractusx/bpdm/pool/api/PoolSiteApi.kt +++ b/bpdm-pool-api/src/main/kotlin/org/eclipse/tractusx/bpdm/pool/api/PoolSiteApi.kt @@ -26,8 +26,8 @@ import io.swagger.v3.oas.annotations.media.Content import io.swagger.v3.oas.annotations.responses.ApiResponse import io.swagger.v3.oas.annotations.responses.ApiResponses import org.eclipse.tractusx.bpdm.common.dto.request.PaginationRequest -import org.eclipse.tractusx.bpdm.common.dto.request.SiteBpnSearchRequest import org.eclipse.tractusx.bpdm.common.dto.response.PageDto +import org.eclipse.tractusx.bpdm.pool.api.model.request.SiteBpnSearchRequest import org.eclipse.tractusx.bpdm.pool.api.model.request.SitePartnerCreateRequest import org.eclipse.tractusx.bpdm.pool.api.model.request.SitePartnerUpdateRequest import org.eclipse.tractusx.bpdm.pool.api.model.response.* @@ -76,7 +76,7 @@ interface PoolSiteApi { @GetExchange("/{bpns}") fun getSite( @Parameter(description = "BPNS value") @PathVariable bpns: String - ): SitePoolVerboseDto + ): SiteWithMainAddressVerboseDto @Operation( summary = "Returns sites by an array of BPNS and/or an array of corresponding BPNL", @@ -93,7 +93,7 @@ interface PoolSiteApi { fun searchSites( @RequestBody siteSearchRequest: SiteBpnSearchRequest, @ParameterObject paginationRequest: PaginationRequest - ): PageDto + ): PageDto @Operation( summary = "Creates a new site", diff --git a/bpdm-common/src/main/kotlin/org/eclipse/tractusx/bpdm/common/dto/SiteDto.kt b/bpdm-pool-api/src/main/kotlin/org/eclipse/tractusx/bpdm/pool/api/model/SiteDto.kt similarity index 87% rename from bpdm-common/src/main/kotlin/org/eclipse/tractusx/bpdm/common/dto/SiteDto.kt rename to bpdm-pool-api/src/main/kotlin/org/eclipse/tractusx/bpdm/pool/api/model/SiteDto.kt index 3379a3871..193a89fe7 100644 --- a/bpdm-common/src/main/kotlin/org/eclipse/tractusx/bpdm/common/dto/SiteDto.kt +++ b/bpdm-pool-api/src/main/kotlin/org/eclipse/tractusx/bpdm/pool/api/model/SiteDto.kt @@ -17,18 +17,18 @@ * SPDX-License-Identifier: Apache-2.0 ******************************************************************************/ -package org.eclipse.tractusx.bpdm.common.dto +package org.eclipse.tractusx.bpdm.pool.api.model -import io.swagger.v3.oas.annotations.media.ArraySchema import io.swagger.v3.oas.annotations.media.Schema +import org.eclipse.tractusx.bpdm.common.dto.IBaseSiteDto +import org.eclipse.tractusx.bpdm.common.dto.LogisticAddressDto import org.eclipse.tractusx.bpdm.common.dto.openapidescription.SiteDescription @Schema(description = SiteDescription.header) data class SiteDto( override val name: String, - override val states: Collection = emptyList(), - override val mainAddress: LogisticAddressDto -) : IBaseSiteDto \ No newline at end of file + +) : IBaseSiteDto diff --git a/bpdm-pool-api/src/main/kotlin/org/eclipse/tractusx/bpdm/pool/api/model/SiteStateDto.kt b/bpdm-pool-api/src/main/kotlin/org/eclipse/tractusx/bpdm/pool/api/model/SiteStateDto.kt new file mode 100644 index 000000000..16a5972e8 --- /dev/null +++ b/bpdm-pool-api/src/main/kotlin/org/eclipse/tractusx/bpdm/pool/api/model/SiteStateDto.kt @@ -0,0 +1,36 @@ +/******************************************************************************* + * Copyright (c) 2021,2023 Contributors to the Eclipse Foundation + * + * See the NOTICE file(s) distributed with this work for additional + * information regarding copyright ownership. + * + * This program and the accompanying materials are made available under the + * terms of the Apache License, Version 2.0 which is available at + * https://www.apache.org/licenses/LICENSE-2.0. + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. + * + * SPDX-License-Identifier: Apache-2.0 + ******************************************************************************/ + +package org.eclipse.tractusx.bpdm.pool.api.model + +import io.swagger.v3.oas.annotations.media.Schema +import org.eclipse.tractusx.bpdm.common.dto.ISiteStateDto +import org.eclipse.tractusx.bpdm.common.dto.openapidescription.SiteStateDescription +import org.eclipse.tractusx.bpdm.common.model.BusinessStateType +import java.time.LocalDateTime + +@Schema(description = SiteStateDescription.header) +data class SiteStateDto( + + override val description: String?, + override val validFrom: LocalDateTime?, + override val validTo: LocalDateTime?, + override val type: BusinessStateType + +) : ISiteStateDto diff --git a/bpdm-common/src/main/kotlin/org/eclipse/tractusx/bpdm/common/dto/response/SiteStateVerboseDto.kt b/bpdm-pool-api/src/main/kotlin/org/eclipse/tractusx/bpdm/pool/api/model/SiteStateVerboseDto.kt similarity index 97% rename from bpdm-common/src/main/kotlin/org/eclipse/tractusx/bpdm/common/dto/response/SiteStateVerboseDto.kt rename to bpdm-pool-api/src/main/kotlin/org/eclipse/tractusx/bpdm/pool/api/model/SiteStateVerboseDto.kt index 2d66ab25c..38b629d27 100644 --- a/bpdm-common/src/main/kotlin/org/eclipse/tractusx/bpdm/common/dto/response/SiteStateVerboseDto.kt +++ b/bpdm-pool-api/src/main/kotlin/org/eclipse/tractusx/bpdm/pool/api/model/SiteStateVerboseDto.kt @@ -17,7 +17,7 @@ * SPDX-License-Identifier: Apache-2.0 ******************************************************************************/ -package org.eclipse.tractusx.bpdm.common.dto.response +package org.eclipse.tractusx.bpdm.pool.api.model import io.swagger.v3.oas.annotations.media.Schema import org.eclipse.tractusx.bpdm.common.dto.openapidescription.SiteStateDescription diff --git a/bpdm-common/src/main/kotlin/org/eclipse/tractusx/bpdm/common/dto/response/SiteVerboseDto.kt b/bpdm-pool-api/src/main/kotlin/org/eclipse/tractusx/bpdm/pool/api/model/SiteVerboseDto.kt similarity index 97% rename from bpdm-common/src/main/kotlin/org/eclipse/tractusx/bpdm/common/dto/response/SiteVerboseDto.kt rename to bpdm-pool-api/src/main/kotlin/org/eclipse/tractusx/bpdm/pool/api/model/SiteVerboseDto.kt index bb882b783..dfb468cd6 100644 --- a/bpdm-common/src/main/kotlin/org/eclipse/tractusx/bpdm/common/dto/response/SiteVerboseDto.kt +++ b/bpdm-pool-api/src/main/kotlin/org/eclipse/tractusx/bpdm/pool/api/model/SiteVerboseDto.kt @@ -17,7 +17,7 @@ * SPDX-License-Identifier: Apache-2.0 ******************************************************************************/ -package org.eclipse.tractusx.bpdm.common.dto.response +package org.eclipse.tractusx.bpdm.pool.api.model import io.swagger.v3.oas.annotations.media.ArraySchema import io.swagger.v3.oas.annotations.media.Schema diff --git a/bpdm-common/src/main/kotlin/org/eclipse/tractusx/bpdm/common/dto/request/SiteBpnSearchRequest.kt b/bpdm-pool-api/src/main/kotlin/org/eclipse/tractusx/bpdm/pool/api/model/request/SiteBpnSearchRequest.kt similarity index 95% rename from bpdm-common/src/main/kotlin/org/eclipse/tractusx/bpdm/common/dto/request/SiteBpnSearchRequest.kt rename to bpdm-pool-api/src/main/kotlin/org/eclipse/tractusx/bpdm/pool/api/model/request/SiteBpnSearchRequest.kt index 660ca0355..301e3471a 100644 --- a/bpdm-common/src/main/kotlin/org/eclipse/tractusx/bpdm/common/dto/request/SiteBpnSearchRequest.kt +++ b/bpdm-pool-api/src/main/kotlin/org/eclipse/tractusx/bpdm/pool/api/model/request/SiteBpnSearchRequest.kt @@ -17,13 +17,15 @@ * SPDX-License-Identifier: Apache-2.0 ******************************************************************************/ -package org.eclipse.tractusx.bpdm.common.dto.request +package org.eclipse.tractusx.bpdm.pool.api.model.request import io.swagger.v3.oas.annotations.media.Schema data class SiteBpnSearchRequest( + @Schema(description = "Filter sites that should belong to legal entities (specified by BPNL)") val legalEntities: Collection = emptyList(), + @Schema(description = "Filter sites by BPNS of sites") val sites: Collection = emptyList(), ) diff --git a/bpdm-pool-api/src/main/kotlin/org/eclipse/tractusx/bpdm/pool/api/model/request/SitePartnerCreateRequest.kt b/bpdm-pool-api/src/main/kotlin/org/eclipse/tractusx/bpdm/pool/api/model/request/SitePartnerCreateRequest.kt index c57b9615c..bc0e15d20 100644 --- a/bpdm-pool-api/src/main/kotlin/org/eclipse/tractusx/bpdm/pool/api/model/request/SitePartnerCreateRequest.kt +++ b/bpdm-pool-api/src/main/kotlin/org/eclipse/tractusx/bpdm/pool/api/model/request/SitePartnerCreateRequest.kt @@ -23,10 +23,10 @@ import com.fasterxml.jackson.annotation.JsonUnwrapped import com.fasterxml.jackson.databind.annotation.JsonDeserialize import io.swagger.v3.oas.annotations.media.Schema import org.eclipse.tractusx.bpdm.common.dto.RequestWithKey -import org.eclipse.tractusx.bpdm.common.dto.SiteDto import org.eclipse.tractusx.bpdm.common.dto.openapidescription.CommonDescription import org.eclipse.tractusx.bpdm.common.dto.openapidescription.SiteDescription import org.eclipse.tractusx.bpdm.common.service.DataClassUnwrappedJsonDeserializer +import org.eclipse.tractusx.bpdm.pool.api.model.SiteDto @JsonDeserialize(using = DataClassUnwrappedJsonDeserializer::class) @Schema(description = SiteDescription.headerCreateRequest) @@ -40,6 +40,7 @@ data class SitePartnerCreateRequest( @Schema(description = CommonDescription.index) val index: String? + ) : RequestWithKey { override fun getRequestKey(): String? { return index diff --git a/bpdm-pool-api/src/main/kotlin/org/eclipse/tractusx/bpdm/pool/api/model/request/SitePartnerUpdateRequest.kt b/bpdm-pool-api/src/main/kotlin/org/eclipse/tractusx/bpdm/pool/api/model/request/SitePartnerUpdateRequest.kt index a48f73c60..c53f1951b 100644 --- a/bpdm-pool-api/src/main/kotlin/org/eclipse/tractusx/bpdm/pool/api/model/request/SitePartnerUpdateRequest.kt +++ b/bpdm-pool-api/src/main/kotlin/org/eclipse/tractusx/bpdm/pool/api/model/request/SitePartnerUpdateRequest.kt @@ -23,9 +23,9 @@ import com.fasterxml.jackson.annotation.JsonUnwrapped import com.fasterxml.jackson.databind.annotation.JsonDeserialize import io.swagger.v3.oas.annotations.media.Schema import org.eclipse.tractusx.bpdm.common.dto.RequestWithKey -import org.eclipse.tractusx.bpdm.common.dto.SiteDto import org.eclipse.tractusx.bpdm.common.dto.openapidescription.SiteDescription import org.eclipse.tractusx.bpdm.common.service.DataClassUnwrappedJsonDeserializer +import org.eclipse.tractusx.bpdm.pool.api.model.SiteDto @JsonDeserialize(using = DataClassUnwrappedJsonDeserializer::class) @Schema(description = SiteDescription.headerUpdateRequest) @@ -36,8 +36,9 @@ data class SitePartnerUpdateRequest( @field:JsonUnwrapped val site: SiteDto + ): RequestWithKey { - override fun getRequestKey(): String? { + override fun getRequestKey(): String { return bpns } } diff --git a/bpdm-pool-api/src/main/kotlin/org/eclipse/tractusx/bpdm/pool/api/model/response/SiteMatchVerboseDto.kt b/bpdm-pool-api/src/main/kotlin/org/eclipse/tractusx/bpdm/pool/api/model/response/SiteMatchVerboseDto.kt index 40e209889..d137012fb 100644 --- a/bpdm-pool-api/src/main/kotlin/org/eclipse/tractusx/bpdm/pool/api/model/response/SiteMatchVerboseDto.kt +++ b/bpdm-pool-api/src/main/kotlin/org/eclipse/tractusx/bpdm/pool/api/model/response/SiteMatchVerboseDto.kt @@ -23,8 +23,8 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize import io.swagger.v3.oas.annotations.media.Schema import org.eclipse.tractusx.bpdm.common.dto.openapidescription.SiteDescription import org.eclipse.tractusx.bpdm.common.dto.response.LogisticAddressVerboseDto -import org.eclipse.tractusx.bpdm.common.dto.response.SiteVerboseDto import org.eclipse.tractusx.bpdm.common.service.DataClassUnwrappedJsonDeserializer +import org.eclipse.tractusx.bpdm.pool.api.model.SiteVerboseDto @JsonDeserialize(using = DataClassUnwrappedJsonDeserializer::class) @Schema(description = SiteDescription.headerMatchResponse) diff --git a/bpdm-pool-api/src/main/kotlin/org/eclipse/tractusx/bpdm/pool/api/model/response/SitePartnerCreateVerboseDto.kt b/bpdm-pool-api/src/main/kotlin/org/eclipse/tractusx/bpdm/pool/api/model/response/SitePartnerCreateVerboseDto.kt index 7b54adac3..10e0ac041 100644 --- a/bpdm-pool-api/src/main/kotlin/org/eclipse/tractusx/bpdm/pool/api/model/response/SitePartnerCreateVerboseDto.kt +++ b/bpdm-pool-api/src/main/kotlin/org/eclipse/tractusx/bpdm/pool/api/model/response/SitePartnerCreateVerboseDto.kt @@ -25,8 +25,8 @@ import io.swagger.v3.oas.annotations.media.Schema import org.eclipse.tractusx.bpdm.common.dto.openapidescription.CommonDescription import org.eclipse.tractusx.bpdm.common.dto.openapidescription.SiteDescription import org.eclipse.tractusx.bpdm.common.dto.response.LogisticAddressVerboseDto -import org.eclipse.tractusx.bpdm.common.dto.response.SiteVerboseDto import org.eclipse.tractusx.bpdm.common.service.DataClassUnwrappedJsonDeserializer +import org.eclipse.tractusx.bpdm.pool.api.model.SiteVerboseDto @JsonDeserialize(using = DataClassUnwrappedJsonDeserializer::class) @Schema(description = SiteDescription.headerUpsertResponse) diff --git a/bpdm-pool-api/src/main/kotlin/org/eclipse/tractusx/bpdm/pool/api/model/response/SitePoolVerboseDto.kt b/bpdm-pool-api/src/main/kotlin/org/eclipse/tractusx/bpdm/pool/api/model/response/SiteWithMainAddressVerboseDto.kt similarity index 94% rename from bpdm-pool-api/src/main/kotlin/org/eclipse/tractusx/bpdm/pool/api/model/response/SitePoolVerboseDto.kt rename to bpdm-pool-api/src/main/kotlin/org/eclipse/tractusx/bpdm/pool/api/model/response/SiteWithMainAddressVerboseDto.kt index e96280de4..1c8c4a416 100644 --- a/bpdm-pool-api/src/main/kotlin/org/eclipse/tractusx/bpdm/pool/api/model/response/SitePoolVerboseDto.kt +++ b/bpdm-pool-api/src/main/kotlin/org/eclipse/tractusx/bpdm/pool/api/model/response/SiteWithMainAddressVerboseDto.kt @@ -24,12 +24,12 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize import io.swagger.v3.oas.annotations.media.Schema import org.eclipse.tractusx.bpdm.common.dto.openapidescription.SiteDescription import org.eclipse.tractusx.bpdm.common.dto.response.LogisticAddressVerboseDto -import org.eclipse.tractusx.bpdm.common.dto.response.SiteVerboseDto import org.eclipse.tractusx.bpdm.common.service.DataClassUnwrappedJsonDeserializer +import org.eclipse.tractusx.bpdm.pool.api.model.SiteVerboseDto @JsonDeserialize(using = DataClassUnwrappedJsonDeserializer::class) @Schema(description = SiteDescription.header) -data class SitePoolVerboseDto( +data class SiteWithMainAddressVerboseDto( @field:JsonUnwrapped val site: SiteVerboseDto, diff --git a/bpdm-pool/src/main/kotlin/org/eclipse/tractusx/bpdm/pool/controller/LegalEntityController.kt b/bpdm-pool/src/main/kotlin/org/eclipse/tractusx/bpdm/pool/controller/LegalEntityController.kt index 2b677c3c7..697ad6937 100644 --- a/bpdm-pool/src/main/kotlin/org/eclipse/tractusx/bpdm/pool/controller/LegalEntityController.kt +++ b/bpdm-pool/src/main/kotlin/org/eclipse/tractusx/bpdm/pool/controller/LegalEntityController.kt @@ -22,8 +22,8 @@ package org.eclipse.tractusx.bpdm.pool.controller import org.eclipse.tractusx.bpdm.common.dto.request.PaginationRequest import org.eclipse.tractusx.bpdm.common.dto.response.LogisticAddressVerboseDto import org.eclipse.tractusx.bpdm.common.dto.response.PageDto -import org.eclipse.tractusx.bpdm.common.dto.response.SiteVerboseDto import org.eclipse.tractusx.bpdm.pool.api.PoolLegalEntityApi +import org.eclipse.tractusx.bpdm.pool.api.model.SiteVerboseDto import org.eclipse.tractusx.bpdm.pool.api.model.request.BusinessPartnerSearchRequest import org.eclipse.tractusx.bpdm.pool.api.model.request.LegalEntityPartnerCreateRequest import org.eclipse.tractusx.bpdm.pool.api.model.request.LegalEntityPartnerUpdateRequest @@ -31,7 +31,6 @@ import org.eclipse.tractusx.bpdm.pool.api.model.request.LegalEntityPropertiesSea import org.eclipse.tractusx.bpdm.pool.api.model.response.* import org.eclipse.tractusx.bpdm.pool.config.BpnConfigProperties import org.eclipse.tractusx.bpdm.pool.config.ControllerConfigProperties -import org.eclipse.tractusx.bpdm.pool.config.PoolSecurityConfigProperties import org.eclipse.tractusx.bpdm.pool.service.* import org.springframework.http.HttpStatus import org.springframework.http.ResponseEntity @@ -46,8 +45,7 @@ class LegalEntityController( val bpnConfigProperties: BpnConfigProperties, val controllerConfigProperties: ControllerConfigProperties, val siteService: SiteService, - val addressService: AddressService, - val poolSecurityConfigProperties: PoolSecurityConfigProperties + val addressService: AddressService ) : PoolLegalEntityApi { @PreAuthorize("hasAuthority(@poolSecurityConfigProperties.getReadPoolPartnerDataAsRole())") diff --git a/bpdm-pool/src/main/kotlin/org/eclipse/tractusx/bpdm/pool/controller/SiteController.kt b/bpdm-pool/src/main/kotlin/org/eclipse/tractusx/bpdm/pool/controller/SiteController.kt index 51ecf96d3..0b96d84af 100644 --- a/bpdm-pool/src/main/kotlin/org/eclipse/tractusx/bpdm/pool/controller/SiteController.kt +++ b/bpdm-pool/src/main/kotlin/org/eclipse/tractusx/bpdm/pool/controller/SiteController.kt @@ -20,14 +20,13 @@ package org.eclipse.tractusx.bpdm.pool.controller import org.eclipse.tractusx.bpdm.common.dto.request.PaginationRequest -import org.eclipse.tractusx.bpdm.common.dto.request.SiteBpnSearchRequest import org.eclipse.tractusx.bpdm.common.dto.response.PageDto import org.eclipse.tractusx.bpdm.pool.api.PoolSiteApi import org.eclipse.tractusx.bpdm.pool.api.model.request.* import org.eclipse.tractusx.bpdm.pool.api.model.response.* -import org.eclipse.tractusx.bpdm.pool.service.SearchService import org.eclipse.tractusx.bpdm.pool.service.AddressService import org.eclipse.tractusx.bpdm.pool.service.BusinessPartnerBuildService +import org.eclipse.tractusx.bpdm.pool.service.SearchService import org.eclipse.tractusx.bpdm.pool.service.SiteService import org.springframework.security.access.prepost.PreAuthorize import org.springframework.web.bind.annotation.RestController @@ -50,7 +49,7 @@ class SiteController( @PreAuthorize("hasAuthority(@poolSecurityConfigProperties.getReadPoolPartnerDataAsRole())") override fun getSite( bpns: String - ): SitePoolVerboseDto { + ): SiteWithMainAddressVerboseDto { return siteService.findByBpn(bpns.uppercase()) } @@ -58,7 +57,7 @@ class SiteController( override fun searchSites( siteSearchRequest: SiteBpnSearchRequest, paginationRequest: PaginationRequest - ): PageDto { + ): PageDto { return siteService.findByPartnerBpns(siteSearchRequest, paginationRequest) } diff --git a/bpdm-pool/src/main/kotlin/org/eclipse/tractusx/bpdm/pool/service/BusinessPartnerBuildService.kt b/bpdm-pool/src/main/kotlin/org/eclipse/tractusx/bpdm/pool/service/BusinessPartnerBuildService.kt index 2718441be..9a491bc59 100644 --- a/bpdm-pool/src/main/kotlin/org/eclipse/tractusx/bpdm/pool/service/BusinessPartnerBuildService.kt +++ b/bpdm-pool/src/main/kotlin/org/eclipse/tractusx/bpdm/pool/service/BusinessPartnerBuildService.kt @@ -405,7 +405,7 @@ class BusinessPartnerBuildService( ) } - fun toSiteState(dto: IBaseSiteStateDto, site: Site): SiteState { + fun toSiteState(dto: ISiteStateDto, site: Site): SiteState { return SiteState( description = dto.description, validFrom = dto.validFrom, diff --git a/bpdm-pool/src/main/kotlin/org/eclipse/tractusx/bpdm/pool/service/ResponseMappings.kt b/bpdm-pool/src/main/kotlin/org/eclipse/tractusx/bpdm/pool/service/ResponseMappings.kt index a5b7d1f7b..93e90b7a2 100644 --- a/bpdm-pool/src/main/kotlin/org/eclipse/tractusx/bpdm/pool/service/ResponseMappings.kt +++ b/bpdm-pool/src/main/kotlin/org/eclipse/tractusx/bpdm/pool/service/ResponseMappings.kt @@ -223,8 +223,8 @@ fun Site.toDto(): SiteVerboseDto { ) } -fun Site.toPoolDto(): SitePoolVerboseDto { - return SitePoolVerboseDto( +fun Site.toPoolDto(): SiteWithMainAddressVerboseDto { + return SiteWithMainAddressVerboseDto( site = SiteVerboseDto( bpn, diff --git a/bpdm-pool/src/main/kotlin/org/eclipse/tractusx/bpdm/pool/service/SiteService.kt b/bpdm-pool/src/main/kotlin/org/eclipse/tractusx/bpdm/pool/service/SiteService.kt index efe5883a3..1cd0c3835 100644 --- a/bpdm-pool/src/main/kotlin/org/eclipse/tractusx/bpdm/pool/service/SiteService.kt +++ b/bpdm-pool/src/main/kotlin/org/eclipse/tractusx/bpdm/pool/service/SiteService.kt @@ -21,11 +21,11 @@ package org.eclipse.tractusx.bpdm.pool.service import mu.KotlinLogging import org.eclipse.tractusx.bpdm.common.dto.request.PaginationRequest -import org.eclipse.tractusx.bpdm.common.dto.request.SiteBpnSearchRequest import org.eclipse.tractusx.bpdm.common.dto.response.PageDto -import org.eclipse.tractusx.bpdm.common.dto.response.SiteVerboseDto import org.eclipse.tractusx.bpdm.common.exception.BpdmNotFoundException -import org.eclipse.tractusx.bpdm.pool.api.model.response.SitePoolVerboseDto +import org.eclipse.tractusx.bpdm.pool.api.model.SiteVerboseDto +import org.eclipse.tractusx.bpdm.pool.api.model.request.SiteBpnSearchRequest +import org.eclipse.tractusx.bpdm.pool.api.model.response.SiteWithMainAddressVerboseDto import org.eclipse.tractusx.bpdm.pool.entity.Site import org.eclipse.tractusx.bpdm.pool.repository.LegalEntityRepository import org.eclipse.tractusx.bpdm.pool.repository.SiteRepository @@ -51,7 +51,7 @@ class SiteService( return page.toDto(page.content.map { it.toDto() }) } - fun findByPartnerBpns(siteSearchRequest: SiteBpnSearchRequest, paginationRequest: PaginationRequest): PageDto { + fun findByPartnerBpns(siteSearchRequest: SiteBpnSearchRequest, paginationRequest: PaginationRequest): PageDto { logger.debug { "Executing findByPartnerBpns() with parameters $siteSearchRequest // $paginationRequest" } val partners = if (siteSearchRequest.legalEntities.isNotEmpty()) legalEntityRepository.findDistinctByBpnIn(siteSearchRequest.legalEntities) else emptyList() @@ -61,7 +61,7 @@ class SiteService( return sitePage.toDto(sitePage.content.map { it.toPoolDto() }) } - fun findByBpn(bpn: String): SitePoolVerboseDto { + fun findByBpn(bpn: String): SiteWithMainAddressVerboseDto { logger.debug { "Executing findByBpn() with parameters $bpn " } val site = siteRepository.findByBpn(bpn) ?: throw BpdmNotFoundException("Site", bpn) return site.toPoolDto() diff --git a/bpdm-pool/src/test/kotlin/org/eclipse/tractusx/bpdm/pool/controller/SiteControllerIT.kt b/bpdm-pool/src/test/kotlin/org/eclipse/tractusx/bpdm/pool/controller/SiteControllerIT.kt index db667cce8..ca2e111fc 100644 --- a/bpdm-pool/src/test/kotlin/org/eclipse/tractusx/bpdm/pool/controller/SiteControllerIT.kt +++ b/bpdm-pool/src/test/kotlin/org/eclipse/tractusx/bpdm/pool/controller/SiteControllerIT.kt @@ -22,14 +22,14 @@ package org.eclipse.tractusx.bpdm.pool.controller import org.assertj.core.api.Assertions.assertThat import org.eclipse.tractusx.bpdm.common.dto.IdentifierBusinessPartnerType import org.eclipse.tractusx.bpdm.common.dto.IdentifierTypeDto -import org.eclipse.tractusx.bpdm.common.dto.SiteDto import org.eclipse.tractusx.bpdm.common.dto.request.PaginationRequest -import org.eclipse.tractusx.bpdm.common.dto.request.SiteBpnSearchRequest import org.eclipse.tractusx.bpdm.common.dto.response.LogisticAddressVerboseDto import org.eclipse.tractusx.bpdm.common.dto.response.PageDto -import org.eclipse.tractusx.bpdm.common.dto.response.SiteVerboseDto import org.eclipse.tractusx.bpdm.pool.Application import org.eclipse.tractusx.bpdm.pool.api.client.PoolClientImpl +import org.eclipse.tractusx.bpdm.pool.api.model.SiteDto +import org.eclipse.tractusx.bpdm.pool.api.model.SiteVerboseDto +import org.eclipse.tractusx.bpdm.pool.api.model.request.SiteBpnSearchRequest import org.eclipse.tractusx.bpdm.pool.api.model.response.* import org.eclipse.tractusx.bpdm.pool.util.* import org.junit.jupiter.api.BeforeEach @@ -109,11 +109,11 @@ class SiteControllerIT @Autowired constructor( val siteSearchRequest = SiteBpnSearchRequest(emptyList(), listOf(bpnS1, bpnS2)) val searchResult = poolClient.sites.searchSites(siteSearchRequest, PaginationRequest()) - val expectedSiteWithReference1 = SitePoolVerboseDto( + val expectedSiteWithReference1 = SiteWithMainAddressVerboseDto( site = BusinessPartnerVerboseValues.site1.copy(bpnLegalEntity = bpnL), mainAddress = BusinessPartnerVerboseValues.addressPartner1.copy(isMainAddress = true, bpnSite = BusinessPartnerVerboseValues.site1.bpns) ) - val expectedSiteWithReference2 = SitePoolVerboseDto( + val expectedSiteWithReference2 = SiteWithMainAddressVerboseDto( site = BusinessPartnerVerboseValues.site2.copy(bpnLegalEntity = bpnL), mainAddress = BusinessPartnerVerboseValues.addressPartner2.copy(isMainAddress = true, bpnSite = BusinessPartnerVerboseValues.site2.bpns) ) @@ -121,7 +121,7 @@ class SiteControllerIT @Autowired constructor( testHelpers.assertRecursively(searchResult.content) .ignoringFieldsOfTypes(Instant::class.java) .ignoringFields( - SitePoolVerboseDto::mainAddress.name + "." + LogisticAddressVerboseDto::bpna.name, + SiteWithMainAddressVerboseDto::mainAddress.name + "." + LogisticAddressVerboseDto::bpna.name, ) .isEqualTo(listOf(expectedSiteWithReference1, expectedSiteWithReference2)) } @@ -156,17 +156,17 @@ class SiteControllerIT @Autowired constructor( val searchResult = poolClient.sites.searchSites(siteSearchRequest, PaginationRequest()) val expectedSiteWithReference1 = - SitePoolVerboseDto( + SiteWithMainAddressVerboseDto( site = BusinessPartnerVerboseValues.site1.copy(bpnLegalEntity = bpnL1), mainAddress = BusinessPartnerVerboseValues.addressPartner1.copy(isMainAddress = true, bpnSite = BusinessPartnerVerboseValues.site1.bpns) ) val expectedSiteWithReference2 = - SitePoolVerboseDto( + SiteWithMainAddressVerboseDto( site = BusinessPartnerVerboseValues.site2.copy(bpnLegalEntity = bpnL1), mainAddress = BusinessPartnerVerboseValues.addressPartner2.copy(isMainAddress = true, bpnSite = BusinessPartnerVerboseValues.site2.bpns) ) val expectedSiteWithReference3 = - SitePoolVerboseDto( + SiteWithMainAddressVerboseDto( site = BusinessPartnerVerboseValues.site3.copy(bpnLegalEntity = bpnL2), mainAddress = BusinessPartnerVerboseValues.addressPartner3.copy(isMainAddress = true, bpnSite = BusinessPartnerVerboseValues.site3.bpns) ) @@ -174,7 +174,7 @@ class SiteControllerIT @Autowired constructor( testHelpers.assertRecursively(searchResult.content) .ignoringFieldsOfTypes(Instant::class.java) .ignoringFields( - SitePoolVerboseDto::mainAddress.name + "." + LogisticAddressVerboseDto::bpna.name, + SiteWithMainAddressVerboseDto::mainAddress.name + "." + LogisticAddressVerboseDto::bpna.name, ) .isEqualTo(listOf(expectedSiteWithReference1, expectedSiteWithReference2, expectedSiteWithReference3)) } diff --git a/bpdm-pool/src/test/kotlin/org/eclipse/tractusx/bpdm/pool/service/TaskStepFetchAndReserveServiceTest.kt b/bpdm-pool/src/test/kotlin/org/eclipse/tractusx/bpdm/pool/service/TaskStepFetchAndReserveServiceTest.kt index 854da2934..926f4f7d9 100644 --- a/bpdm-pool/src/test/kotlin/org/eclipse/tractusx/bpdm/pool/service/TaskStepFetchAndReserveServiceTest.kt +++ b/bpdm-pool/src/test/kotlin/org/eclipse/tractusx/bpdm/pool/service/TaskStepFetchAndReserveServiceTest.kt @@ -3,8 +3,8 @@ package org.eclipse.tractusx.bpdm.pool.service import com.neovisionaries.i18n.CountryCode import org.assertj.core.api.Assertions.assertThat import org.eclipse.tractusx.bpdm.common.dto.GeoCoordinateDto -import org.eclipse.tractusx.bpdm.common.dto.IBaseSiteStateDto import org.eclipse.tractusx.bpdm.common.dto.ILegalEntityStateDto +import org.eclipse.tractusx.bpdm.common.dto.ISiteStateDto import org.eclipse.tractusx.bpdm.common.dto.response.* import org.eclipse.tractusx.bpdm.common.dto.response.type.TypeKeyNameVerboseDto import org.eclipse.tractusx.bpdm.common.model.BusinessStateType @@ -15,8 +15,9 @@ import org.eclipse.tractusx.bpdm.pool.api.client.PoolClientImpl import org.eclipse.tractusx.bpdm.pool.api.model.LegalEntityClassificationVerboseDto import org.eclipse.tractusx.bpdm.pool.api.model.LegalEntityIdentifierVerboseDto import org.eclipse.tractusx.bpdm.pool.api.model.LegalEntityStateVerboseDto +import org.eclipse.tractusx.bpdm.pool.api.model.SiteStateVerboseDto import org.eclipse.tractusx.bpdm.pool.api.model.response.LegalEntityWithLegalAddressVerboseDto -import org.eclipse.tractusx.bpdm.pool.api.model.response.SitePoolVerboseDto +import org.eclipse.tractusx.bpdm.pool.api.model.response.SiteWithMainAddressVerboseDto import org.eclipse.tractusx.bpdm.pool.repository.BpnRequestIdentifierRepository import org.eclipse.tractusx.bpdm.pool.service.TaskStepBuildService.CleaningError import org.eclipse.tractusx.bpdm.pool.util.BusinessPartnerNonVerboseValues.addressIdentifierTypeDto1 @@ -1244,7 +1245,7 @@ class TaskStepFetchAndReserveServiceTest @Autowired constructor( compareLogisticAddress(verboseLegalAddress, legalEntity?.legalAddress) } - fun compareSite(verboseRequest: SitePoolVerboseDto, site: SiteDto?) { + fun compareSite(verboseRequest: SiteWithMainAddressVerboseDto, site: SiteDto?) { val verboseSite = verboseRequest.site @@ -1324,7 +1325,7 @@ class TaskStepFetchAndReserveServiceTest @Autowired constructor( } } - fun compareSiteStates(statesVerbose: Collection, states: Collection?) { + fun compareSiteStates(statesVerbose: Collection, states: Collection?) { assertThat(statesVerbose.size).isEqualTo(states?.size ?: 0) val sortedVerboseStates = statesVerbose.sortedBy { it.description } @@ -1332,9 +1333,9 @@ class TaskStepFetchAndReserveServiceTest @Autowired constructor( sortedVerboseStates.indices.forEach { assertThat(sortedVerboseStates[it].type.technicalKey.name).isEqualTo(sortedStates[it].type.name) assertThat(sortedVerboseStates[it]).usingRecursiveComparison() - .withEqualsForFields(isEqualToIgnoringMilliseconds(), IBaseSiteStateDto::validTo.name ) - .withEqualsForFields(isEqualToIgnoringMilliseconds(), IBaseSiteStateDto::validFrom.name) - .ignoringFields(IBaseSiteStateDto::type.name) + .withEqualsForFields(isEqualToIgnoringMilliseconds(), ISiteStateDto::validTo.name) + .withEqualsForFields(isEqualToIgnoringMilliseconds(), ISiteStateDto::validFrom.name) + .ignoringFields(ISiteStateDto::type.name) .isEqualTo(sortedStates[it]) } } diff --git a/bpdm-pool/src/test/kotlin/org/eclipse/tractusx/bpdm/pool/util/BusinessPartnerNonVerboseValues.kt b/bpdm-pool/src/test/kotlin/org/eclipse/tractusx/bpdm/pool/util/BusinessPartnerNonVerboseValues.kt index fc7143499..81c700cb1 100644 --- a/bpdm-pool/src/test/kotlin/org/eclipse/tractusx/bpdm/pool/util/BusinessPartnerNonVerboseValues.kt +++ b/bpdm-pool/src/test/kotlin/org/eclipse/tractusx/bpdm/pool/util/BusinessPartnerNonVerboseValues.kt @@ -20,10 +20,7 @@ package org.eclipse.tractusx.bpdm.pool.util import org.eclipse.tractusx.bpdm.common.dto.* -import org.eclipse.tractusx.bpdm.pool.api.model.LegalEntityClassificationDto -import org.eclipse.tractusx.bpdm.pool.api.model.LegalEntityDto -import org.eclipse.tractusx.bpdm.pool.api.model.LegalEntityIdentifierDto -import org.eclipse.tractusx.bpdm.pool.api.model.LegalEntityStateDto +import org.eclipse.tractusx.bpdm.pool.api.model.* import org.eclipse.tractusx.bpdm.pool.api.model.request.* object BusinessPartnerNonVerboseValues { diff --git a/bpdm-pool/src/test/kotlin/org/eclipse/tractusx/bpdm/pool/util/BusinessPartnerVerboseValues.kt b/bpdm-pool/src/test/kotlin/org/eclipse/tractusx/bpdm/pool/util/BusinessPartnerVerboseValues.kt index 8c0e58bc8..bfc1f5c99 100644 --- a/bpdm-pool/src/test/kotlin/org/eclipse/tractusx/bpdm/pool/util/BusinessPartnerVerboseValues.kt +++ b/bpdm-pool/src/test/kotlin/org/eclipse/tractusx/bpdm/pool/util/BusinessPartnerVerboseValues.kt @@ -24,8 +24,6 @@ import com.neovisionaries.i18n.LanguageCode import org.eclipse.tractusx.bpdm.common.dto.StreetDto import org.eclipse.tractusx.bpdm.common.dto.response.LogisticAddressVerboseDto import org.eclipse.tractusx.bpdm.common.dto.response.PhysicalPostalAddressVerboseDto -import org.eclipse.tractusx.bpdm.common.dto.response.SiteStateVerboseDto -import org.eclipse.tractusx.bpdm.common.dto.response.SiteVerboseDto import org.eclipse.tractusx.bpdm.common.dto.response.type.TypeKeyNameVerboseDto import org.eclipse.tractusx.bpdm.common.model.BusinessStateType import org.eclipse.tractusx.bpdm.common.model.ClassificationType From 77ef4d235c33b5d25da52a5515f58e1b52758aea Mon Sep 17 00:00:00 2001 From: Martin Kaeser Date: Wed, 6 Dec 2023 14:42:39 +0100 Subject: [PATCH 2/3] refactor(DTO): Restructure LogisticAddressDto/LogisticAddressVerboseDto --- .../bridge/dummy/dto/DtoConversionHelper.kt | 83 ++++++++++++------- .../bpdm/bridge/dummy/dto/GateAddressInfo.kt | 4 +- .../bpdm/bridge/dummy/dto/GateSiteInfo.kt | 4 +- .../bridge/dummy/service/GateUpdateService.kt | 2 +- .../bridge/dummy/service/PoolUpdateService.kt | 10 +-- .../catenax/bpdm/bridge/dummy/BridgeSyncIT.kt | 12 +-- .../dummy/testdata/GateRequestValues.kt | 30 +++---- ...ntifierDto.kt => IAddressIdentifierDto.kt} | 5 +- ...AddressStateDto.kt => IAddressStateDto.kt} | 2 +- .../common/dto/IBaseLogisticAddressDto.kt | 7 +- .../model/AddressGateOutputChildRequest.kt | 2 +- .../gate/api/model}/AddressIdentifierDto.kt | 9 +- .../bpdm/gate/api/model}/AddressStateDto.kt | 13 +-- ...eDto.kt => AlternativePostalAddressDto.kt} | 9 +- .../model/BusinessPartnerPostalAddressDto.kt | 4 +- ...ddressGateDto.kt => LogisticAddressDto.kt} | 25 ++---- ...GateDto.kt => PhysicalPostalAddressDto.kt} | 17 +--- .../model/{StreetGateDto.kt => StreetDto.kt} | 2 +- .../model/request/AddressGateInputRequest.kt | 4 +- .../model/request/AddressGateOutputRequest.kt | 6 +- .../request/LegalEntityGateInputRequest.kt | 4 +- .../api/model/request/SiteGateInputRequest.kt | 4 +- .../api/model/response/AddressGateInputDto.kt | 4 +- .../model/response/AddressGateOutputDto.kt | 4 +- .../gate/service/BusinessPartnerMappings.kt | 20 ++--- .../bpdm/gate/service/ResponseMappings.kt | 24 +++--- .../util/BusinessPartnerNonVerboseValues.kt | 2 +- .../gate/util/BusinessPartnerVerboseValues.kt | 81 ++++++------------ .../api/model/AddressIdentifierDto.kt | 5 +- .../orchestrator/api/model/AddressStateDto.kt | 4 +- .../tractusx/bpdm/pool/api/PoolAddressApi.kt | 4 +- .../bpdm/pool/api/PoolLegalEntityApi.kt | 2 +- .../tractusx/bpdm/pool/api/PoolMetadataApi.kt | 4 +- .../pool/api/model/AddressIdentifierDto.kt | 32 +++++++ .../api/model}/AddressIdentifierVerboseDto.kt | 2 +- .../bpdm/pool/api/model/AddressStateDto.kt | 36 ++++++++ .../pool/api/model}/AddressStateVerboseDto.kt | 2 +- .../api/model}/AlternativePostalAddressDto.kt | 11 +-- .../AlternativePostalAddressVerboseDto.kt | 12 +-- .../pool/api/model}/CountrySubdivisionDto.kt | 2 +- .../pool/api/model}/LogisticAddressDto.kt | 6 +- .../api/model}/LogisticAddressVerboseDto.kt | 5 +- .../api/model}/PhysicalPostalAddressDto.kt | 17 +--- .../model}/PhysicalPostalAddressVerboseDto.kt | 18 +--- .../bpdm/pool/api/model}/RegionDto.kt | 2 +- .../tractusx/bpdm/pool/api/model/SiteDto.kt | 1 - .../bpdm/pool/api/model}/StreetDto.kt | 3 +- .../request/AddressPartnerBpnSearchRequest.kt | 2 +- .../request/AddressPartnerCreateRequest.kt | 2 +- .../request/AddressPartnerUpdateRequest.kt | 5 +- .../LegalEntityPartnerCreateRequest.kt | 2 +- .../LegalEntityPartnerUpdateRequest.kt | 2 +- .../model/response/AddressMatchVerboseDto.kt | 2 +- .../AddressPartnerCreateVerboseDto.kt | 2 +- .../api/model/response/EntitiesWithErrors.kt | 2 +- .../model/response/LegalAddressVerboseDto.kt | 4 +- .../response/LegalEntityMatchVerboseDto.kt | 2 +- .../LegalEntityPartnerCreateVerboseDto.kt | 2 +- .../LegalEntityWithLegalAddressVerboseDto.kt | 2 +- .../model/response/MainAddressVerboseDto.kt | 4 +- .../api/model/response/SiteMatchVerboseDto.kt | 2 +- .../response/SitePartnerCreateVerboseDto.kt | 2 +- .../response/SiteWithMainAddressVerboseDto.kt | 2 +- .../bpdm/pool/controller/AddressController.kt | 6 +- .../pool/controller/LegalEntityController.kt | 2 +- .../pool/controller/MetadataController.kt | 4 +- .../bpdm/pool/service/AddressService.kt | 4 +- .../service/BusinessPartnerBuildService.kt | 5 +- .../bpdm/pool/service/MetadataService.kt | 4 +- .../bpdm/pool/service/ResponseMappings.kt | 3 +- .../pool/controller/AddressControllerIT.kt | 4 +- .../controller/AddressControllerSearchIT.kt | 2 +- .../controller/LegalEntityControllerIT.kt | 2 +- .../LegalEntityControllerSearchIT.kt | 2 +- .../bpdm/pool/controller/SiteControllerIT.kt | 2 +- .../TaskStepFetchAndReserveServiceTest.kt | 18 ++-- .../pool/util/BusinessPartnerVerboseValues.kt | 3 - 77 files changed, 327 insertions(+), 334 deletions(-) rename bpdm-common/src/main/kotlin/org/eclipse/tractusx/bpdm/common/dto/{IBaseAddressIdentifierDto.kt => IAddressIdentifierDto.kt} (95%) rename bpdm-common/src/main/kotlin/org/eclipse/tractusx/bpdm/common/dto/{IBaseAddressStateDto.kt => IAddressStateDto.kt} (97%) rename {bpdm-common/src/main/kotlin/org/eclipse/tractusx/bpdm/common/dto => bpdm-gate-api/src/main/kotlin/org/eclipse/tractusx/bpdm/gate/api/model}/AddressIdentifierDto.kt (83%) rename {bpdm-common/src/main/kotlin/org/eclipse/tractusx/bpdm/common/dto => bpdm-gate-api/src/main/kotlin/org/eclipse/tractusx/bpdm/gate/api/model}/AddressStateDto.kt (80%) rename bpdm-gate-api/src/main/kotlin/org/eclipse/tractusx/bpdm/gate/api/model/{AlternativePostalAddressGateDto.kt => AlternativePostalAddressDto.kt} (97%) rename bpdm-gate-api/src/main/kotlin/org/eclipse/tractusx/bpdm/gate/api/model/{LogisticAddressGateDto.kt => LogisticAddressDto.kt} (63%) rename bpdm-gate-api/src/main/kotlin/org/eclipse/tractusx/bpdm/gate/api/model/{PhysicalPostalAddressGateDto.kt => PhysicalPostalAddressDto.kt} (95%) rename bpdm-gate-api/src/main/kotlin/org/eclipse/tractusx/bpdm/gate/api/model/{StreetGateDto.kt => StreetDto.kt} (98%) create mode 100644 bpdm-pool-api/src/main/kotlin/org/eclipse/tractusx/bpdm/pool/api/model/AddressIdentifierDto.kt rename {bpdm-common/src/main/kotlin/org/eclipse/tractusx/bpdm/common/dto/response => bpdm-pool-api/src/main/kotlin/org/eclipse/tractusx/bpdm/pool/api/model}/AddressIdentifierVerboseDto.kt (96%) create mode 100644 bpdm-pool-api/src/main/kotlin/org/eclipse/tractusx/bpdm/pool/api/model/AddressStateDto.kt rename {bpdm-common/src/main/kotlin/org/eclipse/tractusx/bpdm/common/dto/response => bpdm-pool-api/src/main/kotlin/org/eclipse/tractusx/bpdm/pool/api/model}/AddressStateVerboseDto.kt (97%) rename {bpdm-common/src/main/kotlin/org/eclipse/tractusx/bpdm/common/dto => bpdm-pool-api/src/main/kotlin/org/eclipse/tractusx/bpdm/pool/api/model}/AlternativePostalAddressDto.kt (92%) rename {bpdm-common/src/main/kotlin/org/eclipse/tractusx/bpdm/common/dto/response => bpdm-pool-api/src/main/kotlin/org/eclipse/tractusx/bpdm/pool/api/model}/AlternativePostalAddressVerboseDto.kt (92%) rename {bpdm-common/src/main/kotlin/org/eclipse/tractusx/bpdm/common/dto/response => bpdm-pool-api/src/main/kotlin/org/eclipse/tractusx/bpdm/pool/api/model}/CountrySubdivisionDto.kt (96%) rename {bpdm-common/src/main/kotlin/org/eclipse/tractusx/bpdm/common/dto => bpdm-pool-api/src/main/kotlin/org/eclipse/tractusx/bpdm/pool/api/model}/LogisticAddressDto.kt (92%) rename {bpdm-common/src/main/kotlin/org/eclipse/tractusx/bpdm/common/dto/response => bpdm-pool-api/src/main/kotlin/org/eclipse/tractusx/bpdm/pool/api/model}/LogisticAddressVerboseDto.kt (98%) rename {bpdm-common/src/main/kotlin/org/eclipse/tractusx/bpdm/common/dto => bpdm-pool-api/src/main/kotlin/org/eclipse/tractusx/bpdm/pool/api/model}/PhysicalPostalAddressDto.kt (92%) rename {bpdm-common/src/main/kotlin/org/eclipse/tractusx/bpdm/common/dto/response => bpdm-pool-api/src/main/kotlin/org/eclipse/tractusx/bpdm/pool/api/model}/PhysicalPostalAddressVerboseDto.kt (91%) rename {bpdm-common/src/main/kotlin/org/eclipse/tractusx/bpdm/common/dto/response => bpdm-pool-api/src/main/kotlin/org/eclipse/tractusx/bpdm/pool/api/model}/RegionDto.kt (96%) rename {bpdm-common/src/main/kotlin/org/eclipse/tractusx/bpdm/common/dto => bpdm-pool-api/src/main/kotlin/org/eclipse/tractusx/bpdm/pool/api/model}/StreetDto.kt (92%) rename {bpdm-common/src/main/kotlin/org/eclipse/tractusx/bpdm/common/dto => bpdm-pool-api/src/main/kotlin/org/eclipse/tractusx/bpdm/pool/api/model}/request/AddressPartnerBpnSearchRequest.kt (96%) diff --git a/bpdm-bridge-dummy/src/main/kotlin/com/catenax/bpdm/bridge/dummy/dto/DtoConversionHelper.kt b/bpdm-bridge-dummy/src/main/kotlin/com/catenax/bpdm/bridge/dummy/dto/DtoConversionHelper.kt index 2293dc943..c45946ac6 100644 --- a/bpdm-bridge-dummy/src/main/kotlin/com/catenax/bpdm/bridge/dummy/dto/DtoConversionHelper.kt +++ b/bpdm-bridge-dummy/src/main/kotlin/com/catenax/bpdm/bridge/dummy/dto/DtoConversionHelper.kt @@ -19,24 +19,29 @@ package com.catenax.bpdm.bridge.dummy.dto -import org.eclipse.tractusx.bpdm.common.dto.* -import org.eclipse.tractusx.bpdm.common.dto.response.AlternativePostalAddressVerboseDto -import org.eclipse.tractusx.bpdm.common.dto.response.LogisticAddressVerboseDto -import org.eclipse.tractusx.bpdm.common.dto.response.PhysicalPostalAddressVerboseDto import org.eclipse.tractusx.bpdm.common.exception.BpdmNullMappingException -import org.eclipse.tractusx.bpdm.gate.api.model.* -import org.eclipse.tractusx.bpdm.pool.api.model.LegalEntityVerboseDto -import org.eclipse.tractusx.bpdm.pool.api.model.SiteVerboseDto +import org.eclipse.tractusx.bpdm.gate.api.model.AddressGateOutputChildRequest +import org.eclipse.tractusx.bpdm.gate.api.model.SiteGateDto +import org.eclipse.tractusx.bpdm.pool.api.model.* +import org.eclipse.tractusx.bpdm.pool.api.model.LogisticAddressDto import kotlin.reflect.KProperty +import org.eclipse.tractusx.bpdm.gate.api.model.AddressIdentifierDto as Gate_AddressIdentifierDto +import org.eclipse.tractusx.bpdm.gate.api.model.AddressStateDto as Gate_AddressStateDto import org.eclipse.tractusx.bpdm.gate.api.model.LegalEntityClassificationDto as Gate_LegalEntityClassificationDto import org.eclipse.tractusx.bpdm.gate.api.model.LegalEntityDto as Gate_LegalEntityDto import org.eclipse.tractusx.bpdm.gate.api.model.LegalEntityIdentifierDto as Gate_LegalEntityIdentifierDto import org.eclipse.tractusx.bpdm.gate.api.model.LegalEntityStateDto as Gate_LegalEntityStateDto +import org.eclipse.tractusx.bpdm.gate.api.model.LogisticAddressDto as Gate_LogisticAddressDto +import org.eclipse.tractusx.bpdm.gate.api.model.PhysicalPostalAddressDto as Gate_PhysicalPostalAddressDto import org.eclipse.tractusx.bpdm.gate.api.model.SiteStateDto as Gate_SiteStateDto +import org.eclipse.tractusx.bpdm.pool.api.model.AddressIdentifierDto as Pool_AddressIdentifierDto +import org.eclipse.tractusx.bpdm.pool.api.model.AddressStateDto as Pool_AddressStateDto import org.eclipse.tractusx.bpdm.pool.api.model.LegalEntityClassificationDto as Pool_LegalEntityClassificationDto import org.eclipse.tractusx.bpdm.pool.api.model.LegalEntityDto as Pool_LegalEntityDto import org.eclipse.tractusx.bpdm.pool.api.model.LegalEntityIdentifierDto as Pool_LegalEntityIdentifierDto import org.eclipse.tractusx.bpdm.pool.api.model.LegalEntityStateDto as Pool_LegalEntityStateDto +import org.eclipse.tractusx.bpdm.pool.api.model.LogisticAddressVerboseDto as Pool_LogisticAddressVerboseDto +import org.eclipse.tractusx.bpdm.pool.api.model.PhysicalPostalAddressDto as Pool_PhysicalPostalAddressDto1 import org.eclipse.tractusx.bpdm.pool.api.model.SiteStateDto as Pool_SiteStateDto fun gateToPoolLegalEntity(gateDto: Gate_LegalEntityDto): Pool_LegalEntityDto { @@ -84,47 +89,63 @@ fun gateToPoolSiteState(gateDto: Gate_SiteStateDto): Pool_SiteStateDto { ) } -fun gateToPoolLogisticAddress(gateDto: LogisticAddressGateDto): LogisticAddressDto { +fun gateToPoolLogisticAddress(gateDto: Gate_LogisticAddressDto): LogisticAddressDto { return LogisticAddressDto( name = gateDto.nameParts.firstOrNull(), - states = gateDto.states, - identifiers = gateDto.identifiers, + states = gateDto.states.map(::gateToPoolAddressState), + identifiers = gateDto.identifiers.map(::gateToPoolAddressIdentifier), physicalPostalAddress = gateToPoolPhysicalAddress(gateDto.physicalPostalAddress), alternativePostalAddress = gateDto.alternativePostalAddress?.let(::gateToPoolAlternativeAddress) ) } -fun gateToPoolAlternativeAddress(gateDto: AlternativePostalAddressGateDto): AlternativePostalAddressDto { +fun gateToPoolAddressState(gateDto: Gate_AddressStateDto): Pool_AddressStateDto { + return Pool_AddressStateDto( + validFrom = gateDto.validFrom, + validTo = gateDto.validTo, + type = gateDto.type, + description = gateDto.description + ) +} + +fun gateToPoolAddressIdentifier(gateDto: Gate_AddressIdentifierDto): Pool_AddressIdentifierDto { + return Pool_AddressIdentifierDto( + type = gateDto.type, + value = gateDto.value + ) +} + +fun gateToPoolAlternativeAddress(gateDto: org.eclipse.tractusx.bpdm.gate.api.model.AlternativePostalAddressDto): AlternativePostalAddressDto { fun buildNullMappingException(nullField: KProperty<*>) = - BpdmNullMappingException(AlternativePostalAddressGateDto::class, AlternativePostalAddressDto::class, nullField) + BpdmNullMappingException(AlternativePostalAddressDto::class, AlternativePostalAddressDto::class, nullField) return AlternativePostalAddressDto( geographicCoordinates = gateDto.geographicCoordinates, country = gateDto.country - ?: throw buildNullMappingException(AlternativePostalAddressGateDto::country), + ?: throw buildNullMappingException(AlternativePostalAddressDto::country), administrativeAreaLevel1 = gateDto.administrativeAreaLevel1, postalCode = gateDto.postalCode, city = gateDto.city - ?: throw buildNullMappingException(AlternativePostalAddressGateDto::city), + ?: throw buildNullMappingException(AlternativePostalAddressDto::city), deliveryServiceType = gateDto.deliveryServiceType - ?: throw buildNullMappingException(AlternativePostalAddressGateDto::deliveryServiceType), + ?: throw buildNullMappingException(AlternativePostalAddressDto::deliveryServiceType), deliveryServiceQualifier = gateDto.deliveryServiceQualifier, deliveryServiceNumber = gateDto.deliveryServiceNumber - ?: throw buildNullMappingException(AlternativePostalAddressGateDto::deliveryServiceNumber) + ?: throw buildNullMappingException(AlternativePostalAddressDto::deliveryServiceNumber) ) } -fun gateToPoolPhysicalAddress(gateDto: PhysicalPostalAddressGateDto): PhysicalPostalAddressDto { +fun gateToPoolPhysicalAddress(gateDto: Gate_PhysicalPostalAddressDto): Pool_PhysicalPostalAddressDto1 { fun buildNullMappingException(nullField: KProperty<*>) = - BpdmNullMappingException(PhysicalPostalAddressGateDto::class, PhysicalPostalAddressDto::class, nullField) + BpdmNullMappingException(Gate_PhysicalPostalAddressDto::class, Pool_PhysicalPostalAddressDto1::class, nullField) - return PhysicalPostalAddressDto( + return Pool_PhysicalPostalAddressDto1( geographicCoordinates = gateDto.geographicCoordinates, country = gateDto.country - ?: throw buildNullMappingException(PhysicalPostalAddressGateDto::country), + ?: throw buildNullMappingException(Gate_PhysicalPostalAddressDto::country), postalCode = gateDto.postalCode, city = gateDto.city - ?: throw buildNullMappingException(PhysicalPostalAddressGateDto::city), + ?: throw buildNullMappingException(Gate_PhysicalPostalAddressDto::city), administrativeAreaLevel1 = gateDto.administrativeAreaLevel1, administrativeAreaLevel2 = gateDto.administrativeAreaLevel2, administrativeAreaLevel3 = gateDto.administrativeAreaLevel3, @@ -192,16 +213,16 @@ fun poolToGateSite(site: SiteVerboseDto): SiteGateDto { ) } -fun poolToGateAddressChild(address: LogisticAddressVerboseDto): AddressGateOutputChildRequest { +fun poolToGateAddressChild(address: Pool_LogisticAddressVerboseDto): AddressGateOutputChildRequest { return AddressGateOutputChildRequest( address = poolToGateLogisticAddress(address), bpn = address.bpna ) } -fun poolToGateLogisticAddress(address: LogisticAddressVerboseDto): LogisticAddressGateDto { +fun poolToGateLogisticAddress(address: Pool_LogisticAddressVerboseDto): Gate_LogisticAddressDto { val states = address.states.map { - AddressStateDto( + Gate_AddressStateDto( description = it.description, validFrom = it.validFrom, validTo = it.validTo, @@ -209,12 +230,12 @@ fun poolToGateLogisticAddress(address: LogisticAddressVerboseDto): LogisticAddre ) } val identifiers = address.identifiers.map { - AddressIdentifierDto( + Gate_AddressIdentifierDto( value = it.value, type = it.type.technicalKey ) } - return LogisticAddressGateDto( + return Gate_LogisticAddressDto( nameParts = listOfNotNull(address.name), states = states, identifiers = identifiers, @@ -223,16 +244,16 @@ fun poolToGateLogisticAddress(address: LogisticAddressVerboseDto): LogisticAddre ) } -private fun poolToGatePhysicalAddress(address: PhysicalPostalAddressVerboseDto): PhysicalPostalAddressGateDto { +private fun poolToGatePhysicalAddress(address: PhysicalPostalAddressVerboseDto): Gate_PhysicalPostalAddressDto { val street = address.street?.let { - StreetGateDto( + org.eclipse.tractusx.bpdm.gate.api.model.StreetDto( name = it.name, houseNumber = it.houseNumber, milestone = it.milestone, direction = it.direction ) } - return PhysicalPostalAddressGateDto( + return Gate_PhysicalPostalAddressDto( geographicCoordinates = address.geographicCoordinates, country = address.country.technicalKey, postalCode = address.postalCode, @@ -250,8 +271,8 @@ private fun poolToGatePhysicalAddress(address: PhysicalPostalAddressVerboseDto): ) } -private fun poolToGateAlternativeAddress(address: AlternativePostalAddressVerboseDto): AlternativePostalAddressGateDto { - return AlternativePostalAddressGateDto( +private fun poolToGateAlternativeAddress(address: AlternativePostalAddressVerboseDto): org.eclipse.tractusx.bpdm.gate.api.model.AlternativePostalAddressDto { + return org.eclipse.tractusx.bpdm.gate.api.model.AlternativePostalAddressDto( geographicCoordinates = address.geographicCoordinates, country = address.country.technicalKey, postalCode = address.postalCode, diff --git a/bpdm-bridge-dummy/src/main/kotlin/com/catenax/bpdm/bridge/dummy/dto/GateAddressInfo.kt b/bpdm-bridge-dummy/src/main/kotlin/com/catenax/bpdm/bridge/dummy/dto/GateAddressInfo.kt index 76629db2f..86c2ada6d 100644 --- a/bpdm-bridge-dummy/src/main/kotlin/com/catenax/bpdm/bridge/dummy/dto/GateAddressInfo.kt +++ b/bpdm-bridge-dummy/src/main/kotlin/com/catenax/bpdm/bridge/dummy/dto/GateAddressInfo.kt @@ -19,10 +19,10 @@ package com.catenax.bpdm.bridge.dummy.dto -import org.eclipse.tractusx.bpdm.gate.api.model.LogisticAddressGateDto +import org.eclipse.tractusx.bpdm.gate.api.model.LogisticAddressDto data class GateAddressInfo( - val address: LogisticAddressGateDto, + val address: LogisticAddressDto, val externalId: String, val legalEntityExternalId: String?, val siteExternalId: String?, diff --git a/bpdm-bridge-dummy/src/main/kotlin/com/catenax/bpdm/bridge/dummy/dto/GateSiteInfo.kt b/bpdm-bridge-dummy/src/main/kotlin/com/catenax/bpdm/bridge/dummy/dto/GateSiteInfo.kt index f6cdad2df..a2b29294c 100644 --- a/bpdm-bridge-dummy/src/main/kotlin/com/catenax/bpdm/bridge/dummy/dto/GateSiteInfo.kt +++ b/bpdm-bridge-dummy/src/main/kotlin/com/catenax/bpdm/bridge/dummy/dto/GateSiteInfo.kt @@ -19,13 +19,13 @@ package com.catenax.bpdm.bridge.dummy.dto -import org.eclipse.tractusx.bpdm.gate.api.model.LogisticAddressGateDto +import org.eclipse.tractusx.bpdm.gate.api.model.LogisticAddressDto import org.eclipse.tractusx.bpdm.gate.api.model.SiteGateDto data class GateSiteInfo( val site: SiteGateDto, val externalId: String, val legalEntityExternalId: String, - val mainAddress: LogisticAddressGateDto, + val mainAddress: LogisticAddressDto, val bpn: String? ) diff --git a/bpdm-bridge-dummy/src/main/kotlin/com/catenax/bpdm/bridge/dummy/service/GateUpdateService.kt b/bpdm-bridge-dummy/src/main/kotlin/com/catenax/bpdm/bridge/dummy/service/GateUpdateService.kt index 294b30dbb..d9aa28e53 100644 --- a/bpdm-bridge-dummy/src/main/kotlin/com/catenax/bpdm/bridge/dummy/service/GateUpdateService.kt +++ b/bpdm-bridge-dummy/src/main/kotlin/com/catenax/bpdm/bridge/dummy/service/GateUpdateService.kt @@ -22,7 +22,6 @@ package com.catenax.bpdm.bridge.dummy.service import com.catenax.bpdm.bridge.dummy.dto.* import mu.KotlinLogging import org.eclipse.tractusx.bpdm.common.dto.BusinessPartnerType -import org.eclipse.tractusx.bpdm.common.dto.response.LogisticAddressVerboseDto import org.eclipse.tractusx.bpdm.gate.api.client.GateClient import org.eclipse.tractusx.bpdm.gate.api.exception.BusinessPartnerSharingError import org.eclipse.tractusx.bpdm.gate.api.model.SharingStateType @@ -30,6 +29,7 @@ import org.eclipse.tractusx.bpdm.gate.api.model.request.AddressGateOutputRequest import org.eclipse.tractusx.bpdm.gate.api.model.request.LegalEntityGateOutputRequest import org.eclipse.tractusx.bpdm.gate.api.model.request.SiteGateOutputRequest import org.eclipse.tractusx.bpdm.gate.api.model.response.SharingStateDto +import org.eclipse.tractusx.bpdm.pool.api.model.LogisticAddressVerboseDto import org.eclipse.tractusx.bpdm.pool.api.model.response.* import org.springframework.stereotype.Service import java.time.LocalDateTime diff --git a/bpdm-bridge-dummy/src/main/kotlin/com/catenax/bpdm/bridge/dummy/service/PoolUpdateService.kt b/bpdm-bridge-dummy/src/main/kotlin/com/catenax/bpdm/bridge/dummy/service/PoolUpdateService.kt index 3eba2769c..a9dcebc2a 100644 --- a/bpdm-bridge-dummy/src/main/kotlin/com/catenax/bpdm/bridge/dummy/service/PoolUpdateService.kt +++ b/bpdm-bridge-dummy/src/main/kotlin/com/catenax/bpdm/bridge/dummy/service/PoolUpdateService.kt @@ -22,9 +22,9 @@ package com.catenax.bpdm.bridge.dummy.service import com.catenax.bpdm.bridge.dummy.dto.* import mu.KotlinLogging import org.eclipse.tractusx.bpdm.common.dto.BusinessPartnerType -import org.eclipse.tractusx.bpdm.common.dto.LogisticAddressDto import org.eclipse.tractusx.bpdm.gate.api.client.GateClient import org.eclipse.tractusx.bpdm.pool.api.client.PoolApiClient +import org.eclipse.tractusx.bpdm.pool.api.model.LogisticAddressDto import org.eclipse.tractusx.bpdm.pool.api.model.SiteDto import org.eclipse.tractusx.bpdm.pool.api.model.request.* import org.eclipse.tractusx.bpdm.pool.api.model.response.* @@ -138,8 +138,8 @@ class PoolUpdateService( AddressPartnerCreateRequest( address = LogisticAddressDto( name = entry.address.nameParts.firstOrNull(), - states = entry.address.states, - identifiers = entry.address.identifiers, + states = entry.address.states.map(::gateToPoolAddressState), + identifiers = entry.address.identifiers.map(::gateToPoolAddressIdentifier), physicalPostalAddress = gateToPoolPhysicalAddress(entry.address.physicalPostalAddress), alternativePostalAddress = entry.address.alternativePostalAddress?.let(::gateToPoolAlternativeAddress) ), @@ -178,8 +178,8 @@ class PoolUpdateService( AddressPartnerUpdateRequest( address = LogisticAddressDto( name = it.address.nameParts.firstOrNull(), - states = it.address.states, - identifiers = it.address.identifiers, + states = it.address.states.map(::gateToPoolAddressState), + identifiers = it.address.identifiers.map(::gateToPoolAddressIdentifier), physicalPostalAddress = gateToPoolPhysicalAddress(it.address.physicalPostalAddress), alternativePostalAddress = it.address.alternativePostalAddress?.let(::gateToPoolAlternativeAddress) ), diff --git a/bpdm-bridge-dummy/src/test/kotlin/com/catenax/bpdm/bridge/dummy/BridgeSyncIT.kt b/bpdm-bridge-dummy/src/test/kotlin/com/catenax/bpdm/bridge/dummy/BridgeSyncIT.kt index d4323d07e..da5ed3436 100644 --- a/bpdm-bridge-dummy/src/test/kotlin/com/catenax/bpdm/bridge/dummy/BridgeSyncIT.kt +++ b/bpdm-bridge-dummy/src/test/kotlin/com/catenax/bpdm/bridge/dummy/BridgeSyncIT.kt @@ -28,17 +28,17 @@ import com.catenax.bpdm.bridge.dummy.util.BpdmPoolContextInitializer import com.catenax.bpdm.bridge.dummy.util.PostgreSQLContextInitializer import com.catenax.bpdm.bridge.dummy.util.TestHelpers import org.assertj.core.api.Assertions.assertThat -import org.eclipse.tractusx.bpdm.common.dto.request.AddressPartnerBpnSearchRequest import org.eclipse.tractusx.bpdm.common.dto.request.PaginationRequest -import org.eclipse.tractusx.bpdm.common.dto.response.LogisticAddressVerboseDto import org.eclipse.tractusx.bpdm.gate.api.client.GateClient import org.eclipse.tractusx.bpdm.gate.api.model.SharingStateType -import org.eclipse.tractusx.bpdm.gate.api.model.StreetGateDto +import org.eclipse.tractusx.bpdm.gate.api.model.StreetDto import org.eclipse.tractusx.bpdm.gate.api.model.request.AddressGateInputRequest import org.eclipse.tractusx.bpdm.gate.api.model.request.LegalEntityGateInputRequest import org.eclipse.tractusx.bpdm.gate.api.model.request.SiteGateInputRequest import org.eclipse.tractusx.bpdm.gate.api.model.response.SharingStateDto import org.eclipse.tractusx.bpdm.pool.api.client.PoolApiClient +import org.eclipse.tractusx.bpdm.pool.api.model.LogisticAddressVerboseDto +import org.eclipse.tractusx.bpdm.pool.api.model.request.AddressPartnerBpnSearchRequest import org.eclipse.tractusx.bpdm.pool.api.model.request.ChangelogSearchRequest import org.eclipse.tractusx.bpdm.pool.api.model.request.LegalEntityPropertiesSearchRequest import org.eclipse.tractusx.bpdm.pool.api.model.request.SiteBpnSearchRequest @@ -248,7 +248,7 @@ class BridgeSyncIT @Autowired constructor( legalEntity = GateRequestValues.legalEntity1.copy(legalShortName = "ChangedShortNam"), legalAddress = GateRequestValues.address1.copy( physicalPostalAddress = GateRequestValues.postalAddress1.copy( - street = StreetGateDto(name = "Changed Street Entiy", houseNumber = CommonValues.houseNumber1, direction = CommonValues.direction1), + street = StreetDto(name = "Changed Street Entiy", houseNumber = CommonValues.houseNumber1, direction = CommonValues.direction1), ), ), ) @@ -315,7 +315,7 @@ class BridgeSyncIT @Autowired constructor( site = GateRequestValues.site1.copy(nameParts = listOf("ChangedNamePart1")), mainAddress = GateRequestValues.address1.copy( physicalPostalAddress = GateRequestValues.postalAddress1.copy( - street = StreetGateDto(name = "Changed Street Site", houseNumber = CommonValues.houseNumber1, direction = CommonValues.direction1), + street = StreetDto(name = "Changed Street Site", houseNumber = CommonValues.houseNumber1, direction = CommonValues.direction1), ), ) ) @@ -382,7 +382,7 @@ class BridgeSyncIT @Autowired constructor( address = GateRequestValues.address1.copy( nameParts = listOf("Changed Address Name"), physicalPostalAddress = GateRequestValues.postalAddress1 - .copy(street = StreetGateDto(name = "UpdateSteet", houseNumber = CommonValues.houseNumber1, direction = CommonValues.direction1)) + .copy(street = StreetDto(name = "UpdateSteet", houseNumber = CommonValues.houseNumber1, direction = CommonValues.direction1)) ), ) diff --git a/bpdm-bridge-dummy/src/test/kotlin/com/catenax/bpdm/bridge/dummy/testdata/GateRequestValues.kt b/bpdm-bridge-dummy/src/test/kotlin/com/catenax/bpdm/bridge/dummy/testdata/GateRequestValues.kt index 8b590970a..9c443fb8f 100644 --- a/bpdm-bridge-dummy/src/test/kotlin/com/catenax/bpdm/bridge/dummy/testdata/GateRequestValues.kt +++ b/bpdm-bridge-dummy/src/test/kotlin/com/catenax/bpdm/bridge/dummy/testdata/GateRequestValues.kt @@ -114,7 +114,7 @@ object GateRequestValues { val geoCoordinate1 = GeoCoordinateDto(CommonValues.geoCoordinates1.first, CommonValues.geoCoordinates1.second) val geoCoordinate2 = GeoCoordinateDto(CommonValues.geoCoordinates2.first, CommonValues.geoCoordinates2.second) - val postalAddress1 = PhysicalPostalAddressGateDto( + val postalAddress1 = PhysicalPostalAddressDto( geographicCoordinates = geoCoordinate1, country = CommonValues.country1, postalCode = CommonValues.postCode1, @@ -128,10 +128,10 @@ object GateRequestValues { building = CommonValues.building1, floor = CommonValues.floor1, door = CommonValues.door1, - street = StreetGateDto(name = CommonValues.street1, houseNumber = CommonValues.houseNumber1, direction = CommonValues.direction1), + street = StreetDto(name = CommonValues.street1, houseNumber = CommonValues.houseNumber1, direction = CommonValues.direction1), ) - val postalAddress2 = PhysicalPostalAddressGateDto( + val postalAddress2 = PhysicalPostalAddressDto( geographicCoordinates = geoCoordinate2, country = CommonValues.country2, postalCode = CommonValues.postCode2, @@ -145,9 +145,9 @@ object GateRequestValues { building = CommonValues.building2, floor = CommonValues.floor2, door = CommonValues.door2, - street = StreetGateDto(name = CommonValues.street2, houseNumber = CommonValues.houseNumber2, direction = CommonValues.direction2), + street = StreetDto(name = CommonValues.street2, houseNumber = CommonValues.houseNumber2, direction = CommonValues.direction2), ) - val postalAddress3 = PhysicalPostalAddressGateDto( + val postalAddress3 = PhysicalPostalAddressDto( geographicCoordinates = geoCoordinate1, country = CommonValues.country1, postalCode = CommonValues.postCode1, @@ -161,11 +161,11 @@ object GateRequestValues { building = CommonValues.building1, floor = CommonValues.floor1, door = CommonValues.door1, - street = StreetGateDto(name = CommonValues.street1, houseNumber = CommonValues.houseNumber1, direction = CommonValues.direction1), + street = StreetDto(name = CommonValues.street1, houseNumber = CommonValues.houseNumber1, direction = CommonValues.direction1), ) //New Values for Logistic Addresses Tests - val postalAddressLogisticAddress1 = PhysicalPostalAddressGateDto( + val postalAddressLogisticAddress1 = PhysicalPostalAddressDto( geographicCoordinates = geoCoordinate1, country = CommonValues.country1, postalCode = CommonValues.postCode1, @@ -179,10 +179,10 @@ object GateRequestValues { building = CommonValues.building1, floor = CommonValues.floor1, door = CommonValues.door1, - street = StreetGateDto(name = CommonValues.street1, houseNumber = CommonValues.houseNumber1, direction = CommonValues.direction1), + street = StreetDto(name = CommonValues.street1, houseNumber = CommonValues.houseNumber1, direction = CommonValues.direction1), ) - val postalAddressLogisticAddress2 = PhysicalPostalAddressGateDto( + val postalAddressLogisticAddress2 = PhysicalPostalAddressDto( geographicCoordinates = geoCoordinate2, country = CommonValues.country2, postalCode = CommonValues.postCode2, @@ -196,27 +196,27 @@ object GateRequestValues { building = CommonValues.building2, floor = CommonValues.floor2, door = CommonValues.door2, - street = StreetGateDto(name = CommonValues.street2, houseNumber = CommonValues.houseNumber2, direction = CommonValues.direction2), + street = StreetDto(name = CommonValues.street2, houseNumber = CommonValues.houseNumber2, direction = CommonValues.direction2), ) - val address1 = LogisticAddressGateDto( + val address1 = LogisticAddressDto( physicalPostalAddress = postalAddress1, ) - val address2 = LogisticAddressGateDto( + val address2 = LogisticAddressDto( physicalPostalAddress = postalAddress2, ) - val address3 = LogisticAddressGateDto( + val address3 = LogisticAddressDto( physicalPostalAddress = postalAddress3, ) //New Values for Logistic Address Tests - val logisticAddress1 = LogisticAddressGateDto( + val logisticAddress1 = LogisticAddressDto( physicalPostalAddress = postalAddressLogisticAddress1, ) - val logisticAddress2 = LogisticAddressGateDto( + val logisticAddress2 = LogisticAddressDto( physicalPostalAddress = postalAddressLogisticAddress2, ) diff --git a/bpdm-common/src/main/kotlin/org/eclipse/tractusx/bpdm/common/dto/IBaseAddressIdentifierDto.kt b/bpdm-common/src/main/kotlin/org/eclipse/tractusx/bpdm/common/dto/IAddressIdentifierDto.kt similarity index 95% rename from bpdm-common/src/main/kotlin/org/eclipse/tractusx/bpdm/common/dto/IBaseAddressIdentifierDto.kt rename to bpdm-common/src/main/kotlin/org/eclipse/tractusx/bpdm/common/dto/IAddressIdentifierDto.kt index 77609e9cc..ade5a50fb 100644 --- a/bpdm-common/src/main/kotlin/org/eclipse/tractusx/bpdm/common/dto/IBaseAddressIdentifierDto.kt +++ b/bpdm-common/src/main/kotlin/org/eclipse/tractusx/bpdm/common/dto/IAddressIdentifierDto.kt @@ -23,10 +23,11 @@ import io.swagger.v3.oas.annotations.media.Schema import org.eclipse.tractusx.bpdm.common.dto.openapidescription.AddressIdentifierDescription @Schema(description = AddressIdentifierDescription.header) -interface IBaseAddressIdentifierDto : IBaseIdentifierDto { +interface IAddressIdentifierDto : IBaseIdentifierDto { + @get:Schema(description = AddressIdentifierDescription.value) override val value: String @get:Schema(description = AddressIdentifierDescription.type) override val type: String -} \ No newline at end of file +} diff --git a/bpdm-common/src/main/kotlin/org/eclipse/tractusx/bpdm/common/dto/IBaseAddressStateDto.kt b/bpdm-common/src/main/kotlin/org/eclipse/tractusx/bpdm/common/dto/IAddressStateDto.kt similarity index 97% rename from bpdm-common/src/main/kotlin/org/eclipse/tractusx/bpdm/common/dto/IBaseAddressStateDto.kt rename to bpdm-common/src/main/kotlin/org/eclipse/tractusx/bpdm/common/dto/IAddressStateDto.kt index 5e08a565f..a3235f85d 100644 --- a/bpdm-common/src/main/kotlin/org/eclipse/tractusx/bpdm/common/dto/IBaseAddressStateDto.kt +++ b/bpdm-common/src/main/kotlin/org/eclipse/tractusx/bpdm/common/dto/IAddressStateDto.kt @@ -25,7 +25,7 @@ import org.eclipse.tractusx.bpdm.common.model.BusinessStateType import java.time.LocalDateTime @Schema(description = AddressStateDescription.header) -interface IBaseAddressStateDto : IBaseStateDto { +interface IAddressStateDto : IBaseStateDto { @get:Schema(description = AddressStateDescription.description) override val description: String? diff --git a/bpdm-common/src/main/kotlin/org/eclipse/tractusx/bpdm/common/dto/IBaseLogisticAddressDto.kt b/bpdm-common/src/main/kotlin/org/eclipse/tractusx/bpdm/common/dto/IBaseLogisticAddressDto.kt index f003addd3..4c5dd0cd6 100644 --- a/bpdm-common/src/main/kotlin/org/eclipse/tractusx/bpdm/common/dto/IBaseLogisticAddressDto.kt +++ b/bpdm-common/src/main/kotlin/org/eclipse/tractusx/bpdm/common/dto/IBaseLogisticAddressDto.kt @@ -25,11 +25,12 @@ import org.eclipse.tractusx.bpdm.common.dto.openapidescription.LogisticAddressDe @Schema(description = LogisticAddressDescription.header) interface IBaseLogisticAddressDto { + @get:ArraySchema(arraySchema = Schema(description = LogisticAddressDescription.states)) - val states: Collection + val states: Collection @get:ArraySchema(arraySchema = Schema(description = LogisticAddressDescription.identifiers)) - val identifiers: Collection + val identifiers: Collection // TODO OpenAPI description for complex field does not work!! @get:Schema(description = LogisticAddressDescription.physicalPostalAddress) @@ -38,4 +39,4 @@ interface IBaseLogisticAddressDto { // TODO OpenAPI description for complex field does not work!! @get:Schema(description = LogisticAddressDescription.alternativePostalAddress) val alternativePostalAddress: IBaseAlternativePostalAddressDto? -} \ No newline at end of file +} diff --git a/bpdm-gate-api/src/main/kotlin/org/eclipse/tractusx/bpdm/gate/api/model/AddressGateOutputChildRequest.kt b/bpdm-gate-api/src/main/kotlin/org/eclipse/tractusx/bpdm/gate/api/model/AddressGateOutputChildRequest.kt index 682b57747..bbb88e656 100644 --- a/bpdm-gate-api/src/main/kotlin/org/eclipse/tractusx/bpdm/gate/api/model/AddressGateOutputChildRequest.kt +++ b/bpdm-gate-api/src/main/kotlin/org/eclipse/tractusx/bpdm/gate/api/model/AddressGateOutputChildRequest.kt @@ -30,7 +30,7 @@ import org.eclipse.tractusx.bpdm.common.service.DataClassUnwrappedJsonDeserializ data class AddressGateOutputChildRequest( @field:JsonUnwrapped - val address: LogisticAddressGateDto, + val address: LogisticAddressDto, // TODO rename to bpna @get:Schema(description = LogisticAddressDescription.bpna) diff --git a/bpdm-common/src/main/kotlin/org/eclipse/tractusx/bpdm/common/dto/AddressIdentifierDto.kt b/bpdm-gate-api/src/main/kotlin/org/eclipse/tractusx/bpdm/gate/api/model/AddressIdentifierDto.kt similarity index 83% rename from bpdm-common/src/main/kotlin/org/eclipse/tractusx/bpdm/common/dto/AddressIdentifierDto.kt rename to bpdm-gate-api/src/main/kotlin/org/eclipse/tractusx/bpdm/gate/api/model/AddressIdentifierDto.kt index 2cbde3579..c1019539b 100644 --- a/bpdm-common/src/main/kotlin/org/eclipse/tractusx/bpdm/common/dto/AddressIdentifierDto.kt +++ b/bpdm-gate-api/src/main/kotlin/org/eclipse/tractusx/bpdm/gate/api/model/AddressIdentifierDto.kt @@ -17,17 +17,16 @@ * SPDX-License-Identifier: Apache-2.0 ******************************************************************************/ -package org.eclipse.tractusx.bpdm.common.dto +package org.eclipse.tractusx.bpdm.gate.api.model import io.swagger.v3.oas.annotations.media.Schema +import org.eclipse.tractusx.bpdm.common.dto.IAddressIdentifierDto import org.eclipse.tractusx.bpdm.common.dto.openapidescription.AddressIdentifierDescription @Schema(description = AddressIdentifierDescription.header) data class AddressIdentifierDto( - @get:Schema(description = AddressIdentifierDescription.value) override val value: String, + override val type: String - @get:Schema(description = AddressIdentifierDescription.type) - override val type: String, -) : IBaseAddressIdentifierDto +) : IAddressIdentifierDto diff --git a/bpdm-common/src/main/kotlin/org/eclipse/tractusx/bpdm/common/dto/AddressStateDto.kt b/bpdm-gate-api/src/main/kotlin/org/eclipse/tractusx/bpdm/gate/api/model/AddressStateDto.kt similarity index 80% rename from bpdm-common/src/main/kotlin/org/eclipse/tractusx/bpdm/common/dto/AddressStateDto.kt rename to bpdm-gate-api/src/main/kotlin/org/eclipse/tractusx/bpdm/gate/api/model/AddressStateDto.kt index 33ea8c684..ce979804d 100644 --- a/bpdm-common/src/main/kotlin/org/eclipse/tractusx/bpdm/common/dto/AddressStateDto.kt +++ b/bpdm-gate-api/src/main/kotlin/org/eclipse/tractusx/bpdm/gate/api/model/AddressStateDto.kt @@ -17,9 +17,10 @@ * SPDX-License-Identifier: Apache-2.0 ******************************************************************************/ -package org.eclipse.tractusx.bpdm.common.dto +package org.eclipse.tractusx.bpdm.gate.api.model import io.swagger.v3.oas.annotations.media.Schema +import org.eclipse.tractusx.bpdm.common.dto.IAddressStateDto import org.eclipse.tractusx.bpdm.common.dto.openapidescription.AddressStateDescription import org.eclipse.tractusx.bpdm.common.model.BusinessStateType import java.time.LocalDateTime @@ -27,15 +28,9 @@ import java.time.LocalDateTime @Schema(description = AddressStateDescription.header) data class AddressStateDto( - @get:Schema(description = AddressStateDescription.description) override val description: String?, - - @get:Schema(description = AddressStateDescription.validFrom) override val validFrom: LocalDateTime?, - - @get:Schema(description = AddressStateDescription.validTo) override val validTo: LocalDateTime?, - - @get:Schema(description = AddressStateDescription.type) override val type: BusinessStateType -): IBaseAddressStateDto + +) : IAddressStateDto diff --git a/bpdm-gate-api/src/main/kotlin/org/eclipse/tractusx/bpdm/gate/api/model/AlternativePostalAddressGateDto.kt b/bpdm-gate-api/src/main/kotlin/org/eclipse/tractusx/bpdm/gate/api/model/AlternativePostalAddressDto.kt similarity index 97% rename from bpdm-gate-api/src/main/kotlin/org/eclipse/tractusx/bpdm/gate/api/model/AlternativePostalAddressGateDto.kt rename to bpdm-gate-api/src/main/kotlin/org/eclipse/tractusx/bpdm/gate/api/model/AlternativePostalAddressDto.kt index 006bdf602..11dff433c 100644 --- a/bpdm-gate-api/src/main/kotlin/org/eclipse/tractusx/bpdm/gate/api/model/AlternativePostalAddressGateDto.kt +++ b/bpdm-gate-api/src/main/kotlin/org/eclipse/tractusx/bpdm/gate/api/model/AlternativePostalAddressDto.kt @@ -30,22 +30,15 @@ import org.eclipse.tractusx.bpdm.common.service.DataClassUnwrappedJsonDeserializ @JsonDeserialize(using = DataClassUnwrappedJsonDeserializer::class) @Schema(description = PostalAddressDescription.headerAlternative) -data class AlternativePostalAddressGateDto( +data class AlternativePostalAddressDto( override val geographicCoordinates: GeoCoordinateDto? = null, - override val country: CountryCode? = null, - override val administrativeAreaLevel1: String? = null, - override val postalCode: String? = null, - override val city: String? = null, - override val deliveryServiceType: DeliveryServiceType? = null, - override val deliveryServiceQualifier: String? = null, - override val deliveryServiceNumber: String? = null ) : IBaseAlternativePostalAddressDto { diff --git a/bpdm-gate-api/src/main/kotlin/org/eclipse/tractusx/bpdm/gate/api/model/BusinessPartnerPostalAddressDto.kt b/bpdm-gate-api/src/main/kotlin/org/eclipse/tractusx/bpdm/gate/api/model/BusinessPartnerPostalAddressDto.kt index 6e56a96ab..6c25dce85 100644 --- a/bpdm-gate-api/src/main/kotlin/org/eclipse/tractusx/bpdm/gate/api/model/BusinessPartnerPostalAddressDto.kt +++ b/bpdm-gate-api/src/main/kotlin/org/eclipse/tractusx/bpdm/gate/api/model/BusinessPartnerPostalAddressDto.kt @@ -25,7 +25,7 @@ import org.eclipse.tractusx.bpdm.common.dto.IBaseBusinessPartnerPostalAddressDto data class BusinessPartnerPostalAddressDto( override val addressType: AddressType? = null, - override val physicalPostalAddress: PhysicalPostalAddressGateDto? = null, - override val alternativePostalAddress: AlternativePostalAddressGateDto? = null + override val physicalPostalAddress: PhysicalPostalAddressDto? = null, + override val alternativePostalAddress: AlternativePostalAddressDto? = null ) : IBaseBusinessPartnerPostalAddressDto diff --git a/bpdm-gate-api/src/main/kotlin/org/eclipse/tractusx/bpdm/gate/api/model/LogisticAddressGateDto.kt b/bpdm-gate-api/src/main/kotlin/org/eclipse/tractusx/bpdm/gate/api/model/LogisticAddressDto.kt similarity index 63% rename from bpdm-gate-api/src/main/kotlin/org/eclipse/tractusx/bpdm/gate/api/model/LogisticAddressGateDto.kt rename to bpdm-gate-api/src/main/kotlin/org/eclipse/tractusx/bpdm/gate/api/model/LogisticAddressDto.kt index 55c0ae6ac..a6487c526 100644 --- a/bpdm-gate-api/src/main/kotlin/org/eclipse/tractusx/bpdm/gate/api/model/LogisticAddressGateDto.kt +++ b/bpdm-gate-api/src/main/kotlin/org/eclipse/tractusx/bpdm/gate/api/model/LogisticAddressDto.kt @@ -21,31 +21,22 @@ package org.eclipse.tractusx.bpdm.gate.api.model import io.swagger.v3.oas.annotations.media.ArraySchema import io.swagger.v3.oas.annotations.media.Schema -import org.eclipse.tractusx.bpdm.common.dto.AddressIdentifierDto -import org.eclipse.tractusx.bpdm.common.dto.AddressStateDto import org.eclipse.tractusx.bpdm.common.dto.BusinessPartnerRole +import org.eclipse.tractusx.bpdm.common.dto.IBaseLogisticAddressDto import org.eclipse.tractusx.bpdm.common.dto.openapidescription.LogisticAddressDescription @Schema(description = LogisticAddressDescription.header) -data class LogisticAddressGateDto( +data class LogisticAddressDto( @get:ArraySchema(arraySchema = Schema(description = LogisticAddressDescription.nameParts)) val nameParts: Collection = emptyList(), - @get:ArraySchema(arraySchema = Schema(description = LogisticAddressDescription.states)) - val states: Collection = emptyList(), - - @get:ArraySchema(arraySchema = Schema(description = LogisticAddressDescription.identifiers)) - val identifiers: Collection = emptyList(), - - // TODO OpenAPI description for complex field does not work!! - @get:Schema(description = LogisticAddressDescription.physicalPostalAddress) - val physicalPostalAddress: PhysicalPostalAddressGateDto, - - // TODO OpenAPI description for complex field does not work!! - @get:Schema(description = LogisticAddressDescription.alternativePostalAddress) - val alternativePostalAddress: AlternativePostalAddressGateDto? = null, + override val states: Collection = emptyList(), + override val identifiers: Collection = emptyList(), + override val physicalPostalAddress: PhysicalPostalAddressDto, + override val alternativePostalAddress: AlternativePostalAddressDto? = null, @get:ArraySchema(arraySchema = Schema(description = LogisticAddressDescription.roles)) val roles: Collection = emptyList() -) + +) : IBaseLogisticAddressDto diff --git a/bpdm-gate-api/src/main/kotlin/org/eclipse/tractusx/bpdm/gate/api/model/PhysicalPostalAddressGateDto.kt b/bpdm-gate-api/src/main/kotlin/org/eclipse/tractusx/bpdm/gate/api/model/PhysicalPostalAddressDto.kt similarity index 95% rename from bpdm-gate-api/src/main/kotlin/org/eclipse/tractusx/bpdm/gate/api/model/PhysicalPostalAddressGateDto.kt rename to bpdm-gate-api/src/main/kotlin/org/eclipse/tractusx/bpdm/gate/api/model/PhysicalPostalAddressDto.kt index 92287803d..16f27978f 100644 --- a/bpdm-gate-api/src/main/kotlin/org/eclipse/tractusx/bpdm/gate/api/model/PhysicalPostalAddressGateDto.kt +++ b/bpdm-gate-api/src/main/kotlin/org/eclipse/tractusx/bpdm/gate/api/model/PhysicalPostalAddressDto.kt @@ -29,34 +29,21 @@ import org.eclipse.tractusx.bpdm.common.service.DataClassUnwrappedJsonDeserializ @JsonDeserialize(using = DataClassUnwrappedJsonDeserializer::class) @Schema(description = PostalAddressDescription.headerPhysical) -data class PhysicalPostalAddressGateDto( +data class PhysicalPostalAddressDto( override val geographicCoordinates: GeoCoordinateDto? = null, - override val country: CountryCode? = null, - override val administrativeAreaLevel1: String? = null, - override val administrativeAreaLevel2: String? = null, - override val administrativeAreaLevel3: String? = null, - override val postalCode: String? = null, - override val city: String? = null, - override val district: String? = null, - - override val street: StreetGateDto? = null, - + override val street: StreetDto? = null, override val companyPostalCode: String? = null, - override val industrialZone: String? = null, - override val building: String? = null, - override val floor: String? = null, - override val door: String? = null ) : IBasePhysicalPostalAddressDto { diff --git a/bpdm-gate-api/src/main/kotlin/org/eclipse/tractusx/bpdm/gate/api/model/StreetGateDto.kt b/bpdm-gate-api/src/main/kotlin/org/eclipse/tractusx/bpdm/gate/api/model/StreetDto.kt similarity index 98% rename from bpdm-gate-api/src/main/kotlin/org/eclipse/tractusx/bpdm/gate/api/model/StreetGateDto.kt rename to bpdm-gate-api/src/main/kotlin/org/eclipse/tractusx/bpdm/gate/api/model/StreetDto.kt index 71f02fff5..1aad76d2a 100644 --- a/bpdm-gate-api/src/main/kotlin/org/eclipse/tractusx/bpdm/gate/api/model/StreetGateDto.kt +++ b/bpdm-gate-api/src/main/kotlin/org/eclipse/tractusx/bpdm/gate/api/model/StreetDto.kt @@ -24,7 +24,7 @@ import org.eclipse.tractusx.bpdm.common.dto.IStreetDetailedDto import org.eclipse.tractusx.bpdm.common.dto.openapidescription.StreetDescription @Schema(description = StreetDescription.header) -data class StreetGateDto( +data class StreetDto( override val namePrefix: String? = null, override val additionalNamePrefix: String? = null, diff --git a/bpdm-gate-api/src/main/kotlin/org/eclipse/tractusx/bpdm/gate/api/model/request/AddressGateInputRequest.kt b/bpdm-gate-api/src/main/kotlin/org/eclipse/tractusx/bpdm/gate/api/model/request/AddressGateInputRequest.kt index a0fd17f42..c9e4b87fc 100644 --- a/bpdm-gate-api/src/main/kotlin/org/eclipse/tractusx/bpdm/gate/api/model/request/AddressGateInputRequest.kt +++ b/bpdm-gate-api/src/main/kotlin/org/eclipse/tractusx/bpdm/gate/api/model/request/AddressGateInputRequest.kt @@ -25,14 +25,14 @@ import io.swagger.v3.oas.annotations.media.Schema import org.eclipse.tractusx.bpdm.common.dto.openapidescription.CommonDescription import org.eclipse.tractusx.bpdm.common.dto.openapidescription.LogisticAddressDescription import org.eclipse.tractusx.bpdm.common.service.DataClassUnwrappedJsonDeserializer -import org.eclipse.tractusx.bpdm.gate.api.model.LogisticAddressGateDto +import org.eclipse.tractusx.bpdm.gate.api.model.LogisticAddressDto @JsonDeserialize(using = DataClassUnwrappedJsonDeserializer::class) @Schema(description = LogisticAddressDescription.headerUpsertRequest) data class AddressGateInputRequest( @field:JsonUnwrapped - val address: LogisticAddressGateDto, + val address: LogisticAddressDto, @get:Schema(description = CommonDescription.externalId) val externalId: String, diff --git a/bpdm-gate-api/src/main/kotlin/org/eclipse/tractusx/bpdm/gate/api/model/request/AddressGateOutputRequest.kt b/bpdm-gate-api/src/main/kotlin/org/eclipse/tractusx/bpdm/gate/api/model/request/AddressGateOutputRequest.kt index 5117ed5f3..640e76fce 100644 --- a/bpdm-gate-api/src/main/kotlin/org/eclipse/tractusx/bpdm/gate/api/model/request/AddressGateOutputRequest.kt +++ b/bpdm-gate-api/src/main/kotlin/org/eclipse/tractusx/bpdm/gate/api/model/request/AddressGateOutputRequest.kt @@ -25,14 +25,14 @@ import io.swagger.v3.oas.annotations.media.Schema import org.eclipse.tractusx.bpdm.common.dto.openapidescription.CommonDescription import org.eclipse.tractusx.bpdm.common.dto.openapidescription.LogisticAddressDescription import org.eclipse.tractusx.bpdm.common.service.DataClassUnwrappedJsonDeserializer -import org.eclipse.tractusx.bpdm.gate.api.model.LogisticAddressGateDto +import org.eclipse.tractusx.bpdm.gate.api.model.LogisticAddressDto @JsonDeserialize(using = DataClassUnwrappedJsonDeserializer::class) @Schema(description = LogisticAddressDescription.headerUpsertRequest) data class AddressGateOutputRequest( - + @field:JsonUnwrapped - val address: LogisticAddressGateDto, + val address: LogisticAddressDto, @get:Schema(description = CommonDescription.externalId) val externalId: String, diff --git a/bpdm-gate-api/src/main/kotlin/org/eclipse/tractusx/bpdm/gate/api/model/request/LegalEntityGateInputRequest.kt b/bpdm-gate-api/src/main/kotlin/org/eclipse/tractusx/bpdm/gate/api/model/request/LegalEntityGateInputRequest.kt index a4c89aa6b..42695da2c 100644 --- a/bpdm-gate-api/src/main/kotlin/org/eclipse/tractusx/bpdm/gate/api/model/request/LegalEntityGateInputRequest.kt +++ b/bpdm-gate-api/src/main/kotlin/org/eclipse/tractusx/bpdm/gate/api/model/request/LegalEntityGateInputRequest.kt @@ -26,7 +26,7 @@ import org.eclipse.tractusx.bpdm.common.dto.openapidescription.CommonDescription import org.eclipse.tractusx.bpdm.common.dto.openapidescription.LegalEntityDescription import org.eclipse.tractusx.bpdm.common.service.DataClassUnwrappedJsonDeserializer import org.eclipse.tractusx.bpdm.gate.api.model.LegalEntityDto -import org.eclipse.tractusx.bpdm.gate.api.model.LogisticAddressGateDto +import org.eclipse.tractusx.bpdm.gate.api.model.LogisticAddressDto @JsonDeserialize(using = DataClassUnwrappedJsonDeserializer::class) @Schema(description = LegalEntityDescription.headerUpsertRequest) @@ -37,7 +37,7 @@ data class LegalEntityGateInputRequest( // TODO OpenAPI description for complex field does not work!! @get:Schema(description = LegalEntityDescription.legalAddress) - val legalAddress: LogisticAddressGateDto, + val legalAddress: LogisticAddressDto, @get:Schema(description = CommonDescription.externalId, required = true) val externalId: String diff --git a/bpdm-gate-api/src/main/kotlin/org/eclipse/tractusx/bpdm/gate/api/model/request/SiteGateInputRequest.kt b/bpdm-gate-api/src/main/kotlin/org/eclipse/tractusx/bpdm/gate/api/model/request/SiteGateInputRequest.kt index 54f908928..2bed8b0a7 100644 --- a/bpdm-gate-api/src/main/kotlin/org/eclipse/tractusx/bpdm/gate/api/model/request/SiteGateInputRequest.kt +++ b/bpdm-gate-api/src/main/kotlin/org/eclipse/tractusx/bpdm/gate/api/model/request/SiteGateInputRequest.kt @@ -25,7 +25,7 @@ import io.swagger.v3.oas.annotations.media.Schema import org.eclipse.tractusx.bpdm.common.dto.openapidescription.CommonDescription import org.eclipse.tractusx.bpdm.common.dto.openapidescription.SiteDescription import org.eclipse.tractusx.bpdm.common.service.DataClassUnwrappedJsonDeserializer -import org.eclipse.tractusx.bpdm.gate.api.model.LogisticAddressGateDto +import org.eclipse.tractusx.bpdm.gate.api.model.LogisticAddressDto import org.eclipse.tractusx.bpdm.gate.api.model.SiteGateDto @JsonDeserialize(using = DataClassUnwrappedJsonDeserializer::class) @@ -37,7 +37,7 @@ data class SiteGateInputRequest( // TODO OpenAPI description for complex field does not work!! @get:Schema(description = SiteDescription.mainAddress) - val mainAddress: LogisticAddressGateDto, + val mainAddress: LogisticAddressDto, @get:Schema(description = CommonDescription.externalId) val externalId: String, diff --git a/bpdm-gate-api/src/main/kotlin/org/eclipse/tractusx/bpdm/gate/api/model/response/AddressGateInputDto.kt b/bpdm-gate-api/src/main/kotlin/org/eclipse/tractusx/bpdm/gate/api/model/response/AddressGateInputDto.kt index 3b22ed029..73d58035d 100644 --- a/bpdm-gate-api/src/main/kotlin/org/eclipse/tractusx/bpdm/gate/api/model/response/AddressGateInputDto.kt +++ b/bpdm-gate-api/src/main/kotlin/org/eclipse/tractusx/bpdm/gate/api/model/response/AddressGateInputDto.kt @@ -25,7 +25,7 @@ import io.swagger.v3.oas.annotations.media.Schema import org.eclipse.tractusx.bpdm.common.dto.openapidescription.CommonDescription import org.eclipse.tractusx.bpdm.common.dto.openapidescription.LogisticAddressDescription import org.eclipse.tractusx.bpdm.common.service.DataClassUnwrappedJsonDeserializer -import org.eclipse.tractusx.bpdm.gate.api.model.LogisticAddressGateDto +import org.eclipse.tractusx.bpdm.gate.api.model.LogisticAddressDto // TODO rename to AddressGateInputResponse @JsonDeserialize(using = DataClassUnwrappedJsonDeserializer::class) @@ -33,7 +33,7 @@ import org.eclipse.tractusx.bpdm.gate.api.model.LogisticAddressGateDto data class AddressGateInputDto( @field:JsonUnwrapped - val address: LogisticAddressGateDto, + val address: LogisticAddressDto, @get:Schema(description = CommonDescription.externalId) val externalId: String, diff --git a/bpdm-gate-api/src/main/kotlin/org/eclipse/tractusx/bpdm/gate/api/model/response/AddressGateOutputDto.kt b/bpdm-gate-api/src/main/kotlin/org/eclipse/tractusx/bpdm/gate/api/model/response/AddressGateOutputDto.kt index 5f8b9930e..bafd51d4f 100644 --- a/bpdm-gate-api/src/main/kotlin/org/eclipse/tractusx/bpdm/gate/api/model/response/AddressGateOutputDto.kt +++ b/bpdm-gate-api/src/main/kotlin/org/eclipse/tractusx/bpdm/gate/api/model/response/AddressGateOutputDto.kt @@ -25,7 +25,7 @@ import io.swagger.v3.oas.annotations.media.Schema import org.eclipse.tractusx.bpdm.common.dto.openapidescription.CommonDescription import org.eclipse.tractusx.bpdm.common.dto.openapidescription.LogisticAddressDescription import org.eclipse.tractusx.bpdm.common.service.DataClassUnwrappedJsonDeserializer -import org.eclipse.tractusx.bpdm.gate.api.model.LogisticAddressGateDto +import org.eclipse.tractusx.bpdm.gate.api.model.LogisticAddressDto // TODO rename to AddressGateOutputResponse @JsonDeserialize(using = DataClassUnwrappedJsonDeserializer::class) @@ -33,7 +33,7 @@ import org.eclipse.tractusx.bpdm.gate.api.model.LogisticAddressGateDto data class AddressGateOutputDto( @field:JsonUnwrapped - val address: LogisticAddressGateDto, + val address: LogisticAddressDto, @get:Schema(description = CommonDescription.externalId) val externalId: String, diff --git a/bpdm-gate/src/main/kotlin/org/eclipse/tractusx/bpdm/gate/service/BusinessPartnerMappings.kt b/bpdm-gate/src/main/kotlin/org/eclipse/tractusx/bpdm/gate/service/BusinessPartnerMappings.kt index 6a69a8338..301e89f27 100644 --- a/bpdm-gate/src/main/kotlin/org/eclipse/tractusx/bpdm/gate/service/BusinessPartnerMappings.kt +++ b/bpdm-gate/src/main/kotlin/org/eclipse/tractusx/bpdm/gate/service/BusinessPartnerMappings.kt @@ -142,7 +142,7 @@ class BusinessPartnerMappings { ) private fun toPhysicalPostalAddressDto(entity: PhysicalPostalAddress) = - PhysicalPostalAddressGateDto( + PhysicalPostalAddressDto( geographicCoordinates = entity.geographicCoordinates?.let(::toGeoCoordinateDto), country = entity.country, administrativeAreaLevel1 = entity.administrativeAreaLevel1, @@ -160,15 +160,15 @@ class BusinessPartnerMappings { ) // convert empty DTO to null - private fun normalize(dto: PhysicalPostalAddressGateDto?) = - if (dto != PhysicalPostalAddressGateDto()) dto + private fun normalize(dto: PhysicalPostalAddressDto?) = + if (dto != PhysicalPostalAddressDto()) dto else null - private fun normalize(dto: AlternativePostalAddressGateDto?) = - if (dto != AlternativePostalAddressGateDto()) dto + private fun normalize(dto: AlternativePostalAddressDto?) = + if (dto != AlternativePostalAddressDto()) dto else null - private fun toPhysicalPostalAddress(dto: PhysicalPostalAddressGateDto) = + private fun toPhysicalPostalAddress(dto: PhysicalPostalAddressDto) = PhysicalPostalAddress( geographicCoordinates = dto.geographicCoordinates?.let(::toGeographicCoordinate), country = dto.country, @@ -188,7 +188,7 @@ class BusinessPartnerMappings { private fun toAlternativePostalAddressDto(entity: AlternativePostalAddress) = - AlternativePostalAddressGateDto( + AlternativePostalAddressDto( geographicCoordinates = entity.geographicCoordinates?.let(::toGeoCoordinateDto), country = entity.country, administrativeAreaLevel1 = entity.administrativeAreaLevel1, @@ -199,7 +199,7 @@ class BusinessPartnerMappings { deliveryServiceNumber = entity.deliveryServiceNumber ) - private fun toAlternativePostalAddress(dto: AlternativePostalAddressGateDto) = + private fun toAlternativePostalAddress(dto: AlternativePostalAddressDto) = AlternativePostalAddress( geographicCoordinates = dto.geographicCoordinates?.let(::toGeographicCoordinate), country = dto.country, @@ -213,7 +213,7 @@ class BusinessPartnerMappings { private fun toStreetDto(entity: Street) = - StreetGateDto( + StreetDto( name = entity.name, houseNumber = entity.houseNumber, milestone = entity.milestone, @@ -225,7 +225,7 @@ class BusinessPartnerMappings { ) - private fun toStreet(dto: StreetGateDto) = + private fun toStreet(dto: StreetDto) = Street( name = dto.name, houseNumber = dto.houseNumber, diff --git a/bpdm-gate/src/main/kotlin/org/eclipse/tractusx/bpdm/gate/service/ResponseMappings.kt b/bpdm-gate/src/main/kotlin/org/eclipse/tractusx/bpdm/gate/service/ResponseMappings.kt index 1524a7261..fc1720056 100644 --- a/bpdm-gate/src/main/kotlin/org/eclipse/tractusx/bpdm/gate/service/ResponseMappings.kt +++ b/bpdm-gate/src/main/kotlin/org/eclipse/tractusx/bpdm/gate/service/ResponseMappings.kt @@ -19,7 +19,9 @@ package org.eclipse.tractusx.bpdm.gate.service -import org.eclipse.tractusx.bpdm.common.dto.* +import org.eclipse.tractusx.bpdm.common.dto.BusinessPartnerRole +import org.eclipse.tractusx.bpdm.common.dto.BusinessPartnerType +import org.eclipse.tractusx.bpdm.common.dto.GeoCoordinateDto import org.eclipse.tractusx.bpdm.common.dto.response.PageDto import org.eclipse.tractusx.bpdm.common.model.StageType import org.eclipse.tractusx.bpdm.gate.api.model.* @@ -73,7 +75,7 @@ fun toNameParts(namePartsValue: String, address: LogisticAddress?, site: Site?, return NameParts(address, site, legalEntity, namePartsValue) } -fun AlternativePostalAddressGateDto.toAlternativePostalAddressEntity() = +fun AlternativePostalAddressDto.toAlternativePostalAddressEntity() = AlternativePostalAddress( geographicCoordinates = geographicCoordinates?.toGeographicCoordinateEntity(), country = country, @@ -85,7 +87,7 @@ fun AlternativePostalAddressGateDto.toAlternativePostalAddressEntity() = deliveryServiceQualifier = deliveryServiceQualifier ) -fun PhysicalPostalAddressGateDto.toPhysicalPostalAddressEntity() = +fun PhysicalPostalAddressDto.toPhysicalPostalAddressEntity() = PhysicalPostalAddress( geographicCoordinates = geographicCoordinates?.toGeographicCoordinateEntity(), country = country, @@ -111,7 +113,7 @@ fun GeoCoordinateDto.toGeographicCoordinateEntity(): GeographicCoordinate { ) } -private fun StreetGateDto.toStreetEntity(): Street { +private fun StreetDto.toStreetEntity(): Street { return Street( name = name, houseNumber = houseNumber, @@ -282,9 +284,9 @@ fun LogisticAddress.toAddressGateInputResponse(logisticAddressPage: LogisticAddr } //Logistic Address mapping to LogisticAddressDto -fun LogisticAddress.toLogisticAddressDto(): LogisticAddressGateDto { +fun LogisticAddress.toLogisticAddressDto(): LogisticAddressDto { - return LogisticAddressGateDto( + return LogisticAddressDto( nameParts = getNamePartValues(nameParts), states = mapToDtoStates(states), roles = roles.map { it.roleName }, @@ -303,7 +305,7 @@ fun mapToDtoStates(states: MutableSet): Collection, - - // OpenAPI description for complex field does not work! override val administrativeAreaLevel1: RegionDto?, - override val postalCode: String?, - override val city: String, - override val deliveryServiceType: DeliveryServiceType, - override val deliveryServiceQualifier: String?, - override val deliveryServiceNumber: String ) : IBaseAlternativePostalAddressDto { @@ -59,3 +50,4 @@ data class AlternativePostalAddressVerboseDto( return country.technicalKey } } + diff --git a/bpdm-common/src/main/kotlin/org/eclipse/tractusx/bpdm/common/dto/response/CountrySubdivisionDto.kt b/bpdm-pool-api/src/main/kotlin/org/eclipse/tractusx/bpdm/pool/api/model/CountrySubdivisionDto.kt similarity index 96% rename from bpdm-common/src/main/kotlin/org/eclipse/tractusx/bpdm/common/dto/response/CountrySubdivisionDto.kt rename to bpdm-pool-api/src/main/kotlin/org/eclipse/tractusx/bpdm/pool/api/model/CountrySubdivisionDto.kt index 6bbb6206f..4643ac448 100644 --- a/bpdm-common/src/main/kotlin/org/eclipse/tractusx/bpdm/common/dto/response/CountrySubdivisionDto.kt +++ b/bpdm-pool-api/src/main/kotlin/org/eclipse/tractusx/bpdm/pool/api/model/CountrySubdivisionDto.kt @@ -17,7 +17,7 @@ * SPDX-License-Identifier: Apache-2.0 ******************************************************************************/ -package org.eclipse.tractusx.bpdm.common.dto.response +package org.eclipse.tractusx.bpdm.pool.api.model import com.neovisionaries.i18n.CountryCode import io.swagger.v3.oas.annotations.media.Schema diff --git a/bpdm-common/src/main/kotlin/org/eclipse/tractusx/bpdm/common/dto/LogisticAddressDto.kt b/bpdm-pool-api/src/main/kotlin/org/eclipse/tractusx/bpdm/pool/api/model/LogisticAddressDto.kt similarity index 92% rename from bpdm-common/src/main/kotlin/org/eclipse/tractusx/bpdm/common/dto/LogisticAddressDto.kt rename to bpdm-pool-api/src/main/kotlin/org/eclipse/tractusx/bpdm/pool/api/model/LogisticAddressDto.kt index c6502e8d7..15321145f 100644 --- a/bpdm-common/src/main/kotlin/org/eclipse/tractusx/bpdm/common/dto/LogisticAddressDto.kt +++ b/bpdm-pool-api/src/main/kotlin/org/eclipse/tractusx/bpdm/pool/api/model/LogisticAddressDto.kt @@ -17,10 +17,11 @@ * SPDX-License-Identifier: Apache-2.0 ******************************************************************************/ -package org.eclipse.tractusx.bpdm.common.dto +package org.eclipse.tractusx.bpdm.pool.api.model import io.swagger.v3.oas.annotations.media.ArraySchema import io.swagger.v3.oas.annotations.media.Schema +import org.eclipse.tractusx.bpdm.common.dto.IBaseLogisticAddressDto import org.eclipse.tractusx.bpdm.common.dto.openapidescription.LogisticAddressDescription @Schema(description = LogisticAddressDescription.header) @@ -38,4 +39,5 @@ data class LogisticAddressDto( override val physicalPostalAddress: PhysicalPostalAddressDto, override val alternativePostalAddress: AlternativePostalAddressDto? = null -) : IBaseLogisticAddressDto \ No newline at end of file + +) : IBaseLogisticAddressDto diff --git a/bpdm-common/src/main/kotlin/org/eclipse/tractusx/bpdm/common/dto/response/LogisticAddressVerboseDto.kt b/bpdm-pool-api/src/main/kotlin/org/eclipse/tractusx/bpdm/pool/api/model/LogisticAddressVerboseDto.kt similarity index 98% rename from bpdm-common/src/main/kotlin/org/eclipse/tractusx/bpdm/common/dto/response/LogisticAddressVerboseDto.kt rename to bpdm-pool-api/src/main/kotlin/org/eclipse/tractusx/bpdm/pool/api/model/LogisticAddressVerboseDto.kt index cbaa6b59c..2d51bb237 100644 --- a/bpdm-common/src/main/kotlin/org/eclipse/tractusx/bpdm/common/dto/response/LogisticAddressVerboseDto.kt +++ b/bpdm-pool-api/src/main/kotlin/org/eclipse/tractusx/bpdm/pool/api/model/LogisticAddressVerboseDto.kt @@ -17,7 +17,7 @@ * SPDX-License-Identifier: Apache-2.0 ******************************************************************************/ -package org.eclipse.tractusx.bpdm.common.dto.response +package org.eclipse.tractusx.bpdm.pool.api.model import io.swagger.v3.oas.annotations.media.ArraySchema import io.swagger.v3.oas.annotations.media.Schema @@ -25,7 +25,6 @@ import org.eclipse.tractusx.bpdm.common.dto.openapidescription.CommonDescription import org.eclipse.tractusx.bpdm.common.dto.openapidescription.LogisticAddressDescription import java.time.Instant - @Schema(description = LogisticAddressDescription.header) data class LogisticAddressVerboseDto( @@ -66,4 +65,4 @@ data class LogisticAddressVerboseDto( @get:Schema(description = CommonDescription.updatedAt) val updatedAt: Instant -) \ No newline at end of file +) diff --git a/bpdm-common/src/main/kotlin/org/eclipse/tractusx/bpdm/common/dto/PhysicalPostalAddressDto.kt b/bpdm-pool-api/src/main/kotlin/org/eclipse/tractusx/bpdm/pool/api/model/PhysicalPostalAddressDto.kt similarity index 92% rename from bpdm-common/src/main/kotlin/org/eclipse/tractusx/bpdm/common/dto/PhysicalPostalAddressDto.kt rename to bpdm-pool-api/src/main/kotlin/org/eclipse/tractusx/bpdm/pool/api/model/PhysicalPostalAddressDto.kt index 9076674ff..52d8ed0c1 100644 --- a/bpdm-common/src/main/kotlin/org/eclipse/tractusx/bpdm/common/dto/PhysicalPostalAddressDto.kt +++ b/bpdm-pool-api/src/main/kotlin/org/eclipse/tractusx/bpdm/pool/api/model/PhysicalPostalAddressDto.kt @@ -17,11 +17,13 @@ * SPDX-License-Identifier: Apache-2.0 ******************************************************************************/ -package org.eclipse.tractusx.bpdm.common.dto +package org.eclipse.tractusx.bpdm.pool.api.model import com.fasterxml.jackson.databind.annotation.JsonDeserialize import com.neovisionaries.i18n.CountryCode import io.swagger.v3.oas.annotations.media.Schema +import org.eclipse.tractusx.bpdm.common.dto.GeoCoordinateDto +import org.eclipse.tractusx.bpdm.common.dto.IBasePhysicalPostalAddressDto import org.eclipse.tractusx.bpdm.common.dto.openapidescription.PostalAddressDescription import org.eclipse.tractusx.bpdm.common.service.DataClassUnwrappedJsonDeserializer @@ -30,31 +32,18 @@ import org.eclipse.tractusx.bpdm.common.service.DataClassUnwrappedJsonDeserializ data class PhysicalPostalAddressDto( override val geographicCoordinates: GeoCoordinateDto?, - override val country: CountryCode, - override val administrativeAreaLevel1: String?, - override val administrativeAreaLevel2: String?, - override val administrativeAreaLevel3: String?, - override val postalCode: String?, - override val city: String, - override val district: String?, - override val street: StreetDto?, - override val companyPostalCode: String?, - override val industrialZone: String?, - override val building: String?, - override val floor: String?, - override val door: String? ) : IBasePhysicalPostalAddressDto { diff --git a/bpdm-common/src/main/kotlin/org/eclipse/tractusx/bpdm/common/dto/response/PhysicalPostalAddressVerboseDto.kt b/bpdm-pool-api/src/main/kotlin/org/eclipse/tractusx/bpdm/pool/api/model/PhysicalPostalAddressVerboseDto.kt similarity index 91% rename from bpdm-common/src/main/kotlin/org/eclipse/tractusx/bpdm/common/dto/response/PhysicalPostalAddressVerboseDto.kt rename to bpdm-pool-api/src/main/kotlin/org/eclipse/tractusx/bpdm/pool/api/model/PhysicalPostalAddressVerboseDto.kt index ec1383a3d..4c61686ac 100644 --- a/bpdm-common/src/main/kotlin/org/eclipse/tractusx/bpdm/common/dto/response/PhysicalPostalAddressVerboseDto.kt +++ b/bpdm-pool-api/src/main/kotlin/org/eclipse/tractusx/bpdm/pool/api/model/PhysicalPostalAddressVerboseDto.kt @@ -17,14 +17,13 @@ * SPDX-License-Identifier: Apache-2.0 ******************************************************************************/ -package org.eclipse.tractusx.bpdm.common.dto.response +package org.eclipse.tractusx.bpdm.pool.api.model import com.fasterxml.jackson.databind.annotation.JsonDeserialize import com.neovisionaries.i18n.CountryCode import io.swagger.v3.oas.annotations.media.Schema import org.eclipse.tractusx.bpdm.common.dto.GeoCoordinateDto import org.eclipse.tractusx.bpdm.common.dto.IBasePhysicalPostalAddressDto -import org.eclipse.tractusx.bpdm.common.dto.StreetDto import org.eclipse.tractusx.bpdm.common.dto.openapidescription.PostalAddressDescription import org.eclipse.tractusx.bpdm.common.dto.response.type.TypeKeyNameVerboseDto import org.eclipse.tractusx.bpdm.common.service.DataClassUnwrappedJsonDeserializer @@ -34,33 +33,18 @@ import org.eclipse.tractusx.bpdm.common.service.DataClassUnwrappedJsonDeserializ data class PhysicalPostalAddressVerboseDto( override val geographicCoordinates: GeoCoordinateDto?, - - // OpenAPI description for complex field does not work! override val country: TypeKeyNameVerboseDto, - - // OpenAPI description for complex field does not work! override val administrativeAreaLevel1: RegionDto?, - override val administrativeAreaLevel2: String?, - override val administrativeAreaLevel3: String?, - override val postalCode: String?, - override val city: String, - override val district: String?, - override val street: StreetDto?, - override val companyPostalCode: String?, - override val industrialZone: String?, - override val building: String?, - override val floor: String?, - override val door: String? ) : IBasePhysicalPostalAddressDto { diff --git a/bpdm-common/src/main/kotlin/org/eclipse/tractusx/bpdm/common/dto/response/RegionDto.kt b/bpdm-pool-api/src/main/kotlin/org/eclipse/tractusx/bpdm/pool/api/model/RegionDto.kt similarity index 96% rename from bpdm-common/src/main/kotlin/org/eclipse/tractusx/bpdm/common/dto/response/RegionDto.kt rename to bpdm-pool-api/src/main/kotlin/org/eclipse/tractusx/bpdm/pool/api/model/RegionDto.kt index 25d179671..5078cebb7 100644 --- a/bpdm-common/src/main/kotlin/org/eclipse/tractusx/bpdm/common/dto/response/RegionDto.kt +++ b/bpdm-pool-api/src/main/kotlin/org/eclipse/tractusx/bpdm/pool/api/model/RegionDto.kt @@ -17,7 +17,7 @@ * SPDX-License-Identifier: Apache-2.0 ******************************************************************************/ -package org.eclipse.tractusx.bpdm.common.dto.response +package org.eclipse.tractusx.bpdm.pool.api.model import com.neovisionaries.i18n.CountryCode import io.swagger.v3.oas.annotations.media.Schema diff --git a/bpdm-pool-api/src/main/kotlin/org/eclipse/tractusx/bpdm/pool/api/model/SiteDto.kt b/bpdm-pool-api/src/main/kotlin/org/eclipse/tractusx/bpdm/pool/api/model/SiteDto.kt index 193a89fe7..5303c8de0 100644 --- a/bpdm-pool-api/src/main/kotlin/org/eclipse/tractusx/bpdm/pool/api/model/SiteDto.kt +++ b/bpdm-pool-api/src/main/kotlin/org/eclipse/tractusx/bpdm/pool/api/model/SiteDto.kt @@ -21,7 +21,6 @@ package org.eclipse.tractusx.bpdm.pool.api.model import io.swagger.v3.oas.annotations.media.Schema import org.eclipse.tractusx.bpdm.common.dto.IBaseSiteDto -import org.eclipse.tractusx.bpdm.common.dto.LogisticAddressDto import org.eclipse.tractusx.bpdm.common.dto.openapidescription.SiteDescription @Schema(description = SiteDescription.header) diff --git a/bpdm-common/src/main/kotlin/org/eclipse/tractusx/bpdm/common/dto/StreetDto.kt b/bpdm-pool-api/src/main/kotlin/org/eclipse/tractusx/bpdm/pool/api/model/StreetDto.kt similarity index 92% rename from bpdm-common/src/main/kotlin/org/eclipse/tractusx/bpdm/common/dto/StreetDto.kt rename to bpdm-pool-api/src/main/kotlin/org/eclipse/tractusx/bpdm/pool/api/model/StreetDto.kt index 75a5ad95e..5a7276335 100644 --- a/bpdm-common/src/main/kotlin/org/eclipse/tractusx/bpdm/common/dto/StreetDto.kt +++ b/bpdm-pool-api/src/main/kotlin/org/eclipse/tractusx/bpdm/pool/api/model/StreetDto.kt @@ -17,9 +17,10 @@ * SPDX-License-Identifier: Apache-2.0 ******************************************************************************/ -package org.eclipse.tractusx.bpdm.common.dto +package org.eclipse.tractusx.bpdm.pool.api.model import io.swagger.v3.oas.annotations.media.Schema +import org.eclipse.tractusx.bpdm.common.dto.IBaseStreetDto import org.eclipse.tractusx.bpdm.common.dto.openapidescription.StreetDescription @Schema(description = StreetDescription.header) diff --git a/bpdm-common/src/main/kotlin/org/eclipse/tractusx/bpdm/common/dto/request/AddressPartnerBpnSearchRequest.kt b/bpdm-pool-api/src/main/kotlin/org/eclipse/tractusx/bpdm/pool/api/model/request/AddressPartnerBpnSearchRequest.kt similarity index 96% rename from bpdm-common/src/main/kotlin/org/eclipse/tractusx/bpdm/common/dto/request/AddressPartnerBpnSearchRequest.kt rename to bpdm-pool-api/src/main/kotlin/org/eclipse/tractusx/bpdm/pool/api/model/request/AddressPartnerBpnSearchRequest.kt index 4c593d4ac..f9fb78e5a 100644 --- a/bpdm-common/src/main/kotlin/org/eclipse/tractusx/bpdm/common/dto/request/AddressPartnerBpnSearchRequest.kt +++ b/bpdm-pool-api/src/main/kotlin/org/eclipse/tractusx/bpdm/pool/api/model/request/AddressPartnerBpnSearchRequest.kt @@ -17,7 +17,7 @@ * SPDX-License-Identifier: Apache-2.0 ******************************************************************************/ -package org.eclipse.tractusx.bpdm.common.dto.request +package org.eclipse.tractusx.bpdm.pool.api.model.request import io.swagger.v3.oas.annotations.media.Schema diff --git a/bpdm-pool-api/src/main/kotlin/org/eclipse/tractusx/bpdm/pool/api/model/request/AddressPartnerCreateRequest.kt b/bpdm-pool-api/src/main/kotlin/org/eclipse/tractusx/bpdm/pool/api/model/request/AddressPartnerCreateRequest.kt index 87d99e47b..ca7be5503 100644 --- a/bpdm-pool-api/src/main/kotlin/org/eclipse/tractusx/bpdm/pool/api/model/request/AddressPartnerCreateRequest.kt +++ b/bpdm-pool-api/src/main/kotlin/org/eclipse/tractusx/bpdm/pool/api/model/request/AddressPartnerCreateRequest.kt @@ -22,11 +22,11 @@ package org.eclipse.tractusx.bpdm.pool.api.model.request import com.fasterxml.jackson.annotation.JsonUnwrapped import com.fasterxml.jackson.databind.annotation.JsonDeserialize import io.swagger.v3.oas.annotations.media.Schema -import org.eclipse.tractusx.bpdm.common.dto.LogisticAddressDto import org.eclipse.tractusx.bpdm.common.dto.RequestWithKey import org.eclipse.tractusx.bpdm.common.dto.openapidescription.CommonDescription import org.eclipse.tractusx.bpdm.common.dto.openapidescription.LogisticAddressDescription import org.eclipse.tractusx.bpdm.common.service.DataClassUnwrappedJsonDeserializer +import org.eclipse.tractusx.bpdm.pool.api.model.LogisticAddressDto @JsonDeserialize(using = DataClassUnwrappedJsonDeserializer::class) @Schema(description = LogisticAddressDescription.headerCreateRequest) diff --git a/bpdm-pool-api/src/main/kotlin/org/eclipse/tractusx/bpdm/pool/api/model/request/AddressPartnerUpdateRequest.kt b/bpdm-pool-api/src/main/kotlin/org/eclipse/tractusx/bpdm/pool/api/model/request/AddressPartnerUpdateRequest.kt index 1b2912d76..5a1e0832e 100644 --- a/bpdm-pool-api/src/main/kotlin/org/eclipse/tractusx/bpdm/pool/api/model/request/AddressPartnerUpdateRequest.kt +++ b/bpdm-pool-api/src/main/kotlin/org/eclipse/tractusx/bpdm/pool/api/model/request/AddressPartnerUpdateRequest.kt @@ -22,10 +22,10 @@ package org.eclipse.tractusx.bpdm.pool.api.model.request import com.fasterxml.jackson.annotation.JsonUnwrapped import com.fasterxml.jackson.databind.annotation.JsonDeserialize import io.swagger.v3.oas.annotations.media.Schema -import org.eclipse.tractusx.bpdm.common.dto.LogisticAddressDto import org.eclipse.tractusx.bpdm.common.dto.RequestWithKey import org.eclipse.tractusx.bpdm.common.dto.openapidescription.LogisticAddressDescription import org.eclipse.tractusx.bpdm.common.service.DataClassUnwrappedJsonDeserializer +import org.eclipse.tractusx.bpdm.pool.api.model.LogisticAddressDto @JsonDeserialize(using = DataClassUnwrappedJsonDeserializer::class) @Schema(description = LogisticAddressDescription.headerUpdateRequest) @@ -36,8 +36,9 @@ data class AddressPartnerUpdateRequest( @field:JsonUnwrapped val address: LogisticAddressDto + ): RequestWithKey { - override fun getRequestKey(): String? { + override fun getRequestKey(): String { return bpna } } diff --git a/bpdm-pool-api/src/main/kotlin/org/eclipse/tractusx/bpdm/pool/api/model/request/LegalEntityPartnerCreateRequest.kt b/bpdm-pool-api/src/main/kotlin/org/eclipse/tractusx/bpdm/pool/api/model/request/LegalEntityPartnerCreateRequest.kt index a50754c36..79ce18413 100644 --- a/bpdm-pool-api/src/main/kotlin/org/eclipse/tractusx/bpdm/pool/api/model/request/LegalEntityPartnerCreateRequest.kt +++ b/bpdm-pool-api/src/main/kotlin/org/eclipse/tractusx/bpdm/pool/api/model/request/LegalEntityPartnerCreateRequest.kt @@ -22,12 +22,12 @@ package org.eclipse.tractusx.bpdm.pool.api.model.request import com.fasterxml.jackson.annotation.JsonUnwrapped import com.fasterxml.jackson.databind.annotation.JsonDeserialize import io.swagger.v3.oas.annotations.media.Schema -import org.eclipse.tractusx.bpdm.common.dto.LogisticAddressDto import org.eclipse.tractusx.bpdm.common.dto.RequestWithKey import org.eclipse.tractusx.bpdm.common.dto.openapidescription.CommonDescription import org.eclipse.tractusx.bpdm.common.dto.openapidescription.LegalEntityDescription import org.eclipse.tractusx.bpdm.common.service.DataClassUnwrappedJsonDeserializer import org.eclipse.tractusx.bpdm.pool.api.model.LegalEntityDto +import org.eclipse.tractusx.bpdm.pool.api.model.LogisticAddressDto @JsonDeserialize(using = DataClassUnwrappedJsonDeserializer::class) @Schema(description = LegalEntityDescription.headerCreateRequest) diff --git a/bpdm-pool-api/src/main/kotlin/org/eclipse/tractusx/bpdm/pool/api/model/request/LegalEntityPartnerUpdateRequest.kt b/bpdm-pool-api/src/main/kotlin/org/eclipse/tractusx/bpdm/pool/api/model/request/LegalEntityPartnerUpdateRequest.kt index c60a87964..bb47888b7 100644 --- a/bpdm-pool-api/src/main/kotlin/org/eclipse/tractusx/bpdm/pool/api/model/request/LegalEntityPartnerUpdateRequest.kt +++ b/bpdm-pool-api/src/main/kotlin/org/eclipse/tractusx/bpdm/pool/api/model/request/LegalEntityPartnerUpdateRequest.kt @@ -22,11 +22,11 @@ package org.eclipse.tractusx.bpdm.pool.api.model.request import com.fasterxml.jackson.annotation.JsonUnwrapped import com.fasterxml.jackson.databind.annotation.JsonDeserialize import io.swagger.v3.oas.annotations.media.Schema -import org.eclipse.tractusx.bpdm.common.dto.LogisticAddressDto import org.eclipse.tractusx.bpdm.common.dto.RequestWithKey import org.eclipse.tractusx.bpdm.common.dto.openapidescription.LegalEntityDescription import org.eclipse.tractusx.bpdm.common.service.DataClassUnwrappedJsonDeserializer import org.eclipse.tractusx.bpdm.pool.api.model.LegalEntityDto +import org.eclipse.tractusx.bpdm.pool.api.model.LogisticAddressDto @JsonDeserialize(using = DataClassUnwrappedJsonDeserializer::class) @Schema(description = LegalEntityDescription.headerUpdateRequest) diff --git a/bpdm-pool-api/src/main/kotlin/org/eclipse/tractusx/bpdm/pool/api/model/response/AddressMatchVerboseDto.kt b/bpdm-pool-api/src/main/kotlin/org/eclipse/tractusx/bpdm/pool/api/model/response/AddressMatchVerboseDto.kt index 2adddca94..aacf04892 100644 --- a/bpdm-pool-api/src/main/kotlin/org/eclipse/tractusx/bpdm/pool/api/model/response/AddressMatchVerboseDto.kt +++ b/bpdm-pool-api/src/main/kotlin/org/eclipse/tractusx/bpdm/pool/api/model/response/AddressMatchVerboseDto.kt @@ -22,7 +22,7 @@ package org.eclipse.tractusx.bpdm.pool.api.model.response import io.swagger.v3.oas.annotations.media.Schema import org.eclipse.tractusx.bpdm.common.dto.openapidescription.CommonDescription import org.eclipse.tractusx.bpdm.common.dto.openapidescription.LogisticAddressDescription -import org.eclipse.tractusx.bpdm.common.dto.response.LogisticAddressVerboseDto +import org.eclipse.tractusx.bpdm.pool.api.model.LogisticAddressVerboseDto @Schema(description = LogisticAddressDescription.headerMatchResponse) diff --git a/bpdm-pool-api/src/main/kotlin/org/eclipse/tractusx/bpdm/pool/api/model/response/AddressPartnerCreateVerboseDto.kt b/bpdm-pool-api/src/main/kotlin/org/eclipse/tractusx/bpdm/pool/api/model/response/AddressPartnerCreateVerboseDto.kt index b6341704a..5dcda8336 100644 --- a/bpdm-pool-api/src/main/kotlin/org/eclipse/tractusx/bpdm/pool/api/model/response/AddressPartnerCreateVerboseDto.kt +++ b/bpdm-pool-api/src/main/kotlin/org/eclipse/tractusx/bpdm/pool/api/model/response/AddressPartnerCreateVerboseDto.kt @@ -24,8 +24,8 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize import io.swagger.v3.oas.annotations.media.Schema import org.eclipse.tractusx.bpdm.common.dto.openapidescription.CommonDescription import org.eclipse.tractusx.bpdm.common.dto.openapidescription.LogisticAddressDescription -import org.eclipse.tractusx.bpdm.common.dto.response.LogisticAddressVerboseDto import org.eclipse.tractusx.bpdm.common.service.DataClassUnwrappedJsonDeserializer +import org.eclipse.tractusx.bpdm.pool.api.model.LogisticAddressVerboseDto @JsonDeserialize(using = DataClassUnwrappedJsonDeserializer::class) @Schema(description = LogisticAddressDescription.headerCreateResponse) diff --git a/bpdm-pool-api/src/main/kotlin/org/eclipse/tractusx/bpdm/pool/api/model/response/EntitiesWithErrors.kt b/bpdm-pool-api/src/main/kotlin/org/eclipse/tractusx/bpdm/pool/api/model/response/EntitiesWithErrors.kt index 0d1e2917b..f51bf0787 100644 --- a/bpdm-pool-api/src/main/kotlin/org/eclipse/tractusx/bpdm/pool/api/model/response/EntitiesWithErrors.kt +++ b/bpdm-pool-api/src/main/kotlin/org/eclipse/tractusx/bpdm/pool/api/model/response/EntitiesWithErrors.kt @@ -21,7 +21,7 @@ package org.eclipse.tractusx.bpdm.pool.api.model.response import io.swagger.v3.oas.annotations.media.Schema import org.eclipse.tractusx.bpdm.common.dto.openapidescription.CommonDescription -import org.eclipse.tractusx.bpdm.common.dto.response.LogisticAddressVerboseDto +import org.eclipse.tractusx.bpdm.pool.api.model.LogisticAddressVerboseDto open class EntitiesWithErrors( diff --git a/bpdm-pool-api/src/main/kotlin/org/eclipse/tractusx/bpdm/pool/api/model/response/LegalAddressVerboseDto.kt b/bpdm-pool-api/src/main/kotlin/org/eclipse/tractusx/bpdm/pool/api/model/response/LegalAddressVerboseDto.kt index 50b32da7e..fc5b10fef 100644 --- a/bpdm-pool-api/src/main/kotlin/org/eclipse/tractusx/bpdm/pool/api/model/response/LegalAddressVerboseDto.kt +++ b/bpdm-pool-api/src/main/kotlin/org/eclipse/tractusx/bpdm/pool/api/model/response/LegalAddressVerboseDto.kt @@ -20,8 +20,8 @@ package org.eclipse.tractusx.bpdm.pool.api.model.response import io.swagger.v3.oas.annotations.media.Schema -import org.eclipse.tractusx.bpdm.common.dto.response.AlternativePostalAddressVerboseDto -import org.eclipse.tractusx.bpdm.common.dto.response.PhysicalPostalAddressVerboseDto +import org.eclipse.tractusx.bpdm.pool.api.model.AlternativePostalAddressVerboseDto +import org.eclipse.tractusx.bpdm.pool.api.model.PhysicalPostalAddressVerboseDto import java.time.Instant @Schema(name = "LegalAddressVerboseDto", description = "Legal address for legal entity") diff --git a/bpdm-pool-api/src/main/kotlin/org/eclipse/tractusx/bpdm/pool/api/model/response/LegalEntityMatchVerboseDto.kt b/bpdm-pool-api/src/main/kotlin/org/eclipse/tractusx/bpdm/pool/api/model/response/LegalEntityMatchVerboseDto.kt index 9cb65a0e9..2c41258e4 100644 --- a/bpdm-pool-api/src/main/kotlin/org/eclipse/tractusx/bpdm/pool/api/model/response/LegalEntityMatchVerboseDto.kt +++ b/bpdm-pool-api/src/main/kotlin/org/eclipse/tractusx/bpdm/pool/api/model/response/LegalEntityMatchVerboseDto.kt @@ -24,9 +24,9 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize import io.swagger.v3.oas.annotations.media.Schema import org.eclipse.tractusx.bpdm.common.dto.openapidescription.CommonDescription import org.eclipse.tractusx.bpdm.common.dto.openapidescription.LegalEntityDescription -import org.eclipse.tractusx.bpdm.common.dto.response.LogisticAddressVerboseDto import org.eclipse.tractusx.bpdm.common.service.DataClassUnwrappedJsonDeserializer import org.eclipse.tractusx.bpdm.pool.api.model.LegalEntityVerboseDto +import org.eclipse.tractusx.bpdm.pool.api.model.LogisticAddressVerboseDto @JsonDeserialize(using = DataClassUnwrappedJsonDeserializer::class) @Schema(description = LegalEntityDescription.headerMatchResponse) diff --git a/bpdm-pool-api/src/main/kotlin/org/eclipse/tractusx/bpdm/pool/api/model/response/LegalEntityPartnerCreateVerboseDto.kt b/bpdm-pool-api/src/main/kotlin/org/eclipse/tractusx/bpdm/pool/api/model/response/LegalEntityPartnerCreateVerboseDto.kt index 61cc11934..6ccf30a4e 100644 --- a/bpdm-pool-api/src/main/kotlin/org/eclipse/tractusx/bpdm/pool/api/model/response/LegalEntityPartnerCreateVerboseDto.kt +++ b/bpdm-pool-api/src/main/kotlin/org/eclipse/tractusx/bpdm/pool/api/model/response/LegalEntityPartnerCreateVerboseDto.kt @@ -24,9 +24,9 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize import io.swagger.v3.oas.annotations.media.Schema import org.eclipse.tractusx.bpdm.common.dto.openapidescription.CommonDescription import org.eclipse.tractusx.bpdm.common.dto.openapidescription.LegalEntityDescription -import org.eclipse.tractusx.bpdm.common.dto.response.LogisticAddressVerboseDto import org.eclipse.tractusx.bpdm.common.service.DataClassUnwrappedJsonDeserializer import org.eclipse.tractusx.bpdm.pool.api.model.LegalEntityVerboseDto +import org.eclipse.tractusx.bpdm.pool.api.model.LogisticAddressVerboseDto @JsonDeserialize(using = DataClassUnwrappedJsonDeserializer::class) @Schema(description = LegalEntityDescription.headerUpsertResponse) diff --git a/bpdm-pool-api/src/main/kotlin/org/eclipse/tractusx/bpdm/pool/api/model/response/LegalEntityWithLegalAddressVerboseDto.kt b/bpdm-pool-api/src/main/kotlin/org/eclipse/tractusx/bpdm/pool/api/model/response/LegalEntityWithLegalAddressVerboseDto.kt index a0c212f15..842347c6d 100644 --- a/bpdm-pool-api/src/main/kotlin/org/eclipse/tractusx/bpdm/pool/api/model/response/LegalEntityWithLegalAddressVerboseDto.kt +++ b/bpdm-pool-api/src/main/kotlin/org/eclipse/tractusx/bpdm/pool/api/model/response/LegalEntityWithLegalAddressVerboseDto.kt @@ -23,9 +23,9 @@ import com.fasterxml.jackson.annotation.JsonUnwrapped import com.fasterxml.jackson.databind.annotation.JsonDeserialize import io.swagger.v3.oas.annotations.media.Schema import org.eclipse.tractusx.bpdm.common.dto.openapidescription.LegalEntityDescription -import org.eclipse.tractusx.bpdm.common.dto.response.LogisticAddressVerboseDto import org.eclipse.tractusx.bpdm.common.service.DataClassUnwrappedJsonDeserializer import org.eclipse.tractusx.bpdm.pool.api.model.LegalEntityVerboseDto +import org.eclipse.tractusx.bpdm.pool.api.model.LogisticAddressVerboseDto @JsonDeserialize(using = DataClassUnwrappedJsonDeserializer::class) @Schema(description = LegalEntityDescription.header) diff --git a/bpdm-pool-api/src/main/kotlin/org/eclipse/tractusx/bpdm/pool/api/model/response/MainAddressVerboseDto.kt b/bpdm-pool-api/src/main/kotlin/org/eclipse/tractusx/bpdm/pool/api/model/response/MainAddressVerboseDto.kt index 2f5d6aaf5..6c6bf7393 100644 --- a/bpdm-pool-api/src/main/kotlin/org/eclipse/tractusx/bpdm/pool/api/model/response/MainAddressVerboseDto.kt +++ b/bpdm-pool-api/src/main/kotlin/org/eclipse/tractusx/bpdm/pool/api/model/response/MainAddressVerboseDto.kt @@ -20,8 +20,8 @@ package org.eclipse.tractusx.bpdm.pool.api.model.response import io.swagger.v3.oas.annotations.media.Schema -import org.eclipse.tractusx.bpdm.common.dto.response.AlternativePostalAddressVerboseDto -import org.eclipse.tractusx.bpdm.common.dto.response.PhysicalPostalAddressVerboseDto +import org.eclipse.tractusx.bpdm.pool.api.model.AlternativePostalAddressVerboseDto +import org.eclipse.tractusx.bpdm.pool.api.model.PhysicalPostalAddressVerboseDto import java.time.Instant @Schema(name = "MainAddressResponse", description = "Main address for site") diff --git a/bpdm-pool-api/src/main/kotlin/org/eclipse/tractusx/bpdm/pool/api/model/response/SiteMatchVerboseDto.kt b/bpdm-pool-api/src/main/kotlin/org/eclipse/tractusx/bpdm/pool/api/model/response/SiteMatchVerboseDto.kt index d137012fb..aff682bdc 100644 --- a/bpdm-pool-api/src/main/kotlin/org/eclipse/tractusx/bpdm/pool/api/model/response/SiteMatchVerboseDto.kt +++ b/bpdm-pool-api/src/main/kotlin/org/eclipse/tractusx/bpdm/pool/api/model/response/SiteMatchVerboseDto.kt @@ -22,8 +22,8 @@ package org.eclipse.tractusx.bpdm.pool.api.model.response import com.fasterxml.jackson.databind.annotation.JsonDeserialize import io.swagger.v3.oas.annotations.media.Schema import org.eclipse.tractusx.bpdm.common.dto.openapidescription.SiteDescription -import org.eclipse.tractusx.bpdm.common.dto.response.LogisticAddressVerboseDto import org.eclipse.tractusx.bpdm.common.service.DataClassUnwrappedJsonDeserializer +import org.eclipse.tractusx.bpdm.pool.api.model.LogisticAddressVerboseDto import org.eclipse.tractusx.bpdm.pool.api.model.SiteVerboseDto @JsonDeserialize(using = DataClassUnwrappedJsonDeserializer::class) diff --git a/bpdm-pool-api/src/main/kotlin/org/eclipse/tractusx/bpdm/pool/api/model/response/SitePartnerCreateVerboseDto.kt b/bpdm-pool-api/src/main/kotlin/org/eclipse/tractusx/bpdm/pool/api/model/response/SitePartnerCreateVerboseDto.kt index 10e0ac041..c6fa5920a 100644 --- a/bpdm-pool-api/src/main/kotlin/org/eclipse/tractusx/bpdm/pool/api/model/response/SitePartnerCreateVerboseDto.kt +++ b/bpdm-pool-api/src/main/kotlin/org/eclipse/tractusx/bpdm/pool/api/model/response/SitePartnerCreateVerboseDto.kt @@ -24,8 +24,8 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize import io.swagger.v3.oas.annotations.media.Schema import org.eclipse.tractusx.bpdm.common.dto.openapidescription.CommonDescription import org.eclipse.tractusx.bpdm.common.dto.openapidescription.SiteDescription -import org.eclipse.tractusx.bpdm.common.dto.response.LogisticAddressVerboseDto import org.eclipse.tractusx.bpdm.common.service.DataClassUnwrappedJsonDeserializer +import org.eclipse.tractusx.bpdm.pool.api.model.LogisticAddressVerboseDto import org.eclipse.tractusx.bpdm.pool.api.model.SiteVerboseDto @JsonDeserialize(using = DataClassUnwrappedJsonDeserializer::class) diff --git a/bpdm-pool-api/src/main/kotlin/org/eclipse/tractusx/bpdm/pool/api/model/response/SiteWithMainAddressVerboseDto.kt b/bpdm-pool-api/src/main/kotlin/org/eclipse/tractusx/bpdm/pool/api/model/response/SiteWithMainAddressVerboseDto.kt index 1c8c4a416..9f4a48a46 100644 --- a/bpdm-pool-api/src/main/kotlin/org/eclipse/tractusx/bpdm/pool/api/model/response/SiteWithMainAddressVerboseDto.kt +++ b/bpdm-pool-api/src/main/kotlin/org/eclipse/tractusx/bpdm/pool/api/model/response/SiteWithMainAddressVerboseDto.kt @@ -23,8 +23,8 @@ import com.fasterxml.jackson.annotation.JsonUnwrapped import com.fasterxml.jackson.databind.annotation.JsonDeserialize import io.swagger.v3.oas.annotations.media.Schema import org.eclipse.tractusx.bpdm.common.dto.openapidescription.SiteDescription -import org.eclipse.tractusx.bpdm.common.dto.response.LogisticAddressVerboseDto import org.eclipse.tractusx.bpdm.common.service.DataClassUnwrappedJsonDeserializer +import org.eclipse.tractusx.bpdm.pool.api.model.LogisticAddressVerboseDto import org.eclipse.tractusx.bpdm.pool.api.model.SiteVerboseDto @JsonDeserialize(using = DataClassUnwrappedJsonDeserializer::class) diff --git a/bpdm-pool/src/main/kotlin/org/eclipse/tractusx/bpdm/pool/controller/AddressController.kt b/bpdm-pool/src/main/kotlin/org/eclipse/tractusx/bpdm/pool/controller/AddressController.kt index 9702dfe38..708a98254 100644 --- a/bpdm-pool/src/main/kotlin/org/eclipse/tractusx/bpdm/pool/controller/AddressController.kt +++ b/bpdm-pool/src/main/kotlin/org/eclipse/tractusx/bpdm/pool/controller/AddressController.kt @@ -19,20 +19,20 @@ package org.eclipse.tractusx.bpdm.pool.controller -import org.eclipse.tractusx.bpdm.common.dto.request.AddressPartnerBpnSearchRequest import org.eclipse.tractusx.bpdm.common.dto.request.PaginationRequest -import org.eclipse.tractusx.bpdm.common.dto.response.LogisticAddressVerboseDto import org.eclipse.tractusx.bpdm.common.dto.response.PageDto import org.eclipse.tractusx.bpdm.pool.api.PoolAddressApi +import org.eclipse.tractusx.bpdm.pool.api.model.LogisticAddressVerboseDto +import org.eclipse.tractusx.bpdm.pool.api.model.request.AddressPartnerBpnSearchRequest import org.eclipse.tractusx.bpdm.pool.api.model.request.AddressPartnerCreateRequest import org.eclipse.tractusx.bpdm.pool.api.model.request.AddressPartnerSearchRequest import org.eclipse.tractusx.bpdm.pool.api.model.request.AddressPartnerUpdateRequest import org.eclipse.tractusx.bpdm.pool.api.model.response.AddressMatchVerboseDto import org.eclipse.tractusx.bpdm.pool.api.model.response.AddressPartnerCreateResponseWrapper import org.eclipse.tractusx.bpdm.pool.api.model.response.AddressPartnerUpdateResponseWrapper -import org.eclipse.tractusx.bpdm.pool.service.SearchService import org.eclipse.tractusx.bpdm.pool.service.AddressService import org.eclipse.tractusx.bpdm.pool.service.BusinessPartnerBuildService +import org.eclipse.tractusx.bpdm.pool.service.SearchService import org.springframework.security.access.prepost.PreAuthorize import org.springframework.web.bind.annotation.RestController diff --git a/bpdm-pool/src/main/kotlin/org/eclipse/tractusx/bpdm/pool/controller/LegalEntityController.kt b/bpdm-pool/src/main/kotlin/org/eclipse/tractusx/bpdm/pool/controller/LegalEntityController.kt index 697ad6937..7887751c5 100644 --- a/bpdm-pool/src/main/kotlin/org/eclipse/tractusx/bpdm/pool/controller/LegalEntityController.kt +++ b/bpdm-pool/src/main/kotlin/org/eclipse/tractusx/bpdm/pool/controller/LegalEntityController.kt @@ -20,9 +20,9 @@ package org.eclipse.tractusx.bpdm.pool.controller import org.eclipse.tractusx.bpdm.common.dto.request.PaginationRequest -import org.eclipse.tractusx.bpdm.common.dto.response.LogisticAddressVerboseDto import org.eclipse.tractusx.bpdm.common.dto.response.PageDto import org.eclipse.tractusx.bpdm.pool.api.PoolLegalEntityApi +import org.eclipse.tractusx.bpdm.pool.api.model.LogisticAddressVerboseDto import org.eclipse.tractusx.bpdm.pool.api.model.SiteVerboseDto import org.eclipse.tractusx.bpdm.pool.api.model.request.BusinessPartnerSearchRequest import org.eclipse.tractusx.bpdm.pool.api.model.request.LegalEntityPartnerCreateRequest diff --git a/bpdm-pool/src/main/kotlin/org/eclipse/tractusx/bpdm/pool/controller/MetadataController.kt b/bpdm-pool/src/main/kotlin/org/eclipse/tractusx/bpdm/pool/controller/MetadataController.kt index 615256fbd..bccde6cb1 100644 --- a/bpdm-pool/src/main/kotlin/org/eclipse/tractusx/bpdm/pool/controller/MetadataController.kt +++ b/bpdm-pool/src/main/kotlin/org/eclipse/tractusx/bpdm/pool/controller/MetadataController.kt @@ -24,11 +24,11 @@ import org.eclipse.tractusx.bpdm.common.dto.FieldQualityRuleDto import org.eclipse.tractusx.bpdm.common.dto.IdentifierBusinessPartnerType import org.eclipse.tractusx.bpdm.common.dto.IdentifierTypeDto import org.eclipse.tractusx.bpdm.common.dto.request.PaginationRequest -import org.eclipse.tractusx.bpdm.common.dto.response.CountrySubdivisionDto import org.eclipse.tractusx.bpdm.common.dto.response.PageDto -import org.eclipse.tractusx.bpdm.common.dto.response.RegionDto import org.eclipse.tractusx.bpdm.pool.api.PoolMetadataApi +import org.eclipse.tractusx.bpdm.pool.api.model.CountrySubdivisionDto import org.eclipse.tractusx.bpdm.pool.api.model.LegalFormDto +import org.eclipse.tractusx.bpdm.pool.api.model.RegionDto import org.eclipse.tractusx.bpdm.pool.api.model.request.LegalFormRequest import org.eclipse.tractusx.bpdm.pool.service.MetadataService import org.springframework.data.domain.PageRequest diff --git a/bpdm-pool/src/main/kotlin/org/eclipse/tractusx/bpdm/pool/service/AddressService.kt b/bpdm-pool/src/main/kotlin/org/eclipse/tractusx/bpdm/pool/service/AddressService.kt index 54c9ae788..f7cef8e52 100644 --- a/bpdm-pool/src/main/kotlin/org/eclipse/tractusx/bpdm/pool/service/AddressService.kt +++ b/bpdm-pool/src/main/kotlin/org/eclipse/tractusx/bpdm/pool/service/AddressService.kt @@ -21,11 +21,11 @@ package org.eclipse.tractusx.bpdm.pool.service import jakarta.transaction.Transactional import mu.KotlinLogging -import org.eclipse.tractusx.bpdm.common.dto.request.AddressPartnerBpnSearchRequest import org.eclipse.tractusx.bpdm.common.dto.request.PaginationRequest -import org.eclipse.tractusx.bpdm.common.dto.response.LogisticAddressVerboseDto import org.eclipse.tractusx.bpdm.common.dto.response.PageDto import org.eclipse.tractusx.bpdm.common.exception.BpdmNotFoundException +import org.eclipse.tractusx.bpdm.pool.api.model.LogisticAddressVerboseDto +import org.eclipse.tractusx.bpdm.pool.api.model.request.AddressPartnerBpnSearchRequest import org.eclipse.tractusx.bpdm.pool.api.model.response.LegalAddressVerboseDto import org.eclipse.tractusx.bpdm.pool.api.model.response.MainAddressVerboseDto import org.eclipse.tractusx.bpdm.pool.entity.LogisticAddress diff --git a/bpdm-pool/src/main/kotlin/org/eclipse/tractusx/bpdm/pool/service/BusinessPartnerBuildService.kt b/bpdm-pool/src/main/kotlin/org/eclipse/tractusx/bpdm/pool/service/BusinessPartnerBuildService.kt index 9a491bc59..fa998679d 100644 --- a/bpdm-pool/src/main/kotlin/org/eclipse/tractusx/bpdm/pool/service/BusinessPartnerBuildService.kt +++ b/bpdm-pool/src/main/kotlin/org/eclipse/tractusx/bpdm/pool/service/BusinessPartnerBuildService.kt @@ -24,6 +24,7 @@ import org.eclipse.tractusx.bpdm.common.dto.* import org.eclipse.tractusx.bpdm.common.exception.BpdmNotFoundException import org.eclipse.tractusx.bpdm.common.util.replace import org.eclipse.tractusx.bpdm.pool.api.model.ChangelogType +import org.eclipse.tractusx.bpdm.pool.api.model.LogisticAddressDto import org.eclipse.tractusx.bpdm.pool.api.model.request.* import org.eclipse.tractusx.bpdm.pool.api.model.response.* import org.eclipse.tractusx.bpdm.pool.dto.AddressMetadataDto @@ -415,7 +416,7 @@ class BusinessPartnerBuildService( ) } - fun toAddressState(dto: IBaseAddressStateDto, address: LogisticAddress): AddressState { + fun toAddressState(dto: IAddressStateDto, address: LogisticAddress): AddressState { return AddressState( description = dto.description, validFrom = dto.validFrom, @@ -451,7 +452,7 @@ class BusinessPartnerBuildService( } fun toAddressIdentifier( - dto: IBaseAddressIdentifierDto, + dto: IAddressIdentifierDto, idTypes: Map, partner: LogisticAddress ): AddressIdentifier { diff --git a/bpdm-pool/src/main/kotlin/org/eclipse/tractusx/bpdm/pool/service/MetadataService.kt b/bpdm-pool/src/main/kotlin/org/eclipse/tractusx/bpdm/pool/service/MetadataService.kt index 4191c0b67..84d7cff93 100644 --- a/bpdm-pool/src/main/kotlin/org/eclipse/tractusx/bpdm/pool/service/MetadataService.kt +++ b/bpdm-pool/src/main/kotlin/org/eclipse/tractusx/bpdm/pool/service/MetadataService.kt @@ -23,11 +23,11 @@ import com.neovisionaries.i18n.CountryCode import mu.KotlinLogging import org.eclipse.tractusx.bpdm.common.dto.* import org.eclipse.tractusx.bpdm.common.dto.request.PaginationRequest -import org.eclipse.tractusx.bpdm.common.dto.response.CountrySubdivisionDto import org.eclipse.tractusx.bpdm.common.dto.response.PageDto -import org.eclipse.tractusx.bpdm.common.dto.response.RegionDto import org.eclipse.tractusx.bpdm.common.service.toPageRequest +import org.eclipse.tractusx.bpdm.pool.api.model.CountrySubdivisionDto import org.eclipse.tractusx.bpdm.pool.api.model.LegalFormDto +import org.eclipse.tractusx.bpdm.pool.api.model.RegionDto import org.eclipse.tractusx.bpdm.pool.api.model.request.LegalFormRequest import org.eclipse.tractusx.bpdm.pool.dto.AddressMetadataDto import org.eclipse.tractusx.bpdm.pool.dto.LegalEntityMetadataDto diff --git a/bpdm-pool/src/main/kotlin/org/eclipse/tractusx/bpdm/pool/service/ResponseMappings.kt b/bpdm-pool/src/main/kotlin/org/eclipse/tractusx/bpdm/pool/service/ResponseMappings.kt index 93e90b7a2..f28093e5c 100644 --- a/bpdm-pool/src/main/kotlin/org/eclipse/tractusx/bpdm/pool/service/ResponseMappings.kt +++ b/bpdm-pool/src/main/kotlin/org/eclipse/tractusx/bpdm/pool/service/ResponseMappings.kt @@ -22,8 +22,7 @@ package org.eclipse.tractusx.bpdm.pool.service import org.eclipse.tractusx.bpdm.common.dto.GeoCoordinateDto import org.eclipse.tractusx.bpdm.common.dto.IdentifierTypeDetailDto import org.eclipse.tractusx.bpdm.common.dto.IdentifierTypeDto -import org.eclipse.tractusx.bpdm.common.dto.StreetDto -import org.eclipse.tractusx.bpdm.common.dto.response.* +import org.eclipse.tractusx.bpdm.common.dto.response.PageDto import org.eclipse.tractusx.bpdm.common.dto.response.type.TypeKeyNameVerboseDto import org.eclipse.tractusx.bpdm.common.service.toDto import org.eclipse.tractusx.bpdm.pool.api.model.* diff --git a/bpdm-pool/src/test/kotlin/org/eclipse/tractusx/bpdm/pool/controller/AddressControllerIT.kt b/bpdm-pool/src/test/kotlin/org/eclipse/tractusx/bpdm/pool/controller/AddressControllerIT.kt index a20422dcc..1816876c2 100644 --- a/bpdm-pool/src/test/kotlin/org/eclipse/tractusx/bpdm/pool/controller/AddressControllerIT.kt +++ b/bpdm-pool/src/test/kotlin/org/eclipse/tractusx/bpdm/pool/controller/AddressControllerIT.kt @@ -22,11 +22,11 @@ package org.eclipse.tractusx.bpdm.pool.controller import org.assertj.core.api.Assertions.assertThat import org.eclipse.tractusx.bpdm.common.dto.IdentifierBusinessPartnerType import org.eclipse.tractusx.bpdm.common.dto.IdentifierTypeDto -import org.eclipse.tractusx.bpdm.common.dto.request.AddressPartnerBpnSearchRequest import org.eclipse.tractusx.bpdm.common.dto.request.PaginationRequest -import org.eclipse.tractusx.bpdm.common.dto.response.LogisticAddressVerboseDto import org.eclipse.tractusx.bpdm.pool.Application import org.eclipse.tractusx.bpdm.pool.api.client.PoolApiClient +import org.eclipse.tractusx.bpdm.pool.api.model.LogisticAddressVerboseDto +import org.eclipse.tractusx.bpdm.pool.api.model.request.AddressPartnerBpnSearchRequest import org.eclipse.tractusx.bpdm.pool.api.model.response.* import org.eclipse.tractusx.bpdm.pool.util.* import org.eclipse.tractusx.bpdm.pool.util.BusinessPartnerNonVerboseValues.addressIdentifier diff --git a/bpdm-pool/src/test/kotlin/org/eclipse/tractusx/bpdm/pool/controller/AddressControllerSearchIT.kt b/bpdm-pool/src/test/kotlin/org/eclipse/tractusx/bpdm/pool/controller/AddressControllerSearchIT.kt index d7aa76a4d..98f0707a9 100644 --- a/bpdm-pool/src/test/kotlin/org/eclipse/tractusx/bpdm/pool/controller/AddressControllerSearchIT.kt +++ b/bpdm-pool/src/test/kotlin/org/eclipse/tractusx/bpdm/pool/controller/AddressControllerSearchIT.kt @@ -20,10 +20,10 @@ package org.eclipse.tractusx.bpdm.pool.controller import org.eclipse.tractusx.bpdm.common.dto.request.PaginationRequest -import org.eclipse.tractusx.bpdm.common.dto.response.LogisticAddressVerboseDto import org.eclipse.tractusx.bpdm.common.dto.response.PageDto import org.eclipse.tractusx.bpdm.pool.Application import org.eclipse.tractusx.bpdm.pool.api.client.PoolClientImpl +import org.eclipse.tractusx.bpdm.pool.api.model.LogisticAddressVerboseDto import org.eclipse.tractusx.bpdm.pool.api.model.request.AddressPartnerSearchRequest import org.eclipse.tractusx.bpdm.pool.api.model.response.AddressMatchVerboseDto import org.eclipse.tractusx.bpdm.pool.util.* diff --git a/bpdm-pool/src/test/kotlin/org/eclipse/tractusx/bpdm/pool/controller/LegalEntityControllerIT.kt b/bpdm-pool/src/test/kotlin/org/eclipse/tractusx/bpdm/pool/controller/LegalEntityControllerIT.kt index 8c8ba926c..d4f8b51ce 100644 --- a/bpdm-pool/src/test/kotlin/org/eclipse/tractusx/bpdm/pool/controller/LegalEntityControllerIT.kt +++ b/bpdm-pool/src/test/kotlin/org/eclipse/tractusx/bpdm/pool/controller/LegalEntityControllerIT.kt @@ -22,10 +22,10 @@ package org.eclipse.tractusx.bpdm.pool.controller import org.assertj.core.api.Assertions.assertThat import org.eclipse.tractusx.bpdm.common.dto.IdentifierBusinessPartnerType import org.eclipse.tractusx.bpdm.common.dto.IdentifierTypeDto -import org.eclipse.tractusx.bpdm.common.dto.response.LogisticAddressVerboseDto import org.eclipse.tractusx.bpdm.pool.Application import org.eclipse.tractusx.bpdm.pool.api.client.PoolClientImpl import org.eclipse.tractusx.bpdm.pool.api.model.LegalEntityVerboseDto +import org.eclipse.tractusx.bpdm.pool.api.model.LogisticAddressVerboseDto import org.eclipse.tractusx.bpdm.pool.api.model.response.* import org.eclipse.tractusx.bpdm.pool.util.* import org.eclipse.tractusx.bpdm.pool.util.BusinessPartnerNonVerboseValues.addressIdentifier diff --git a/bpdm-pool/src/test/kotlin/org/eclipse/tractusx/bpdm/pool/controller/LegalEntityControllerSearchIT.kt b/bpdm-pool/src/test/kotlin/org/eclipse/tractusx/bpdm/pool/controller/LegalEntityControllerSearchIT.kt index 35dac1bd5..a952b160b 100644 --- a/bpdm-pool/src/test/kotlin/org/eclipse/tractusx/bpdm/pool/controller/LegalEntityControllerSearchIT.kt +++ b/bpdm-pool/src/test/kotlin/org/eclipse/tractusx/bpdm/pool/controller/LegalEntityControllerSearchIT.kt @@ -20,11 +20,11 @@ package org.eclipse.tractusx.bpdm.pool.controller import org.eclipse.tractusx.bpdm.common.dto.request.PaginationRequest -import org.eclipse.tractusx.bpdm.common.dto.response.LogisticAddressVerboseDto import org.eclipse.tractusx.bpdm.common.dto.response.PageDto import org.eclipse.tractusx.bpdm.pool.Application import org.eclipse.tractusx.bpdm.pool.api.client.PoolClientImpl import org.eclipse.tractusx.bpdm.pool.api.model.LegalEntityVerboseDto +import org.eclipse.tractusx.bpdm.pool.api.model.LogisticAddressVerboseDto import org.eclipse.tractusx.bpdm.pool.api.model.request.LegalEntityPropertiesSearchRequest import org.eclipse.tractusx.bpdm.pool.api.model.request.SitePropertiesSearchRequest import org.eclipse.tractusx.bpdm.pool.api.model.response.LegalEntityMatchVerboseDto diff --git a/bpdm-pool/src/test/kotlin/org/eclipse/tractusx/bpdm/pool/controller/SiteControllerIT.kt b/bpdm-pool/src/test/kotlin/org/eclipse/tractusx/bpdm/pool/controller/SiteControllerIT.kt index ca2e111fc..5da1b0c77 100644 --- a/bpdm-pool/src/test/kotlin/org/eclipse/tractusx/bpdm/pool/controller/SiteControllerIT.kt +++ b/bpdm-pool/src/test/kotlin/org/eclipse/tractusx/bpdm/pool/controller/SiteControllerIT.kt @@ -23,10 +23,10 @@ import org.assertj.core.api.Assertions.assertThat import org.eclipse.tractusx.bpdm.common.dto.IdentifierBusinessPartnerType import org.eclipse.tractusx.bpdm.common.dto.IdentifierTypeDto import org.eclipse.tractusx.bpdm.common.dto.request.PaginationRequest -import org.eclipse.tractusx.bpdm.common.dto.response.LogisticAddressVerboseDto import org.eclipse.tractusx.bpdm.common.dto.response.PageDto import org.eclipse.tractusx.bpdm.pool.Application import org.eclipse.tractusx.bpdm.pool.api.client.PoolClientImpl +import org.eclipse.tractusx.bpdm.pool.api.model.LogisticAddressVerboseDto import org.eclipse.tractusx.bpdm.pool.api.model.SiteDto import org.eclipse.tractusx.bpdm.pool.api.model.SiteVerboseDto import org.eclipse.tractusx.bpdm.pool.api.model.request.SiteBpnSearchRequest diff --git a/bpdm-pool/src/test/kotlin/org/eclipse/tractusx/bpdm/pool/service/TaskStepFetchAndReserveServiceTest.kt b/bpdm-pool/src/test/kotlin/org/eclipse/tractusx/bpdm/pool/service/TaskStepFetchAndReserveServiceTest.kt index 926f4f7d9..3ee390d20 100644 --- a/bpdm-pool/src/test/kotlin/org/eclipse/tractusx/bpdm/pool/service/TaskStepFetchAndReserveServiceTest.kt +++ b/bpdm-pool/src/test/kotlin/org/eclipse/tractusx/bpdm/pool/service/TaskStepFetchAndReserveServiceTest.kt @@ -12,10 +12,7 @@ import org.eclipse.tractusx.bpdm.common.model.ClassificationType import org.eclipse.tractusx.bpdm.common.model.DeliveryServiceType import org.eclipse.tractusx.bpdm.pool.Application import org.eclipse.tractusx.bpdm.pool.api.client.PoolClientImpl -import org.eclipse.tractusx.bpdm.pool.api.model.LegalEntityClassificationVerboseDto -import org.eclipse.tractusx.bpdm.pool.api.model.LegalEntityIdentifierVerboseDto -import org.eclipse.tractusx.bpdm.pool.api.model.LegalEntityStateVerboseDto -import org.eclipse.tractusx.bpdm.pool.api.model.SiteStateVerboseDto +import org.eclipse.tractusx.bpdm.pool.api.model.* import org.eclipse.tractusx.bpdm.pool.api.model.response.LegalEntityWithLegalAddressVerboseDto import org.eclipse.tractusx.bpdm.pool.api.model.response.SiteWithMainAddressVerboseDto import org.eclipse.tractusx.bpdm.pool.repository.BpnRequestIdentifierRepository @@ -26,9 +23,20 @@ import org.eclipse.tractusx.bpdm.pool.util.BusinessPartnerVerboseValues import org.eclipse.tractusx.bpdm.pool.util.PostgreSQLContextInitializer import org.eclipse.tractusx.bpdm.pool.util.TestHelpers import org.eclipse.tractusx.orchestrator.api.model.* +import org.eclipse.tractusx.orchestrator.api.model.AddressIdentifierDto +import org.eclipse.tractusx.orchestrator.api.model.AddressStateDto +import org.eclipse.tractusx.orchestrator.api.model.AlternativePostalAddressDto import org.eclipse.tractusx.orchestrator.api.model.BpnReferenceType.Bpn import org.eclipse.tractusx.orchestrator.api.model.BpnReferenceType.BpnRequestIdentifier -import org.junit.Ignore +import org.eclipse.tractusx.orchestrator.api.model.LegalEntityClassificationDto +import org.eclipse.tractusx.orchestrator.api.model.LegalEntityDto +import org.eclipse.tractusx.orchestrator.api.model.LegalEntityIdentifierDto +import org.eclipse.tractusx.orchestrator.api.model.LegalEntityStateDto +import org.eclipse.tractusx.orchestrator.api.model.LogisticAddressDto +import org.eclipse.tractusx.orchestrator.api.model.PhysicalPostalAddressDto +import org.eclipse.tractusx.orchestrator.api.model.SiteDto +import org.eclipse.tractusx.orchestrator.api.model.SiteStateDto +import org.eclipse.tractusx.orchestrator.api.model.StreetDto import org.junit.jupiter.api.BeforeEach import org.junit.jupiter.api.Disabled import org.junit.jupiter.api.Test diff --git a/bpdm-pool/src/test/kotlin/org/eclipse/tractusx/bpdm/pool/util/BusinessPartnerVerboseValues.kt b/bpdm-pool/src/test/kotlin/org/eclipse/tractusx/bpdm/pool/util/BusinessPartnerVerboseValues.kt index bfc1f5c99..151881b39 100644 --- a/bpdm-pool/src/test/kotlin/org/eclipse/tractusx/bpdm/pool/util/BusinessPartnerVerboseValues.kt +++ b/bpdm-pool/src/test/kotlin/org/eclipse/tractusx/bpdm/pool/util/BusinessPartnerVerboseValues.kt @@ -21,9 +21,6 @@ package org.eclipse.tractusx.bpdm.pool.util import com.neovisionaries.i18n.CountryCode import com.neovisionaries.i18n.LanguageCode -import org.eclipse.tractusx.bpdm.common.dto.StreetDto -import org.eclipse.tractusx.bpdm.common.dto.response.LogisticAddressVerboseDto -import org.eclipse.tractusx.bpdm.common.dto.response.PhysicalPostalAddressVerboseDto import org.eclipse.tractusx.bpdm.common.dto.response.type.TypeKeyNameVerboseDto import org.eclipse.tractusx.bpdm.common.model.BusinessStateType import org.eclipse.tractusx.bpdm.common.model.ClassificationType From 8279de15116d591c5cf0eaeb783822ef7f4c8f89 Mon Sep 17 00:00:00 2001 From: Martin Kaeser Date: Wed, 6 Dec 2023 16:03:14 +0100 Subject: [PATCH 3/3] refactor(DTO): Clean up DTOs in bpdm-common --- .../bridge/dummy/service/GateQueryService.kt | 2 +- .../catenax/bpdm/bridge/dummy/BridgeSyncIT.kt | 2 +- .../bpdm/bridge/dummy/util/TestHelpers.kt | 4 +-- .../bpdm/common/dto/{response => }/PageDto.kt | 2 +- .../dto/{request => }/PaginationRequest.kt | 2 +- .../type => }/TypeKeyNameVerboseDto.kt | 2 +- .../dto/response/type/TypeKeyNameUrlDto.kt | 34 ------------------- .../bpdm/common/service/CommonMappings.kt | 12 ++----- .../tractusx/bpdm/gate/api/GateAddressApi.kt | 4 +-- .../bpdm/gate/api/GateBusinessPartnerApi.kt | 4 +-- .../bpdm/gate/api/GateChangelogApi.kt | 2 +- .../bpdm/gate/api/GateLegalEntityApi.kt | 4 +-- .../bpdm/gate/api/GateSharingStateApi.kt | 4 +-- .../tractusx/bpdm/gate/api/GateSiteApi.kt | 4 +-- .../bpdm/gate/controller/AddressController.kt | 4 +-- .../controller/BusinessPartnerController.kt | 4 +-- .../gate/controller/ChangelogController.kt | 2 +- .../gate/controller/LegalEntityController.kt | 4 +-- .../gate/controller/SharingStateController.kt | 4 +-- .../bpdm/gate/controller/SiteController.kt | 4 +-- .../bpdm/gate/service/AddressService.kt | 3 +- .../gate/service/BusinessPartnerService.kt | 4 +-- .../bpdm/gate/service/LegalEntityService.kt | 2 +- .../bpdm/gate/service/ResponseMappings.kt | 2 +- .../bpdm/gate/service/SharingStateService.kt | 4 +-- .../tractusx/bpdm/gate/service/SiteService.kt | 7 +--- .../controller/BusinessPartnerControllerIT.kt | 2 -- .../gate/controller/ChangeLogControllerIT.kt | 2 +- .../LegalEntityControllerInputIT.kt | 4 +-- .../LegalEntityControllerOutputIT.kt | 4 +-- .../PostalAddressControllerInputIT.kt | 4 +-- .../PostalAddressControllerOutputIT.kt | 4 +-- .../controller/SharingStateControllerIT.kt | 4 +-- .../gate/controller/SiteControllerInputIT.kt | 4 +-- .../gate/controller/SiteControllerOutputIT.kt | 4 +-- .../gate/util/BusinessPartnerVerboseValues.kt | 2 +- .../tractusx/bpdm/pool/api/PoolAddressApi.kt | 4 +-- .../bpdm/pool/api/PoolChangelogApi.kt | 4 +-- .../bpdm/pool/api/PoolLegalEntityApi.kt | 4 +-- .../tractusx/bpdm/pool/api/PoolMetadataApi.kt | 11 ++---- .../tractusx/bpdm/pool/api/PoolSaasApi.kt | 4 +-- .../tractusx/bpdm/pool/api/PoolSiteApi.kt | 4 +-- .../api/model/AddressIdentifierVerboseDto.kt | 2 +- .../pool/api/model/AddressStateVerboseDto.kt | 2 +- .../AlternativePostalAddressVerboseDto.kt | 2 +- .../pool/api/model}/FieldQualityRuleDto.kt | 2 +- .../model}/IdentifierBusinessPartnerType.kt | 2 +- .../api/model}/IdentifierTypeDetailDto.kt | 2 +- .../bpdm/pool/api/model}/IdentifierTypeDto.kt | 2 +- .../LegalEntityClassificationVerboseDto.kt | 2 +- .../model/LegalEntityIdentifierVerboseDto.kt | 2 +- .../api/model/LegalEntityStateVerboseDto.kt | 2 +- .../model/PhysicalPostalAddressVerboseDto.kt | 2 +- .../bpdm/pool/api/model}/QualityLevel.kt | 2 +- .../bpdm/pool/api/model/RelationVerboseDto.kt | 2 +- .../pool/api/model/SiteStateVerboseDto.kt | 2 +- .../model/request/IdentifiersSearchRequest.kt | 2 +- .../bpdm/pool/controller/AddressController.kt | 4 +-- .../pool/controller/ChangelogController.kt | 4 +-- .../pool/controller/LegalEntityController.kt | 4 +-- .../pool/controller/MetadataController.kt | 11 ++---- .../bpdm/pool/controller/SiteController.kt | 4 +-- .../bpdm/pool/entity/FieldQualityRule.kt | 2 +- .../bpdm/pool/entity/IdentifierType.kt | 2 +- .../repository/IdentifierTypeRepository.kt | 2 +- .../bpdm/pool/service/AddressService.kt | 4 +-- .../service/BusinessPartnerFetchService.kt | 2 +- .../service/BusinessPartnerSearchService.kt | 4 +-- .../bpdm/pool/service/MetadataService.kt | 11 +++--- .../pool/service/PartnerChangelogService.kt | 5 +-- .../bpdm/pool/service/ResponseMappings.kt | 6 ++-- .../bpdm/pool/service/SearchService.kt | 4 +-- .../tractusx/bpdm/pool/service/SiteService.kt | 4 +-- .../pool/controller/AddressControllerIT.kt | 6 ++-- .../controller/AddressControllerSearchIT.kt | 4 +-- .../bpdm/pool/controller/BpnControllerIT.kt | 2 +- .../pool/controller/ChangelogControllerIT.kt | 4 +-- .../controller/LegalEntityControllerIT.kt | 4 +-- .../LegalEntityControllerSearchIT.kt | 4 +-- .../pool/controller/MetadataControllerIT.kt | 10 +++--- .../bpdm/pool/controller/SiteControllerIT.kt | 10 ++---- .../TaskStepFetchAndReserveServiceTest.kt | 3 +- .../util/BusinessPartnerNonVerboseValues.kt | 1 - .../pool/util/BusinessPartnerVerboseValues.kt | 2 +- 84 files changed, 139 insertions(+), 205 deletions(-) rename bpdm-common/src/main/kotlin/org/eclipse/tractusx/bpdm/common/dto/{response => }/PageDto.kt (96%) rename bpdm-common/src/main/kotlin/org/eclipse/tractusx/bpdm/common/dto/{request => }/PaginationRequest.kt (96%) rename bpdm-common/src/main/kotlin/org/eclipse/tractusx/bpdm/common/dto/{response/type => }/TypeKeyNameVerboseDto.kt (95%) delete mode 100644 bpdm-common/src/main/kotlin/org/eclipse/tractusx/bpdm/common/dto/response/type/TypeKeyNameUrlDto.kt rename {bpdm-common/src/main/kotlin/org/eclipse/tractusx/bpdm/common/dto => bpdm-pool-api/src/main/kotlin/org/eclipse/tractusx/bpdm/pool/api/model}/FieldQualityRuleDto.kt (96%) rename {bpdm-common/src/main/kotlin/org/eclipse/tractusx/bpdm/common/dto => bpdm-pool-api/src/main/kotlin/org/eclipse/tractusx/bpdm/pool/api/model}/IdentifierBusinessPartnerType.kt (95%) rename {bpdm-common/src/main/kotlin/org/eclipse/tractusx/bpdm/common/dto => bpdm-pool-api/src/main/kotlin/org/eclipse/tractusx/bpdm/pool/api/model}/IdentifierTypeDetailDto.kt (96%) rename {bpdm-common/src/main/kotlin/org/eclipse/tractusx/bpdm/common/dto => bpdm-pool-api/src/main/kotlin/org/eclipse/tractusx/bpdm/pool/api/model}/IdentifierTypeDto.kt (97%) rename {bpdm-common/src/main/kotlin/org/eclipse/tractusx/bpdm/common/dto => bpdm-pool-api/src/main/kotlin/org/eclipse/tractusx/bpdm/pool/api/model}/QualityLevel.kt (95%) diff --git a/bpdm-bridge-dummy/src/main/kotlin/com/catenax/bpdm/bridge/dummy/service/GateQueryService.kt b/bpdm-bridge-dummy/src/main/kotlin/com/catenax/bpdm/bridge/dummy/service/GateQueryService.kt index dd7d23bb8..a414af24b 100644 --- a/bpdm-bridge-dummy/src/main/kotlin/com/catenax/bpdm/bridge/dummy/service/GateQueryService.kt +++ b/bpdm-bridge-dummy/src/main/kotlin/com/catenax/bpdm/bridge/dummy/service/GateQueryService.kt @@ -25,7 +25,7 @@ import com.catenax.bpdm.bridge.dummy.dto.GateLegalEntityInfo import com.catenax.bpdm.bridge.dummy.dto.GateSiteInfo import mu.KotlinLogging import org.eclipse.tractusx.bpdm.common.dto.BusinessPartnerType -import org.eclipse.tractusx.bpdm.common.dto.request.PaginationRequest +import org.eclipse.tractusx.bpdm.common.dto.PaginationRequest import org.eclipse.tractusx.bpdm.gate.api.client.GateClient import org.eclipse.tractusx.bpdm.gate.api.model.request.ChangelogSearchRequest import org.eclipse.tractusx.bpdm.gate.api.model.response.* diff --git a/bpdm-bridge-dummy/src/test/kotlin/com/catenax/bpdm/bridge/dummy/BridgeSyncIT.kt b/bpdm-bridge-dummy/src/test/kotlin/com/catenax/bpdm/bridge/dummy/BridgeSyncIT.kt index da5ed3436..e788077cc 100644 --- a/bpdm-bridge-dummy/src/test/kotlin/com/catenax/bpdm/bridge/dummy/BridgeSyncIT.kt +++ b/bpdm-bridge-dummy/src/test/kotlin/com/catenax/bpdm/bridge/dummy/BridgeSyncIT.kt @@ -28,7 +28,7 @@ import com.catenax.bpdm.bridge.dummy.util.BpdmPoolContextInitializer import com.catenax.bpdm.bridge.dummy.util.PostgreSQLContextInitializer import com.catenax.bpdm.bridge.dummy.util.TestHelpers import org.assertj.core.api.Assertions.assertThat -import org.eclipse.tractusx.bpdm.common.dto.request.PaginationRequest +import org.eclipse.tractusx.bpdm.common.dto.PaginationRequest import org.eclipse.tractusx.bpdm.gate.api.client.GateClient import org.eclipse.tractusx.bpdm.gate.api.model.SharingStateType import org.eclipse.tractusx.bpdm.gate.api.model.StreetDto diff --git a/bpdm-bridge-dummy/src/test/kotlin/com/catenax/bpdm/bridge/dummy/util/TestHelpers.kt b/bpdm-bridge-dummy/src/test/kotlin/com/catenax/bpdm/bridge/dummy/util/TestHelpers.kt index e32810cee..cd6ed922c 100644 --- a/bpdm-bridge-dummy/src/test/kotlin/com/catenax/bpdm/bridge/dummy/util/TestHelpers.kt +++ b/bpdm-bridge-dummy/src/test/kotlin/com/catenax/bpdm/bridge/dummy/util/TestHelpers.kt @@ -22,9 +22,9 @@ package com.catenax.bpdm.bridge.dummy.util import com.catenax.bpdm.bridge.dummy.testdata.CommonValues import jakarta.persistence.EntityManager import jakarta.persistence.EntityManagerFactory -import org.eclipse.tractusx.bpdm.common.dto.IdentifierBusinessPartnerType -import org.eclipse.tractusx.bpdm.common.dto.IdentifierTypeDto import org.eclipse.tractusx.bpdm.pool.api.client.PoolApiClient +import org.eclipse.tractusx.bpdm.pool.api.model.IdentifierBusinessPartnerType +import org.eclipse.tractusx.bpdm.pool.api.model.IdentifierTypeDto import org.eclipse.tractusx.bpdm.pool.api.model.request.LegalFormRequest import org.springframework.stereotype.Component diff --git a/bpdm-common/src/main/kotlin/org/eclipse/tractusx/bpdm/common/dto/response/PageDto.kt b/bpdm-common/src/main/kotlin/org/eclipse/tractusx/bpdm/common/dto/PageDto.kt similarity index 96% rename from bpdm-common/src/main/kotlin/org/eclipse/tractusx/bpdm/common/dto/response/PageDto.kt rename to bpdm-common/src/main/kotlin/org/eclipse/tractusx/bpdm/common/dto/PageDto.kt index 7af36a271..047f19f5b 100644 --- a/bpdm-common/src/main/kotlin/org/eclipse/tractusx/bpdm/common/dto/response/PageDto.kt +++ b/bpdm-common/src/main/kotlin/org/eclipse/tractusx/bpdm/common/dto/PageDto.kt @@ -17,7 +17,7 @@ * SPDX-License-Identifier: Apache-2.0 ******************************************************************************/ -package org.eclipse.tractusx.bpdm.common.dto.response +package org.eclipse.tractusx.bpdm.common.dto import io.swagger.v3.oas.annotations.media.Schema diff --git a/bpdm-common/src/main/kotlin/org/eclipse/tractusx/bpdm/common/dto/request/PaginationRequest.kt b/bpdm-common/src/main/kotlin/org/eclipse/tractusx/bpdm/common/dto/PaginationRequest.kt similarity index 96% rename from bpdm-common/src/main/kotlin/org/eclipse/tractusx/bpdm/common/dto/request/PaginationRequest.kt rename to bpdm-common/src/main/kotlin/org/eclipse/tractusx/bpdm/common/dto/PaginationRequest.kt index fcfa53a60..164e8621e 100644 --- a/bpdm-common/src/main/kotlin/org/eclipse/tractusx/bpdm/common/dto/request/PaginationRequest.kt +++ b/bpdm-common/src/main/kotlin/org/eclipse/tractusx/bpdm/common/dto/PaginationRequest.kt @@ -17,7 +17,7 @@ * SPDX-License-Identifier: Apache-2.0 ******************************************************************************/ -package org.eclipse.tractusx.bpdm.common.dto.request +package org.eclipse.tractusx.bpdm.common.dto import io.swagger.v3.oas.annotations.Parameter import io.swagger.v3.oas.annotations.media.Schema diff --git a/bpdm-common/src/main/kotlin/org/eclipse/tractusx/bpdm/common/dto/response/type/TypeKeyNameVerboseDto.kt b/bpdm-common/src/main/kotlin/org/eclipse/tractusx/bpdm/common/dto/TypeKeyNameVerboseDto.kt similarity index 95% rename from bpdm-common/src/main/kotlin/org/eclipse/tractusx/bpdm/common/dto/response/type/TypeKeyNameVerboseDto.kt rename to bpdm-common/src/main/kotlin/org/eclipse/tractusx/bpdm/common/dto/TypeKeyNameVerboseDto.kt index 56aa6d7d8..6d6fee74b 100644 --- a/bpdm-common/src/main/kotlin/org/eclipse/tractusx/bpdm/common/dto/response/type/TypeKeyNameVerboseDto.kt +++ b/bpdm-common/src/main/kotlin/org/eclipse/tractusx/bpdm/common/dto/TypeKeyNameVerboseDto.kt @@ -17,7 +17,7 @@ * SPDX-License-Identifier: Apache-2.0 ******************************************************************************/ -package org.eclipse.tractusx.bpdm.common.dto.response.type +package org.eclipse.tractusx.bpdm.common.dto import io.swagger.v3.oas.annotations.media.Schema diff --git a/bpdm-common/src/main/kotlin/org/eclipse/tractusx/bpdm/common/dto/response/type/TypeKeyNameUrlDto.kt b/bpdm-common/src/main/kotlin/org/eclipse/tractusx/bpdm/common/dto/response/type/TypeKeyNameUrlDto.kt deleted file mode 100644 index 4c14be361..000000000 --- a/bpdm-common/src/main/kotlin/org/eclipse/tractusx/bpdm/common/dto/response/type/TypeKeyNameUrlDto.kt +++ /dev/null @@ -1,34 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2021,2023 Contributors to the Eclipse Foundation - * - * See the NOTICE file(s) distributed with this work for additional - * information regarding copyright ownership. - * - * This program and the accompanying materials are made available under the - * terms of the Apache License, Version 2.0 which is available at - * https://www.apache.org/licenses/LICENSE-2.0. - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the - * License for the specific language governing permissions and limitations - * under the License. - * - * SPDX-License-Identifier: Apache-2.0 - ******************************************************************************/ - -package org.eclipse.tractusx.bpdm.common.dto.response.type - -import io.swagger.v3.oas.annotations.media.Schema - -data class TypeKeyNameUrlDto( - - @get:Schema(description = "Unique key of this type for reference") - val technicalKey: T, - - @get:Schema(description = "Name or denotation of this type") - val name: String, - - @get:Schema(description = "URL link leading to page with further information on the type") - val url: String? -) diff --git a/bpdm-common/src/main/kotlin/org/eclipse/tractusx/bpdm/common/service/CommonMappings.kt b/bpdm-common/src/main/kotlin/org/eclipse/tractusx/bpdm/common/service/CommonMappings.kt index 964df4820..83c69139c 100644 --- a/bpdm-common/src/main/kotlin/org/eclipse/tractusx/bpdm/common/service/CommonMappings.kt +++ b/bpdm-common/src/main/kotlin/org/eclipse/tractusx/bpdm/common/service/CommonMappings.kt @@ -21,20 +21,14 @@ package org.eclipse.tractusx.bpdm.common.service import com.neovisionaries.i18n.CountryCode import com.neovisionaries.i18n.LanguageCode -import org.eclipse.tractusx.bpdm.common.dto.request.PaginationRequest -import org.eclipse.tractusx.bpdm.common.dto.response.PageDto -import org.eclipse.tractusx.bpdm.common.dto.response.type.TypeKeyNameUrlDto -import org.eclipse.tractusx.bpdm.common.dto.response.type.TypeKeyNameVerboseDto +import org.eclipse.tractusx.bpdm.common.dto.PageDto +import org.eclipse.tractusx.bpdm.common.dto.PaginationRequest +import org.eclipse.tractusx.bpdm.common.dto.TypeKeyNameVerboseDto import org.eclipse.tractusx.bpdm.common.model.NamedType -import org.eclipse.tractusx.bpdm.common.model.NamedUrlType import org.springframework.data.domain.Page import org.springframework.data.domain.PageRequest import org.springframework.data.domain.Sort -fun T.toDto(): TypeKeyNameUrlDto { - return TypeKeyNameUrlDto(this, getTypeName(), getUrl()) -} - fun T.toDto(): TypeKeyNameVerboseDto { return TypeKeyNameVerboseDto(this, getTypeName()) } diff --git a/bpdm-gate-api/src/main/kotlin/org/eclipse/tractusx/bpdm/gate/api/GateAddressApi.kt b/bpdm-gate-api/src/main/kotlin/org/eclipse/tractusx/bpdm/gate/api/GateAddressApi.kt index 6a8cbe9ae..6c42683d5 100644 --- a/bpdm-gate-api/src/main/kotlin/org/eclipse/tractusx/bpdm/gate/api/GateAddressApi.kt +++ b/bpdm-gate-api/src/main/kotlin/org/eclipse/tractusx/bpdm/gate/api/GateAddressApi.kt @@ -25,8 +25,8 @@ import io.swagger.v3.oas.annotations.media.Content import io.swagger.v3.oas.annotations.responses.ApiResponse import io.swagger.v3.oas.annotations.responses.ApiResponses import jakarta.validation.Valid -import org.eclipse.tractusx.bpdm.common.dto.request.PaginationRequest -import org.eclipse.tractusx.bpdm.common.dto.response.PageDto +import org.eclipse.tractusx.bpdm.common.dto.PageDto +import org.eclipse.tractusx.bpdm.common.dto.PaginationRequest import org.eclipse.tractusx.bpdm.gate.api.model.request.AddressGateInputRequest import org.eclipse.tractusx.bpdm.gate.api.model.request.AddressGateOutputRequest import org.eclipse.tractusx.bpdm.gate.api.model.response.AddressGateInputDto diff --git a/bpdm-gate-api/src/main/kotlin/org/eclipse/tractusx/bpdm/gate/api/GateBusinessPartnerApi.kt b/bpdm-gate-api/src/main/kotlin/org/eclipse/tractusx/bpdm/gate/api/GateBusinessPartnerApi.kt index 78405bdf0..6620c34bf 100644 --- a/bpdm-gate-api/src/main/kotlin/org/eclipse/tractusx/bpdm/gate/api/GateBusinessPartnerApi.kt +++ b/bpdm-gate-api/src/main/kotlin/org/eclipse/tractusx/bpdm/gate/api/GateBusinessPartnerApi.kt @@ -24,8 +24,8 @@ import io.swagger.v3.oas.annotations.media.Content import io.swagger.v3.oas.annotations.responses.ApiResponse import io.swagger.v3.oas.annotations.responses.ApiResponses import jakarta.validation.Valid -import org.eclipse.tractusx.bpdm.common.dto.request.PaginationRequest -import org.eclipse.tractusx.bpdm.common.dto.response.PageDto +import org.eclipse.tractusx.bpdm.common.dto.PageDto +import org.eclipse.tractusx.bpdm.common.dto.PaginationRequest import org.eclipse.tractusx.bpdm.gate.api.model.request.BusinessPartnerInputRequest import org.eclipse.tractusx.bpdm.gate.api.model.response.BusinessPartnerInputDto import org.eclipse.tractusx.bpdm.gate.api.model.response.BusinessPartnerOutputDto diff --git a/bpdm-gate-api/src/main/kotlin/org/eclipse/tractusx/bpdm/gate/api/GateChangelogApi.kt b/bpdm-gate-api/src/main/kotlin/org/eclipse/tractusx/bpdm/gate/api/GateChangelogApi.kt index 264b0eaed..ce274d567 100644 --- a/bpdm-gate-api/src/main/kotlin/org/eclipse/tractusx/bpdm/gate/api/GateChangelogApi.kt +++ b/bpdm-gate-api/src/main/kotlin/org/eclipse/tractusx/bpdm/gate/api/GateChangelogApi.kt @@ -24,7 +24,7 @@ import io.swagger.v3.oas.annotations.media.Content import io.swagger.v3.oas.annotations.responses.ApiResponse import io.swagger.v3.oas.annotations.responses.ApiResponses import jakarta.validation.Valid -import org.eclipse.tractusx.bpdm.common.dto.request.PaginationRequest +import org.eclipse.tractusx.bpdm.common.dto.PaginationRequest import org.eclipse.tractusx.bpdm.gate.api.model.request.ChangelogSearchRequest import org.eclipse.tractusx.bpdm.gate.api.model.response.ChangelogGateDto import org.eclipse.tractusx.bpdm.gate.api.model.response.PageChangeLogDto diff --git a/bpdm-gate-api/src/main/kotlin/org/eclipse/tractusx/bpdm/gate/api/GateLegalEntityApi.kt b/bpdm-gate-api/src/main/kotlin/org/eclipse/tractusx/bpdm/gate/api/GateLegalEntityApi.kt index bf6e4f376..62acccdca 100644 --- a/bpdm-gate-api/src/main/kotlin/org/eclipse/tractusx/bpdm/gate/api/GateLegalEntityApi.kt +++ b/bpdm-gate-api/src/main/kotlin/org/eclipse/tractusx/bpdm/gate/api/GateLegalEntityApi.kt @@ -25,8 +25,8 @@ import io.swagger.v3.oas.annotations.media.Content import io.swagger.v3.oas.annotations.responses.ApiResponse import io.swagger.v3.oas.annotations.responses.ApiResponses import jakarta.validation.Valid -import org.eclipse.tractusx.bpdm.common.dto.request.PaginationRequest -import org.eclipse.tractusx.bpdm.common.dto.response.PageDto +import org.eclipse.tractusx.bpdm.common.dto.PageDto +import org.eclipse.tractusx.bpdm.common.dto.PaginationRequest import org.eclipse.tractusx.bpdm.gate.api.model.request.LegalEntityGateInputRequest import org.eclipse.tractusx.bpdm.gate.api.model.request.LegalEntityGateOutputRequest import org.eclipse.tractusx.bpdm.gate.api.model.response.LegalEntityGateInputDto diff --git a/bpdm-gate-api/src/main/kotlin/org/eclipse/tractusx/bpdm/gate/api/GateSharingStateApi.kt b/bpdm-gate-api/src/main/kotlin/org/eclipse/tractusx/bpdm/gate/api/GateSharingStateApi.kt index e5502907d..6ff2abcb4 100644 --- a/bpdm-gate-api/src/main/kotlin/org/eclipse/tractusx/bpdm/gate/api/GateSharingStateApi.kt +++ b/bpdm-gate-api/src/main/kotlin/org/eclipse/tractusx/bpdm/gate/api/GateSharingStateApi.kt @@ -26,8 +26,8 @@ import io.swagger.v3.oas.annotations.responses.ApiResponse import io.swagger.v3.oas.annotations.responses.ApiResponses import jakarta.validation.Valid import org.eclipse.tractusx.bpdm.common.dto.BusinessPartnerType -import org.eclipse.tractusx.bpdm.common.dto.request.PaginationRequest -import org.eclipse.tractusx.bpdm.common.dto.response.PageDto +import org.eclipse.tractusx.bpdm.common.dto.PageDto +import org.eclipse.tractusx.bpdm.common.dto.PaginationRequest import org.eclipse.tractusx.bpdm.gate.api.model.response.SharingStateDto import org.springdoc.core.annotations.ParameterObject import org.springframework.http.MediaType diff --git a/bpdm-gate-api/src/main/kotlin/org/eclipse/tractusx/bpdm/gate/api/GateSiteApi.kt b/bpdm-gate-api/src/main/kotlin/org/eclipse/tractusx/bpdm/gate/api/GateSiteApi.kt index 54f2e0b83..ec4910364 100644 --- a/bpdm-gate-api/src/main/kotlin/org/eclipse/tractusx/bpdm/gate/api/GateSiteApi.kt +++ b/bpdm-gate-api/src/main/kotlin/org/eclipse/tractusx/bpdm/gate/api/GateSiteApi.kt @@ -25,8 +25,8 @@ import io.swagger.v3.oas.annotations.media.Content import io.swagger.v3.oas.annotations.responses.ApiResponse import io.swagger.v3.oas.annotations.responses.ApiResponses import jakarta.validation.Valid -import org.eclipse.tractusx.bpdm.common.dto.request.PaginationRequest -import org.eclipse.tractusx.bpdm.common.dto.response.PageDto +import org.eclipse.tractusx.bpdm.common.dto.PageDto +import org.eclipse.tractusx.bpdm.common.dto.PaginationRequest import org.eclipse.tractusx.bpdm.gate.api.model.request.SiteGateInputRequest import org.eclipse.tractusx.bpdm.gate.api.model.request.SiteGateOutputRequest import org.eclipse.tractusx.bpdm.gate.api.model.response.SiteGateInputDto diff --git a/bpdm-gate/src/main/kotlin/org/eclipse/tractusx/bpdm/gate/controller/AddressController.kt b/bpdm-gate/src/main/kotlin/org/eclipse/tractusx/bpdm/gate/controller/AddressController.kt index b509fb587..c87ed606e 100644 --- a/bpdm-gate/src/main/kotlin/org/eclipse/tractusx/bpdm/gate/controller/AddressController.kt +++ b/bpdm-gate/src/main/kotlin/org/eclipse/tractusx/bpdm/gate/controller/AddressController.kt @@ -19,8 +19,8 @@ package org.eclipse.tractusx.bpdm.gate.controller -import org.eclipse.tractusx.bpdm.common.dto.request.PaginationRequest -import org.eclipse.tractusx.bpdm.common.dto.response.PageDto +import org.eclipse.tractusx.bpdm.common.dto.PageDto +import org.eclipse.tractusx.bpdm.common.dto.PaginationRequest import org.eclipse.tractusx.bpdm.gate.api.GateAddressApi import org.eclipse.tractusx.bpdm.gate.api.model.request.AddressGateInputRequest import org.eclipse.tractusx.bpdm.gate.api.model.request.AddressGateOutputRequest diff --git a/bpdm-gate/src/main/kotlin/org/eclipse/tractusx/bpdm/gate/controller/BusinessPartnerController.kt b/bpdm-gate/src/main/kotlin/org/eclipse/tractusx/bpdm/gate/controller/BusinessPartnerController.kt index 50cd47e21..19c30f5b3 100644 --- a/bpdm-gate/src/main/kotlin/org/eclipse/tractusx/bpdm/gate/controller/BusinessPartnerController.kt +++ b/bpdm-gate/src/main/kotlin/org/eclipse/tractusx/bpdm/gate/controller/BusinessPartnerController.kt @@ -19,8 +19,8 @@ package org.eclipse.tractusx.bpdm.gate.controller -import org.eclipse.tractusx.bpdm.common.dto.request.PaginationRequest -import org.eclipse.tractusx.bpdm.common.dto.response.PageDto +import org.eclipse.tractusx.bpdm.common.dto.PageDto +import org.eclipse.tractusx.bpdm.common.dto.PaginationRequest import org.eclipse.tractusx.bpdm.common.service.toPageRequest import org.eclipse.tractusx.bpdm.gate.api.GateBusinessPartnerApi import org.eclipse.tractusx.bpdm.gate.api.model.request.BusinessPartnerInputRequest diff --git a/bpdm-gate/src/main/kotlin/org/eclipse/tractusx/bpdm/gate/controller/ChangelogController.kt b/bpdm-gate/src/main/kotlin/org/eclipse/tractusx/bpdm/gate/controller/ChangelogController.kt index fcf600899..6087ab665 100644 --- a/bpdm-gate/src/main/kotlin/org/eclipse/tractusx/bpdm/gate/controller/ChangelogController.kt +++ b/bpdm-gate/src/main/kotlin/org/eclipse/tractusx/bpdm/gate/controller/ChangelogController.kt @@ -19,7 +19,7 @@ package org.eclipse.tractusx.bpdm.gate.controller -import org.eclipse.tractusx.bpdm.common.dto.request.PaginationRequest +import org.eclipse.tractusx.bpdm.common.dto.PaginationRequest import org.eclipse.tractusx.bpdm.common.model.StageType import org.eclipse.tractusx.bpdm.gate.api.GateChangelogApi import org.eclipse.tractusx.bpdm.gate.api.model.request.ChangelogSearchRequest diff --git a/bpdm-gate/src/main/kotlin/org/eclipse/tractusx/bpdm/gate/controller/LegalEntityController.kt b/bpdm-gate/src/main/kotlin/org/eclipse/tractusx/bpdm/gate/controller/LegalEntityController.kt index 97a4154a8..0fabc3ee4 100644 --- a/bpdm-gate/src/main/kotlin/org/eclipse/tractusx/bpdm/gate/controller/LegalEntityController.kt +++ b/bpdm-gate/src/main/kotlin/org/eclipse/tractusx/bpdm/gate/controller/LegalEntityController.kt @@ -19,8 +19,8 @@ package org.eclipse.tractusx.bpdm.gate.controller -import org.eclipse.tractusx.bpdm.common.dto.request.PaginationRequest -import org.eclipse.tractusx.bpdm.common.dto.response.PageDto +import org.eclipse.tractusx.bpdm.common.dto.PageDto +import org.eclipse.tractusx.bpdm.common.dto.PaginationRequest import org.eclipse.tractusx.bpdm.gate.api.GateLegalEntityApi import org.eclipse.tractusx.bpdm.gate.api.model.request.LegalEntityGateInputRequest import org.eclipse.tractusx.bpdm.gate.api.model.request.LegalEntityGateOutputRequest diff --git a/bpdm-gate/src/main/kotlin/org/eclipse/tractusx/bpdm/gate/controller/SharingStateController.kt b/bpdm-gate/src/main/kotlin/org/eclipse/tractusx/bpdm/gate/controller/SharingStateController.kt index 3c56a84f5..8782d6576 100644 --- a/bpdm-gate/src/main/kotlin/org/eclipse/tractusx/bpdm/gate/controller/SharingStateController.kt +++ b/bpdm-gate/src/main/kotlin/org/eclipse/tractusx/bpdm/gate/controller/SharingStateController.kt @@ -21,8 +21,8 @@ package org.eclipse.tractusx.bpdm.gate.controller import mu.KotlinLogging import org.eclipse.tractusx.bpdm.common.dto.BusinessPartnerType -import org.eclipse.tractusx.bpdm.common.dto.request.PaginationRequest -import org.eclipse.tractusx.bpdm.common.dto.response.PageDto +import org.eclipse.tractusx.bpdm.common.dto.PageDto +import org.eclipse.tractusx.bpdm.common.dto.PaginationRequest import org.eclipse.tractusx.bpdm.gate.api.GateSharingStateApi import org.eclipse.tractusx.bpdm.gate.api.model.response.SharingStateDto import org.eclipse.tractusx.bpdm.gate.service.SharingStateService diff --git a/bpdm-gate/src/main/kotlin/org/eclipse/tractusx/bpdm/gate/controller/SiteController.kt b/bpdm-gate/src/main/kotlin/org/eclipse/tractusx/bpdm/gate/controller/SiteController.kt index cbb04ce7f..d55d03279 100644 --- a/bpdm-gate/src/main/kotlin/org/eclipse/tractusx/bpdm/gate/controller/SiteController.kt +++ b/bpdm-gate/src/main/kotlin/org/eclipse/tractusx/bpdm/gate/controller/SiteController.kt @@ -19,8 +19,8 @@ package org.eclipse.tractusx.bpdm.gate.controller -import org.eclipse.tractusx.bpdm.common.dto.request.PaginationRequest -import org.eclipse.tractusx.bpdm.common.dto.response.PageDto +import org.eclipse.tractusx.bpdm.common.dto.PageDto +import org.eclipse.tractusx.bpdm.common.dto.PaginationRequest import org.eclipse.tractusx.bpdm.gate.api.GateSiteApi import org.eclipse.tractusx.bpdm.gate.api.model.request.SiteGateInputRequest import org.eclipse.tractusx.bpdm.gate.api.model.request.SiteGateOutputRequest diff --git a/bpdm-gate/src/main/kotlin/org/eclipse/tractusx/bpdm/gate/service/AddressService.kt b/bpdm-gate/src/main/kotlin/org/eclipse/tractusx/bpdm/gate/service/AddressService.kt index 30cfe247b..477285c33 100644 --- a/bpdm-gate/src/main/kotlin/org/eclipse/tractusx/bpdm/gate/service/AddressService.kt +++ b/bpdm-gate/src/main/kotlin/org/eclipse/tractusx/bpdm/gate/service/AddressService.kt @@ -19,7 +19,7 @@ package org.eclipse.tractusx.bpdm.gate.service -import org.eclipse.tractusx.bpdm.common.dto.response.PageDto +import org.eclipse.tractusx.bpdm.common.dto.PageDto import org.eclipse.tractusx.bpdm.common.exception.BpdmNotFoundException import org.eclipse.tractusx.bpdm.common.model.StageType import org.eclipse.tractusx.bpdm.gate.api.model.request.AddressGateInputRequest @@ -36,7 +36,6 @@ import org.springframework.stereotype.Service class AddressService( private val addressPersistenceService: AddressPersistenceService, private val addressRepository: GateAddressRepository, - private val sharingStateService: SharingStateService ) { fun getAddresses(page: Int, size: Int, externalIds: Collection? = null): PageDto { diff --git a/bpdm-gate/src/main/kotlin/org/eclipse/tractusx/bpdm/gate/service/BusinessPartnerService.kt b/bpdm-gate/src/main/kotlin/org/eclipse/tractusx/bpdm/gate/service/BusinessPartnerService.kt index 22cb562b1..d20e13fb8 100644 --- a/bpdm-gate/src/main/kotlin/org/eclipse/tractusx/bpdm/gate/service/BusinessPartnerService.kt +++ b/bpdm-gate/src/main/kotlin/org/eclipse/tractusx/bpdm/gate/service/BusinessPartnerService.kt @@ -21,8 +21,8 @@ package org.eclipse.tractusx.bpdm.gate.service import mu.KotlinLogging import org.eclipse.tractusx.bpdm.common.dto.BusinessPartnerType -import org.eclipse.tractusx.bpdm.common.dto.request.PaginationRequest -import org.eclipse.tractusx.bpdm.common.dto.response.PageDto +import org.eclipse.tractusx.bpdm.common.dto.PaginationRequest +import org.eclipse.tractusx.bpdm.common.dto.PageDto import org.eclipse.tractusx.bpdm.common.model.StageType import org.eclipse.tractusx.bpdm.common.service.toPageDto import org.eclipse.tractusx.bpdm.common.util.copyAndSync diff --git a/bpdm-gate/src/main/kotlin/org/eclipse/tractusx/bpdm/gate/service/LegalEntityService.kt b/bpdm-gate/src/main/kotlin/org/eclipse/tractusx/bpdm/gate/service/LegalEntityService.kt index 157059bf1..9ca1eb902 100644 --- a/bpdm-gate/src/main/kotlin/org/eclipse/tractusx/bpdm/gate/service/LegalEntityService.kt +++ b/bpdm-gate/src/main/kotlin/org/eclipse/tractusx/bpdm/gate/service/LegalEntityService.kt @@ -19,7 +19,7 @@ package org.eclipse.tractusx.bpdm.gate.service -import org.eclipse.tractusx.bpdm.common.dto.response.PageDto +import org.eclipse.tractusx.bpdm.common.dto.PageDto import org.eclipse.tractusx.bpdm.common.exception.BpdmNotFoundException import org.eclipse.tractusx.bpdm.common.model.StageType import org.eclipse.tractusx.bpdm.gate.api.model.request.LegalEntityGateInputRequest diff --git a/bpdm-gate/src/main/kotlin/org/eclipse/tractusx/bpdm/gate/service/ResponseMappings.kt b/bpdm-gate/src/main/kotlin/org/eclipse/tractusx/bpdm/gate/service/ResponseMappings.kt index fc1720056..e24436a5a 100644 --- a/bpdm-gate/src/main/kotlin/org/eclipse/tractusx/bpdm/gate/service/ResponseMappings.kt +++ b/bpdm-gate/src/main/kotlin/org/eclipse/tractusx/bpdm/gate/service/ResponseMappings.kt @@ -22,7 +22,7 @@ package org.eclipse.tractusx.bpdm.gate.service import org.eclipse.tractusx.bpdm.common.dto.BusinessPartnerRole import org.eclipse.tractusx.bpdm.common.dto.BusinessPartnerType import org.eclipse.tractusx.bpdm.common.dto.GeoCoordinateDto -import org.eclipse.tractusx.bpdm.common.dto.response.PageDto +import org.eclipse.tractusx.bpdm.common.dto.PageDto import org.eclipse.tractusx.bpdm.common.model.StageType import org.eclipse.tractusx.bpdm.gate.api.model.* import org.eclipse.tractusx.bpdm.gate.api.model.request.* diff --git a/bpdm-gate/src/main/kotlin/org/eclipse/tractusx/bpdm/gate/service/SharingStateService.kt b/bpdm-gate/src/main/kotlin/org/eclipse/tractusx/bpdm/gate/service/SharingStateService.kt index 893324085..ac3c52a36 100644 --- a/bpdm-gate/src/main/kotlin/org/eclipse/tractusx/bpdm/gate/service/SharingStateService.kt +++ b/bpdm-gate/src/main/kotlin/org/eclipse/tractusx/bpdm/gate/service/SharingStateService.kt @@ -21,8 +21,8 @@ package org.eclipse.tractusx.bpdm.gate.service import mu.KotlinLogging import org.eclipse.tractusx.bpdm.common.dto.BusinessPartnerType -import org.eclipse.tractusx.bpdm.common.dto.request.PaginationRequest -import org.eclipse.tractusx.bpdm.common.dto.response.PageDto +import org.eclipse.tractusx.bpdm.common.dto.PageDto +import org.eclipse.tractusx.bpdm.common.dto.PaginationRequest import org.eclipse.tractusx.bpdm.common.service.toPageDto import org.eclipse.tractusx.bpdm.gate.api.exception.BusinessPartnerSharingError import org.eclipse.tractusx.bpdm.gate.api.model.SharingStateType diff --git a/bpdm-gate/src/main/kotlin/org/eclipse/tractusx/bpdm/gate/service/SiteService.kt b/bpdm-gate/src/main/kotlin/org/eclipse/tractusx/bpdm/gate/service/SiteService.kt index 5ef66e96f..03b490c3c 100644 --- a/bpdm-gate/src/main/kotlin/org/eclipse/tractusx/bpdm/gate/service/SiteService.kt +++ b/bpdm-gate/src/main/kotlin/org/eclipse/tractusx/bpdm/gate/service/SiteService.kt @@ -19,15 +19,13 @@ package org.eclipse.tractusx.bpdm.gate.service -import mu.KotlinLogging -import org.eclipse.tractusx.bpdm.common.dto.response.PageDto +import org.eclipse.tractusx.bpdm.common.dto.PageDto import org.eclipse.tractusx.bpdm.common.exception.BpdmNotFoundException import org.eclipse.tractusx.bpdm.common.model.StageType import org.eclipse.tractusx.bpdm.gate.api.model.request.SiteGateInputRequest import org.eclipse.tractusx.bpdm.gate.api.model.request.SiteGateOutputRequest import org.eclipse.tractusx.bpdm.gate.api.model.response.SiteGateInputDto import org.eclipse.tractusx.bpdm.gate.api.model.response.SiteGateOutputResponse -import org.eclipse.tractusx.bpdm.gate.config.BpnConfigProperties import org.eclipse.tractusx.bpdm.gate.entity.Site import org.eclipse.tractusx.bpdm.gate.repository.SiteRepository import org.springframework.data.domain.Page @@ -36,12 +34,9 @@ import org.springframework.stereotype.Service @Service class SiteService( - private val bpnConfigProperties: BpnConfigProperties, private val sitePersistenceService: SitePersistenceService, private val siteRepository: SiteRepository, - private val sharingStateService: SharingStateService ) { - private val logger = KotlinLogging.logger { } fun getSites(page: Int, size: Int, externalIds: Collection? = null): PageDto { diff --git a/bpdm-gate/src/test/kotlin/org/eclipse/tractusx/bpdm/gate/controller/BusinessPartnerControllerIT.kt b/bpdm-gate/src/test/kotlin/org/eclipse/tractusx/bpdm/gate/controller/BusinessPartnerControllerIT.kt index 4e859e06c..0da277231 100644 --- a/bpdm-gate/src/test/kotlin/org/eclipse/tractusx/bpdm/gate/controller/BusinessPartnerControllerIT.kt +++ b/bpdm-gate/src/test/kotlin/org/eclipse/tractusx/bpdm/gate/controller/BusinessPartnerControllerIT.kt @@ -25,8 +25,6 @@ import com.github.tomakehurst.wiremock.core.WireMockConfiguration import com.github.tomakehurst.wiremock.junit5.WireMockExtension import org.assertj.core.api.Assertions import org.eclipse.tractusx.bpdm.common.dto.* -import org.eclipse.tractusx.bpdm.common.dto.request.PaginationRequest -import org.eclipse.tractusx.bpdm.common.dto.response.PageDto import org.eclipse.tractusx.bpdm.common.exception.BpdmNullMappingException import org.eclipse.tractusx.bpdm.gate.api.client.GateClient import org.eclipse.tractusx.bpdm.gate.api.exception.BusinessPartnerSharingError diff --git a/bpdm-gate/src/test/kotlin/org/eclipse/tractusx/bpdm/gate/controller/ChangeLogControllerIT.kt b/bpdm-gate/src/test/kotlin/org/eclipse/tractusx/bpdm/gate/controller/ChangeLogControllerIT.kt index accaa8336..23bffc699 100644 --- a/bpdm-gate/src/test/kotlin/org/eclipse/tractusx/bpdm/gate/controller/ChangeLogControllerIT.kt +++ b/bpdm-gate/src/test/kotlin/org/eclipse/tractusx/bpdm/gate/controller/ChangeLogControllerIT.kt @@ -45,7 +45,7 @@ import com.github.tomakehurst.wiremock.junit5.WireMockExtension import org.assertj.core.api.Assertions.assertThat import org.assertj.core.api.RecursiveComparisonAssert import org.eclipse.tractusx.bpdm.common.dto.BusinessPartnerType -import org.eclipse.tractusx.bpdm.common.dto.request.PaginationRequest +import org.eclipse.tractusx.bpdm.common.dto.PaginationRequest import org.eclipse.tractusx.bpdm.gate.api.client.GateClient import org.eclipse.tractusx.bpdm.gate.api.exception.ChangeLogOutputError import org.eclipse.tractusx.bpdm.gate.api.model.ChangelogType diff --git a/bpdm-gate/src/test/kotlin/org/eclipse/tractusx/bpdm/gate/controller/LegalEntityControllerInputIT.kt b/bpdm-gate/src/test/kotlin/org/eclipse/tractusx/bpdm/gate/controller/LegalEntityControllerInputIT.kt index ac0a7ede0..97a35c427 100644 --- a/bpdm-gate/src/test/kotlin/org/eclipse/tractusx/bpdm/gate/controller/LegalEntityControllerInputIT.kt +++ b/bpdm-gate/src/test/kotlin/org/eclipse/tractusx/bpdm/gate/controller/LegalEntityControllerInputIT.kt @@ -27,8 +27,8 @@ import com.github.tomakehurst.wiremock.client.WireMock.* import com.github.tomakehurst.wiremock.core.WireMockConfiguration import com.github.tomakehurst.wiremock.junit5.WireMockExtension import org.assertj.core.api.Assertions.assertThat -import org.eclipse.tractusx.bpdm.common.dto.request.PaginationRequest -import org.eclipse.tractusx.bpdm.common.dto.response.PageDto +import org.eclipse.tractusx.bpdm.common.dto.PageDto +import org.eclipse.tractusx.bpdm.common.dto.PaginationRequest import org.eclipse.tractusx.bpdm.gate.api.client.GateClient import org.eclipse.tractusx.bpdm.gate.api.model.request.LegalEntityGateInputRequest import org.eclipse.tractusx.bpdm.gate.repository.LegalEntityRepository diff --git a/bpdm-gate/src/test/kotlin/org/eclipse/tractusx/bpdm/gate/controller/LegalEntityControllerOutputIT.kt b/bpdm-gate/src/test/kotlin/org/eclipse/tractusx/bpdm/gate/controller/LegalEntityControllerOutputIT.kt index 1b5c53988..21ca30fa2 100644 --- a/bpdm-gate/src/test/kotlin/org/eclipse/tractusx/bpdm/gate/controller/LegalEntityControllerOutputIT.kt +++ b/bpdm-gate/src/test/kotlin/org/eclipse/tractusx/bpdm/gate/controller/LegalEntityControllerOutputIT.kt @@ -23,8 +23,8 @@ import com.github.tomakehurst.wiremock.client.WireMock.* import com.github.tomakehurst.wiremock.core.WireMockConfiguration import com.github.tomakehurst.wiremock.junit5.WireMockExtension import org.assertj.core.api.Assertions.assertThat -import org.eclipse.tractusx.bpdm.common.dto.request.PaginationRequest -import org.eclipse.tractusx.bpdm.common.dto.response.PageDto +import org.eclipse.tractusx.bpdm.common.dto.PageDto +import org.eclipse.tractusx.bpdm.common.dto.PaginationRequest import org.eclipse.tractusx.bpdm.common.model.StageType import org.eclipse.tractusx.bpdm.gate.api.client.GateClient import org.eclipse.tractusx.bpdm.gate.repository.LegalEntityRepository diff --git a/bpdm-gate/src/test/kotlin/org/eclipse/tractusx/bpdm/gate/controller/PostalAddressControllerInputIT.kt b/bpdm-gate/src/test/kotlin/org/eclipse/tractusx/bpdm/gate/controller/PostalAddressControllerInputIT.kt index 02667d319..ee9b2ad1e 100644 --- a/bpdm-gate/src/test/kotlin/org/eclipse/tractusx/bpdm/gate/controller/PostalAddressControllerInputIT.kt +++ b/bpdm-gate/src/test/kotlin/org/eclipse/tractusx/bpdm/gate/controller/PostalAddressControllerInputIT.kt @@ -42,8 +42,8 @@ import com.github.tomakehurst.wiremock.client.WireMock.* import com.github.tomakehurst.wiremock.core.WireMockConfiguration import com.github.tomakehurst.wiremock.junit5.WireMockExtension import org.assertj.core.api.Assertions.assertThat -import org.eclipse.tractusx.bpdm.common.dto.request.PaginationRequest -import org.eclipse.tractusx.bpdm.common.dto.response.PageDto +import org.eclipse.tractusx.bpdm.common.dto.PageDto +import org.eclipse.tractusx.bpdm.common.dto.PaginationRequest import org.eclipse.tractusx.bpdm.gate.api.client.GateClient import org.eclipse.tractusx.bpdm.gate.repository.GateAddressRepository import org.eclipse.tractusx.bpdm.gate.util.* diff --git a/bpdm-gate/src/test/kotlin/org/eclipse/tractusx/bpdm/gate/controller/PostalAddressControllerOutputIT.kt b/bpdm-gate/src/test/kotlin/org/eclipse/tractusx/bpdm/gate/controller/PostalAddressControllerOutputIT.kt index 8f5faf3ea..97a6ae57d 100644 --- a/bpdm-gate/src/test/kotlin/org/eclipse/tractusx/bpdm/gate/controller/PostalAddressControllerOutputIT.kt +++ b/bpdm-gate/src/test/kotlin/org/eclipse/tractusx/bpdm/gate/controller/PostalAddressControllerOutputIT.kt @@ -42,8 +42,8 @@ import com.github.tomakehurst.wiremock.client.WireMock.* import com.github.tomakehurst.wiremock.core.WireMockConfiguration import com.github.tomakehurst.wiremock.junit5.WireMockExtension import org.assertj.core.api.Assertions.assertThat -import org.eclipse.tractusx.bpdm.common.dto.request.PaginationRequest -import org.eclipse.tractusx.bpdm.common.dto.response.PageDto +import org.eclipse.tractusx.bpdm.common.dto.PageDto +import org.eclipse.tractusx.bpdm.common.dto.PaginationRequest import org.eclipse.tractusx.bpdm.common.model.StageType import org.eclipse.tractusx.bpdm.gate.api.client.GateClient import org.eclipse.tractusx.bpdm.gate.repository.GateAddressRepository diff --git a/bpdm-gate/src/test/kotlin/org/eclipse/tractusx/bpdm/gate/controller/SharingStateControllerIT.kt b/bpdm-gate/src/test/kotlin/org/eclipse/tractusx/bpdm/gate/controller/SharingStateControllerIT.kt index b8b28dc94..4653dc1ad 100644 --- a/bpdm-gate/src/test/kotlin/org/eclipse/tractusx/bpdm/gate/controller/SharingStateControllerIT.kt +++ b/bpdm-gate/src/test/kotlin/org/eclipse/tractusx/bpdm/gate/controller/SharingStateControllerIT.kt @@ -22,8 +22,8 @@ package org.eclipse.tractusx.bpdm.gate.controller import org.assertj.core.api.Assertions.assertThat import org.assertj.core.api.Assertions.assertThatThrownBy import org.eclipse.tractusx.bpdm.common.dto.BusinessPartnerType -import org.eclipse.tractusx.bpdm.common.dto.request.PaginationRequest -import org.eclipse.tractusx.bpdm.common.dto.response.PageDto +import org.eclipse.tractusx.bpdm.common.dto.PageDto +import org.eclipse.tractusx.bpdm.common.dto.PaginationRequest import org.eclipse.tractusx.bpdm.gate.api.client.GateClient import org.eclipse.tractusx.bpdm.gate.api.exception.BusinessPartnerSharingError.SharingProcessError import org.eclipse.tractusx.bpdm.gate.api.model.SharingStateType diff --git a/bpdm-gate/src/test/kotlin/org/eclipse/tractusx/bpdm/gate/controller/SiteControllerInputIT.kt b/bpdm-gate/src/test/kotlin/org/eclipse/tractusx/bpdm/gate/controller/SiteControllerInputIT.kt index c1c3d3648..3ae380d46 100644 --- a/bpdm-gate/src/test/kotlin/org/eclipse/tractusx/bpdm/gate/controller/SiteControllerInputIT.kt +++ b/bpdm-gate/src/test/kotlin/org/eclipse/tractusx/bpdm/gate/controller/SiteControllerInputIT.kt @@ -23,8 +23,8 @@ import com.github.tomakehurst.wiremock.client.WireMock.* import com.github.tomakehurst.wiremock.core.WireMockConfiguration import com.github.tomakehurst.wiremock.junit5.WireMockExtension import org.assertj.core.api.Assertions.assertThat -import org.eclipse.tractusx.bpdm.common.dto.request.PaginationRequest -import org.eclipse.tractusx.bpdm.common.dto.response.PageDto +import org.eclipse.tractusx.bpdm.common.dto.PageDto +import org.eclipse.tractusx.bpdm.common.dto.PaginationRequest import org.eclipse.tractusx.bpdm.gate.api.client.GateClient import org.eclipse.tractusx.bpdm.gate.repository.SiteRepository import org.eclipse.tractusx.bpdm.gate.util.* diff --git a/bpdm-gate/src/test/kotlin/org/eclipse/tractusx/bpdm/gate/controller/SiteControllerOutputIT.kt b/bpdm-gate/src/test/kotlin/org/eclipse/tractusx/bpdm/gate/controller/SiteControllerOutputIT.kt index 8003d963d..27ffffa7c 100644 --- a/bpdm-gate/src/test/kotlin/org/eclipse/tractusx/bpdm/gate/controller/SiteControllerOutputIT.kt +++ b/bpdm-gate/src/test/kotlin/org/eclipse/tractusx/bpdm/gate/controller/SiteControllerOutputIT.kt @@ -23,8 +23,8 @@ import com.github.tomakehurst.wiremock.client.WireMock.* import com.github.tomakehurst.wiremock.core.WireMockConfiguration import com.github.tomakehurst.wiremock.junit5.WireMockExtension import org.assertj.core.api.Assertions.assertThat -import org.eclipse.tractusx.bpdm.common.dto.request.PaginationRequest -import org.eclipse.tractusx.bpdm.common.dto.response.PageDto +import org.eclipse.tractusx.bpdm.common.dto.PageDto +import org.eclipse.tractusx.bpdm.common.dto.PaginationRequest import org.eclipse.tractusx.bpdm.common.model.StageType import org.eclipse.tractusx.bpdm.gate.api.client.GateClient import org.eclipse.tractusx.bpdm.gate.repository.SiteRepository diff --git a/bpdm-gate/src/test/kotlin/org/eclipse/tractusx/bpdm/gate/util/BusinessPartnerVerboseValues.kt b/bpdm-gate/src/test/kotlin/org/eclipse/tractusx/bpdm/gate/util/BusinessPartnerVerboseValues.kt index 848c1bcd4..7b769484f 100644 --- a/bpdm-gate/src/test/kotlin/org/eclipse/tractusx/bpdm/gate/util/BusinessPartnerVerboseValues.kt +++ b/bpdm-gate/src/test/kotlin/org/eclipse/tractusx/bpdm/gate/util/BusinessPartnerVerboseValues.kt @@ -23,7 +23,7 @@ import com.neovisionaries.i18n.CountryCode import org.eclipse.tractusx.bpdm.common.dto.AddressType import org.eclipse.tractusx.bpdm.common.dto.BusinessPartnerRole import org.eclipse.tractusx.bpdm.common.dto.GeoCoordinateDto -import org.eclipse.tractusx.bpdm.common.dto.response.type.TypeKeyNameVerboseDto +import org.eclipse.tractusx.bpdm.common.dto.TypeKeyNameVerboseDto import org.eclipse.tractusx.bpdm.common.model.BusinessStateType import org.eclipse.tractusx.bpdm.common.model.ClassificationType import org.eclipse.tractusx.bpdm.common.model.DeliveryServiceType diff --git a/bpdm-pool-api/src/main/kotlin/org/eclipse/tractusx/bpdm/pool/api/PoolAddressApi.kt b/bpdm-pool-api/src/main/kotlin/org/eclipse/tractusx/bpdm/pool/api/PoolAddressApi.kt index 6d034ae30..3762bbf73 100644 --- a/bpdm-pool-api/src/main/kotlin/org/eclipse/tractusx/bpdm/pool/api/PoolAddressApi.kt +++ b/bpdm-pool-api/src/main/kotlin/org/eclipse/tractusx/bpdm/pool/api/PoolAddressApi.kt @@ -24,8 +24,8 @@ import io.swagger.v3.oas.annotations.Parameter import io.swagger.v3.oas.annotations.media.Content import io.swagger.v3.oas.annotations.responses.ApiResponse import io.swagger.v3.oas.annotations.responses.ApiResponses -import org.eclipse.tractusx.bpdm.common.dto.request.PaginationRequest -import org.eclipse.tractusx.bpdm.common.dto.response.PageDto +import org.eclipse.tractusx.bpdm.common.dto.PageDto +import org.eclipse.tractusx.bpdm.common.dto.PaginationRequest import org.eclipse.tractusx.bpdm.pool.api.model.LogisticAddressVerboseDto import org.eclipse.tractusx.bpdm.pool.api.model.request.AddressPartnerBpnSearchRequest import org.eclipse.tractusx.bpdm.pool.api.model.request.AddressPartnerCreateRequest diff --git a/bpdm-pool-api/src/main/kotlin/org/eclipse/tractusx/bpdm/pool/api/PoolChangelogApi.kt b/bpdm-pool-api/src/main/kotlin/org/eclipse/tractusx/bpdm/pool/api/PoolChangelogApi.kt index d967e4dc0..85df268bb 100644 --- a/bpdm-pool-api/src/main/kotlin/org/eclipse/tractusx/bpdm/pool/api/PoolChangelogApi.kt +++ b/bpdm-pool-api/src/main/kotlin/org/eclipse/tractusx/bpdm/pool/api/PoolChangelogApi.kt @@ -24,8 +24,8 @@ import io.swagger.v3.oas.annotations.Operation import io.swagger.v3.oas.annotations.media.Content import io.swagger.v3.oas.annotations.responses.ApiResponse import io.swagger.v3.oas.annotations.responses.ApiResponses -import org.eclipse.tractusx.bpdm.common.dto.request.PaginationRequest -import org.eclipse.tractusx.bpdm.common.dto.response.PageDto +import org.eclipse.tractusx.bpdm.common.dto.PageDto +import org.eclipse.tractusx.bpdm.common.dto.PaginationRequest import org.eclipse.tractusx.bpdm.pool.api.model.request.ChangelogSearchRequest import org.eclipse.tractusx.bpdm.pool.api.model.response.ChangelogEntryVerboseDto import org.springdoc.core.annotations.ParameterObject diff --git a/bpdm-pool-api/src/main/kotlin/org/eclipse/tractusx/bpdm/pool/api/PoolLegalEntityApi.kt b/bpdm-pool-api/src/main/kotlin/org/eclipse/tractusx/bpdm/pool/api/PoolLegalEntityApi.kt index 5c2c4ca4f..6783d8e00 100644 --- a/bpdm-pool-api/src/main/kotlin/org/eclipse/tractusx/bpdm/pool/api/PoolLegalEntityApi.kt +++ b/bpdm-pool-api/src/main/kotlin/org/eclipse/tractusx/bpdm/pool/api/PoolLegalEntityApi.kt @@ -26,8 +26,8 @@ import io.swagger.v3.oas.annotations.media.Content import io.swagger.v3.oas.annotations.media.Schema import io.swagger.v3.oas.annotations.responses.ApiResponse import io.swagger.v3.oas.annotations.responses.ApiResponses -import org.eclipse.tractusx.bpdm.common.dto.request.PaginationRequest -import org.eclipse.tractusx.bpdm.common.dto.response.PageDto +import org.eclipse.tractusx.bpdm.common.dto.PageDto +import org.eclipse.tractusx.bpdm.common.dto.PaginationRequest import org.eclipse.tractusx.bpdm.pool.api.model.LogisticAddressVerboseDto import org.eclipse.tractusx.bpdm.pool.api.model.SiteVerboseDto import org.eclipse.tractusx.bpdm.pool.api.model.request.LegalEntityPartnerCreateRequest diff --git a/bpdm-pool-api/src/main/kotlin/org/eclipse/tractusx/bpdm/pool/api/PoolMetadataApi.kt b/bpdm-pool-api/src/main/kotlin/org/eclipse/tractusx/bpdm/pool/api/PoolMetadataApi.kt index d84799763..99358a911 100644 --- a/bpdm-pool-api/src/main/kotlin/org/eclipse/tractusx/bpdm/pool/api/PoolMetadataApi.kt +++ b/bpdm-pool-api/src/main/kotlin/org/eclipse/tractusx/bpdm/pool/api/PoolMetadataApi.kt @@ -25,14 +25,9 @@ import io.swagger.v3.oas.annotations.Parameter import io.swagger.v3.oas.annotations.media.Content import io.swagger.v3.oas.annotations.responses.ApiResponse import io.swagger.v3.oas.annotations.responses.ApiResponses -import org.eclipse.tractusx.bpdm.common.dto.FieldQualityRuleDto -import org.eclipse.tractusx.bpdm.common.dto.IdentifierBusinessPartnerType -import org.eclipse.tractusx.bpdm.common.dto.IdentifierTypeDto -import org.eclipse.tractusx.bpdm.common.dto.request.PaginationRequest -import org.eclipse.tractusx.bpdm.common.dto.response.PageDto -import org.eclipse.tractusx.bpdm.pool.api.model.CountrySubdivisionDto -import org.eclipse.tractusx.bpdm.pool.api.model.LegalFormDto -import org.eclipse.tractusx.bpdm.pool.api.model.RegionDto +import org.eclipse.tractusx.bpdm.common.dto.PageDto +import org.eclipse.tractusx.bpdm.common.dto.PaginationRequest +import org.eclipse.tractusx.bpdm.pool.api.model.* import org.eclipse.tractusx.bpdm.pool.api.model.request.LegalFormRequest import org.springdoc.core.annotations.ParameterObject import org.springframework.http.MediaType diff --git a/bpdm-pool-api/src/main/kotlin/org/eclipse/tractusx/bpdm/pool/api/PoolSaasApi.kt b/bpdm-pool-api/src/main/kotlin/org/eclipse/tractusx/bpdm/pool/api/PoolSaasApi.kt index cfed789b4..fafbfe8e6 100644 --- a/bpdm-pool-api/src/main/kotlin/org/eclipse/tractusx/bpdm/pool/api/PoolSaasApi.kt +++ b/bpdm-pool-api/src/main/kotlin/org/eclipse/tractusx/bpdm/pool/api/PoolSaasApi.kt @@ -24,8 +24,8 @@ import io.swagger.v3.oas.annotations.Operation import io.swagger.v3.oas.annotations.media.Content import io.swagger.v3.oas.annotations.responses.ApiResponse import io.swagger.v3.oas.annotations.responses.ApiResponses -import org.eclipse.tractusx.bpdm.common.dto.request.PaginationRequest -import org.eclipse.tractusx.bpdm.common.dto.response.PageDto +import org.eclipse.tractusx.bpdm.common.dto.PageDto +import org.eclipse.tractusx.bpdm.common.dto.PaginationRequest import org.eclipse.tractusx.bpdm.pool.api.model.ImportIdEntry import org.eclipse.tractusx.bpdm.pool.api.model.request.ImportIdFilterRequest import org.eclipse.tractusx.bpdm.pool.api.model.response.ImportIdMappingDto diff --git a/bpdm-pool-api/src/main/kotlin/org/eclipse/tractusx/bpdm/pool/api/PoolSiteApi.kt b/bpdm-pool-api/src/main/kotlin/org/eclipse/tractusx/bpdm/pool/api/PoolSiteApi.kt index 753c1596e..781ef524c 100644 --- a/bpdm-pool-api/src/main/kotlin/org/eclipse/tractusx/bpdm/pool/api/PoolSiteApi.kt +++ b/bpdm-pool-api/src/main/kotlin/org/eclipse/tractusx/bpdm/pool/api/PoolSiteApi.kt @@ -25,8 +25,8 @@ import io.swagger.v3.oas.annotations.Parameter import io.swagger.v3.oas.annotations.media.Content import io.swagger.v3.oas.annotations.responses.ApiResponse import io.swagger.v3.oas.annotations.responses.ApiResponses -import org.eclipse.tractusx.bpdm.common.dto.request.PaginationRequest -import org.eclipse.tractusx.bpdm.common.dto.response.PageDto +import org.eclipse.tractusx.bpdm.common.dto.PageDto +import org.eclipse.tractusx.bpdm.common.dto.PaginationRequest import org.eclipse.tractusx.bpdm.pool.api.model.request.SiteBpnSearchRequest import org.eclipse.tractusx.bpdm.pool.api.model.request.SitePartnerCreateRequest import org.eclipse.tractusx.bpdm.pool.api.model.request.SitePartnerUpdateRequest diff --git a/bpdm-pool-api/src/main/kotlin/org/eclipse/tractusx/bpdm/pool/api/model/AddressIdentifierVerboseDto.kt b/bpdm-pool-api/src/main/kotlin/org/eclipse/tractusx/bpdm/pool/api/model/AddressIdentifierVerboseDto.kt index 578f7c9e2..4c9dd48a6 100644 --- a/bpdm-pool-api/src/main/kotlin/org/eclipse/tractusx/bpdm/pool/api/model/AddressIdentifierVerboseDto.kt +++ b/bpdm-pool-api/src/main/kotlin/org/eclipse/tractusx/bpdm/pool/api/model/AddressIdentifierVerboseDto.kt @@ -20,8 +20,8 @@ package org.eclipse.tractusx.bpdm.pool.api.model import io.swagger.v3.oas.annotations.media.Schema +import org.eclipse.tractusx.bpdm.common.dto.TypeKeyNameVerboseDto import org.eclipse.tractusx.bpdm.common.dto.openapidescription.AddressIdentifierDescription -import org.eclipse.tractusx.bpdm.common.dto.response.type.TypeKeyNameVerboseDto @Schema(description = AddressIdentifierDescription.header) data class AddressIdentifierVerboseDto( diff --git a/bpdm-pool-api/src/main/kotlin/org/eclipse/tractusx/bpdm/pool/api/model/AddressStateVerboseDto.kt b/bpdm-pool-api/src/main/kotlin/org/eclipse/tractusx/bpdm/pool/api/model/AddressStateVerboseDto.kt index e2e92eaae..f7a8f6313 100644 --- a/bpdm-pool-api/src/main/kotlin/org/eclipse/tractusx/bpdm/pool/api/model/AddressStateVerboseDto.kt +++ b/bpdm-pool-api/src/main/kotlin/org/eclipse/tractusx/bpdm/pool/api/model/AddressStateVerboseDto.kt @@ -20,8 +20,8 @@ package org.eclipse.tractusx.bpdm.pool.api.model import io.swagger.v3.oas.annotations.media.Schema +import org.eclipse.tractusx.bpdm.common.dto.TypeKeyNameVerboseDto import org.eclipse.tractusx.bpdm.common.dto.openapidescription.AddressStateDescription -import org.eclipse.tractusx.bpdm.common.dto.response.type.TypeKeyNameVerboseDto import org.eclipse.tractusx.bpdm.common.model.BusinessStateType import java.time.LocalDateTime diff --git a/bpdm-pool-api/src/main/kotlin/org/eclipse/tractusx/bpdm/pool/api/model/AlternativePostalAddressVerboseDto.kt b/bpdm-pool-api/src/main/kotlin/org/eclipse/tractusx/bpdm/pool/api/model/AlternativePostalAddressVerboseDto.kt index b2ac32d5f..d8d7251b6 100644 --- a/bpdm-pool-api/src/main/kotlin/org/eclipse/tractusx/bpdm/pool/api/model/AlternativePostalAddressVerboseDto.kt +++ b/bpdm-pool-api/src/main/kotlin/org/eclipse/tractusx/bpdm/pool/api/model/AlternativePostalAddressVerboseDto.kt @@ -24,8 +24,8 @@ import com.neovisionaries.i18n.CountryCode import io.swagger.v3.oas.annotations.media.Schema import org.eclipse.tractusx.bpdm.common.dto.GeoCoordinateDto import org.eclipse.tractusx.bpdm.common.dto.IBaseAlternativePostalAddressDto +import org.eclipse.tractusx.bpdm.common.dto.TypeKeyNameVerboseDto import org.eclipse.tractusx.bpdm.common.dto.openapidescription.PostalAddressDescription -import org.eclipse.tractusx.bpdm.common.dto.response.type.TypeKeyNameVerboseDto import org.eclipse.tractusx.bpdm.common.model.DeliveryServiceType import org.eclipse.tractusx.bpdm.common.service.DataClassUnwrappedJsonDeserializer diff --git a/bpdm-common/src/main/kotlin/org/eclipse/tractusx/bpdm/common/dto/FieldQualityRuleDto.kt b/bpdm-pool-api/src/main/kotlin/org/eclipse/tractusx/bpdm/pool/api/model/FieldQualityRuleDto.kt similarity index 96% rename from bpdm-common/src/main/kotlin/org/eclipse/tractusx/bpdm/common/dto/FieldQualityRuleDto.kt rename to bpdm-pool-api/src/main/kotlin/org/eclipse/tractusx/bpdm/pool/api/model/FieldQualityRuleDto.kt index dec35684d..c8a4609ab 100644 --- a/bpdm-common/src/main/kotlin/org/eclipse/tractusx/bpdm/common/dto/FieldQualityRuleDto.kt +++ b/bpdm-pool-api/src/main/kotlin/org/eclipse/tractusx/bpdm/pool/api/model/FieldQualityRuleDto.kt @@ -17,7 +17,7 @@ * SPDX-License-Identifier: Apache-2.0 ******************************************************************************/ -package org.eclipse.tractusx.bpdm.common.dto +package org.eclipse.tractusx.bpdm.pool.api.model import com.neovisionaries.i18n.CountryCode import io.swagger.v3.oas.annotations.media.Schema diff --git a/bpdm-common/src/main/kotlin/org/eclipse/tractusx/bpdm/common/dto/IdentifierBusinessPartnerType.kt b/bpdm-pool-api/src/main/kotlin/org/eclipse/tractusx/bpdm/pool/api/model/IdentifierBusinessPartnerType.kt similarity index 95% rename from bpdm-common/src/main/kotlin/org/eclipse/tractusx/bpdm/common/dto/IdentifierBusinessPartnerType.kt rename to bpdm-pool-api/src/main/kotlin/org/eclipse/tractusx/bpdm/pool/api/model/IdentifierBusinessPartnerType.kt index c184746e9..a1e15e31c 100644 --- a/bpdm-common/src/main/kotlin/org/eclipse/tractusx/bpdm/common/dto/IdentifierBusinessPartnerType.kt +++ b/bpdm-pool-api/src/main/kotlin/org/eclipse/tractusx/bpdm/pool/api/model/IdentifierBusinessPartnerType.kt @@ -16,7 +16,7 @@ * * SPDX-License-Identifier: Apache-2.0 */ -package org.eclipse.tractusx.bpdm.common.dto +package org.eclipse.tractusx.bpdm.pool.api.model import io.swagger.v3.oas.annotations.media.Schema diff --git a/bpdm-common/src/main/kotlin/org/eclipse/tractusx/bpdm/common/dto/IdentifierTypeDetailDto.kt b/bpdm-pool-api/src/main/kotlin/org/eclipse/tractusx/bpdm/pool/api/model/IdentifierTypeDetailDto.kt similarity index 96% rename from bpdm-common/src/main/kotlin/org/eclipse/tractusx/bpdm/common/dto/IdentifierTypeDetailDto.kt rename to bpdm-pool-api/src/main/kotlin/org/eclipse/tractusx/bpdm/pool/api/model/IdentifierTypeDetailDto.kt index 98b010a25..749609cbf 100644 --- a/bpdm-common/src/main/kotlin/org/eclipse/tractusx/bpdm/common/dto/IdentifierTypeDetailDto.kt +++ b/bpdm-pool-api/src/main/kotlin/org/eclipse/tractusx/bpdm/pool/api/model/IdentifierTypeDetailDto.kt @@ -17,7 +17,7 @@ * SPDX-License-Identifier: Apache-2.0 ******************************************************************************/ -package org.eclipse.tractusx.bpdm.common.dto +package org.eclipse.tractusx.bpdm.pool.api.model import com.neovisionaries.i18n.CountryCode import io.swagger.v3.oas.annotations.media.Schema diff --git a/bpdm-common/src/main/kotlin/org/eclipse/tractusx/bpdm/common/dto/IdentifierTypeDto.kt b/bpdm-pool-api/src/main/kotlin/org/eclipse/tractusx/bpdm/pool/api/model/IdentifierTypeDto.kt similarity index 97% rename from bpdm-common/src/main/kotlin/org/eclipse/tractusx/bpdm/common/dto/IdentifierTypeDto.kt rename to bpdm-pool-api/src/main/kotlin/org/eclipse/tractusx/bpdm/pool/api/model/IdentifierTypeDto.kt index c5ee2c514..22be3a209 100644 --- a/bpdm-common/src/main/kotlin/org/eclipse/tractusx/bpdm/common/dto/IdentifierTypeDto.kt +++ b/bpdm-pool-api/src/main/kotlin/org/eclipse/tractusx/bpdm/pool/api/model/IdentifierTypeDto.kt @@ -17,7 +17,7 @@ * SPDX-License-Identifier: Apache-2.0 ******************************************************************************/ -package org.eclipse.tractusx.bpdm.common.dto +package org.eclipse.tractusx.bpdm.pool.api.model import io.swagger.v3.oas.annotations.media.Schema import org.eclipse.tractusx.bpdm.common.dto.openapidescription.IdentifierTypeDescription diff --git a/bpdm-pool-api/src/main/kotlin/org/eclipse/tractusx/bpdm/pool/api/model/LegalEntityClassificationVerboseDto.kt b/bpdm-pool-api/src/main/kotlin/org/eclipse/tractusx/bpdm/pool/api/model/LegalEntityClassificationVerboseDto.kt index 787c3a700..86f0c9d28 100644 --- a/bpdm-pool-api/src/main/kotlin/org/eclipse/tractusx/bpdm/pool/api/model/LegalEntityClassificationVerboseDto.kt +++ b/bpdm-pool-api/src/main/kotlin/org/eclipse/tractusx/bpdm/pool/api/model/LegalEntityClassificationVerboseDto.kt @@ -20,8 +20,8 @@ package org.eclipse.tractusx.bpdm.pool.api.model import io.swagger.v3.oas.annotations.media.Schema +import org.eclipse.tractusx.bpdm.common.dto.TypeKeyNameVerboseDto import org.eclipse.tractusx.bpdm.common.dto.openapidescription.ClassificationDescription -import org.eclipse.tractusx.bpdm.common.dto.response.type.TypeKeyNameVerboseDto import org.eclipse.tractusx.bpdm.common.model.ClassificationType @Schema(description = ClassificationDescription.header) diff --git a/bpdm-pool-api/src/main/kotlin/org/eclipse/tractusx/bpdm/pool/api/model/LegalEntityIdentifierVerboseDto.kt b/bpdm-pool-api/src/main/kotlin/org/eclipse/tractusx/bpdm/pool/api/model/LegalEntityIdentifierVerboseDto.kt index 14e9960f3..2a818f175 100644 --- a/bpdm-pool-api/src/main/kotlin/org/eclipse/tractusx/bpdm/pool/api/model/LegalEntityIdentifierVerboseDto.kt +++ b/bpdm-pool-api/src/main/kotlin/org/eclipse/tractusx/bpdm/pool/api/model/LegalEntityIdentifierVerboseDto.kt @@ -20,8 +20,8 @@ package org.eclipse.tractusx.bpdm.pool.api.model import io.swagger.v3.oas.annotations.media.Schema +import org.eclipse.tractusx.bpdm.common.dto.TypeKeyNameVerboseDto import org.eclipse.tractusx.bpdm.common.dto.openapidescription.LegalEntityIdentifierDescription -import org.eclipse.tractusx.bpdm.common.dto.response.type.TypeKeyNameVerboseDto @Schema(description = LegalEntityIdentifierDescription.header) data class LegalEntityIdentifierVerboseDto( diff --git a/bpdm-pool-api/src/main/kotlin/org/eclipse/tractusx/bpdm/pool/api/model/LegalEntityStateVerboseDto.kt b/bpdm-pool-api/src/main/kotlin/org/eclipse/tractusx/bpdm/pool/api/model/LegalEntityStateVerboseDto.kt index d1321447c..2da56ee10 100644 --- a/bpdm-pool-api/src/main/kotlin/org/eclipse/tractusx/bpdm/pool/api/model/LegalEntityStateVerboseDto.kt +++ b/bpdm-pool-api/src/main/kotlin/org/eclipse/tractusx/bpdm/pool/api/model/LegalEntityStateVerboseDto.kt @@ -20,8 +20,8 @@ package org.eclipse.tractusx.bpdm.pool.api.model import io.swagger.v3.oas.annotations.media.Schema +import org.eclipse.tractusx.bpdm.common.dto.TypeKeyNameVerboseDto import org.eclipse.tractusx.bpdm.common.dto.openapidescription.LegalEntityStateDescription -import org.eclipse.tractusx.bpdm.common.dto.response.type.TypeKeyNameVerboseDto import org.eclipse.tractusx.bpdm.common.model.BusinessStateType import java.time.LocalDateTime diff --git a/bpdm-pool-api/src/main/kotlin/org/eclipse/tractusx/bpdm/pool/api/model/PhysicalPostalAddressVerboseDto.kt b/bpdm-pool-api/src/main/kotlin/org/eclipse/tractusx/bpdm/pool/api/model/PhysicalPostalAddressVerboseDto.kt index 4c61686ac..cec5f7cfd 100644 --- a/bpdm-pool-api/src/main/kotlin/org/eclipse/tractusx/bpdm/pool/api/model/PhysicalPostalAddressVerboseDto.kt +++ b/bpdm-pool-api/src/main/kotlin/org/eclipse/tractusx/bpdm/pool/api/model/PhysicalPostalAddressVerboseDto.kt @@ -24,8 +24,8 @@ import com.neovisionaries.i18n.CountryCode import io.swagger.v3.oas.annotations.media.Schema import org.eclipse.tractusx.bpdm.common.dto.GeoCoordinateDto import org.eclipse.tractusx.bpdm.common.dto.IBasePhysicalPostalAddressDto +import org.eclipse.tractusx.bpdm.common.dto.TypeKeyNameVerboseDto import org.eclipse.tractusx.bpdm.common.dto.openapidescription.PostalAddressDescription -import org.eclipse.tractusx.bpdm.common.dto.response.type.TypeKeyNameVerboseDto import org.eclipse.tractusx.bpdm.common.service.DataClassUnwrappedJsonDeserializer @JsonDeserialize(using = DataClassUnwrappedJsonDeserializer::class) diff --git a/bpdm-common/src/main/kotlin/org/eclipse/tractusx/bpdm/common/dto/QualityLevel.kt b/bpdm-pool-api/src/main/kotlin/org/eclipse/tractusx/bpdm/pool/api/model/QualityLevel.kt similarity index 95% rename from bpdm-common/src/main/kotlin/org/eclipse/tractusx/bpdm/common/dto/QualityLevel.kt rename to bpdm-pool-api/src/main/kotlin/org/eclipse/tractusx/bpdm/pool/api/model/QualityLevel.kt index 85ac30e21..ebf980dbe 100644 --- a/bpdm-common/src/main/kotlin/org/eclipse/tractusx/bpdm/common/dto/QualityLevel.kt +++ b/bpdm-pool-api/src/main/kotlin/org/eclipse/tractusx/bpdm/pool/api/model/QualityLevel.kt @@ -16,7 +16,7 @@ * * SPDX-License-Identifier: Apache-2.0 */ -package org.eclipse.tractusx.bpdm.common.dto +package org.eclipse.tractusx.bpdm.pool.api.model import io.swagger.v3.oas.annotations.media.Schema diff --git a/bpdm-pool-api/src/main/kotlin/org/eclipse/tractusx/bpdm/pool/api/model/RelationVerboseDto.kt b/bpdm-pool-api/src/main/kotlin/org/eclipse/tractusx/bpdm/pool/api/model/RelationVerboseDto.kt index 5c16d0302..05051c955 100644 --- a/bpdm-pool-api/src/main/kotlin/org/eclipse/tractusx/bpdm/pool/api/model/RelationVerboseDto.kt +++ b/bpdm-pool-api/src/main/kotlin/org/eclipse/tractusx/bpdm/pool/api/model/RelationVerboseDto.kt @@ -20,7 +20,7 @@ package org.eclipse.tractusx.bpdm.pool.api.model import io.swagger.v3.oas.annotations.media.Schema -import org.eclipse.tractusx.bpdm.common.dto.response.type.TypeKeyNameVerboseDto +import org.eclipse.tractusx.bpdm.common.dto.TypeKeyNameVerboseDto import org.eclipse.tractusx.bpdm.common.model.RelationType import java.time.LocalDateTime diff --git a/bpdm-pool-api/src/main/kotlin/org/eclipse/tractusx/bpdm/pool/api/model/SiteStateVerboseDto.kt b/bpdm-pool-api/src/main/kotlin/org/eclipse/tractusx/bpdm/pool/api/model/SiteStateVerboseDto.kt index 38b629d27..1c8be4c99 100644 --- a/bpdm-pool-api/src/main/kotlin/org/eclipse/tractusx/bpdm/pool/api/model/SiteStateVerboseDto.kt +++ b/bpdm-pool-api/src/main/kotlin/org/eclipse/tractusx/bpdm/pool/api/model/SiteStateVerboseDto.kt @@ -20,8 +20,8 @@ package org.eclipse.tractusx.bpdm.pool.api.model import io.swagger.v3.oas.annotations.media.Schema +import org.eclipse.tractusx.bpdm.common.dto.TypeKeyNameVerboseDto import org.eclipse.tractusx.bpdm.common.dto.openapidescription.SiteStateDescription -import org.eclipse.tractusx.bpdm.common.dto.response.type.TypeKeyNameVerboseDto import org.eclipse.tractusx.bpdm.common.model.BusinessStateType import java.time.LocalDateTime diff --git a/bpdm-pool-api/src/main/kotlin/org/eclipse/tractusx/bpdm/pool/api/model/request/IdentifiersSearchRequest.kt b/bpdm-pool-api/src/main/kotlin/org/eclipse/tractusx/bpdm/pool/api/model/request/IdentifiersSearchRequest.kt index c0ae08883..29b07ebda 100644 --- a/bpdm-pool-api/src/main/kotlin/org/eclipse/tractusx/bpdm/pool/api/model/request/IdentifiersSearchRequest.kt +++ b/bpdm-pool-api/src/main/kotlin/org/eclipse/tractusx/bpdm/pool/api/model/request/IdentifiersSearchRequest.kt @@ -20,7 +20,7 @@ package org.eclipse.tractusx.bpdm.pool.api.model.request import io.swagger.v3.oas.annotations.media.Schema -import org.eclipse.tractusx.bpdm.common.dto.IdentifierBusinessPartnerType +import org.eclipse.tractusx.bpdm.pool.api.model.IdentifierBusinessPartnerType @Schema(name = "IdentifiersSearchRequest", description = "Contains identifiers to search legal entities by") data class IdentifiersSearchRequest( diff --git a/bpdm-pool/src/main/kotlin/org/eclipse/tractusx/bpdm/pool/controller/AddressController.kt b/bpdm-pool/src/main/kotlin/org/eclipse/tractusx/bpdm/pool/controller/AddressController.kt index 708a98254..084d39065 100644 --- a/bpdm-pool/src/main/kotlin/org/eclipse/tractusx/bpdm/pool/controller/AddressController.kt +++ b/bpdm-pool/src/main/kotlin/org/eclipse/tractusx/bpdm/pool/controller/AddressController.kt @@ -19,8 +19,8 @@ package org.eclipse.tractusx.bpdm.pool.controller -import org.eclipse.tractusx.bpdm.common.dto.request.PaginationRequest -import org.eclipse.tractusx.bpdm.common.dto.response.PageDto +import org.eclipse.tractusx.bpdm.common.dto.PageDto +import org.eclipse.tractusx.bpdm.common.dto.PaginationRequest import org.eclipse.tractusx.bpdm.pool.api.PoolAddressApi import org.eclipse.tractusx.bpdm.pool.api.model.LogisticAddressVerboseDto import org.eclipse.tractusx.bpdm.pool.api.model.request.AddressPartnerBpnSearchRequest diff --git a/bpdm-pool/src/main/kotlin/org/eclipse/tractusx/bpdm/pool/controller/ChangelogController.kt b/bpdm-pool/src/main/kotlin/org/eclipse/tractusx/bpdm/pool/controller/ChangelogController.kt index 391c17ed4..e15535d7e 100644 --- a/bpdm-pool/src/main/kotlin/org/eclipse/tractusx/bpdm/pool/controller/ChangelogController.kt +++ b/bpdm-pool/src/main/kotlin/org/eclipse/tractusx/bpdm/pool/controller/ChangelogController.kt @@ -19,8 +19,8 @@ package org.eclipse.tractusx.bpdm.pool.controller -import org.eclipse.tractusx.bpdm.common.dto.request.PaginationRequest -import org.eclipse.tractusx.bpdm.common.dto.response.PageDto +import org.eclipse.tractusx.bpdm.common.dto.PageDto +import org.eclipse.tractusx.bpdm.common.dto.PaginationRequest import org.eclipse.tractusx.bpdm.pool.api.PoolChangelogApi import org.eclipse.tractusx.bpdm.pool.api.model.request.ChangelogSearchRequest import org.eclipse.tractusx.bpdm.pool.api.model.response.ChangelogEntryVerboseDto diff --git a/bpdm-pool/src/main/kotlin/org/eclipse/tractusx/bpdm/pool/controller/LegalEntityController.kt b/bpdm-pool/src/main/kotlin/org/eclipse/tractusx/bpdm/pool/controller/LegalEntityController.kt index 7887751c5..904846830 100644 --- a/bpdm-pool/src/main/kotlin/org/eclipse/tractusx/bpdm/pool/controller/LegalEntityController.kt +++ b/bpdm-pool/src/main/kotlin/org/eclipse/tractusx/bpdm/pool/controller/LegalEntityController.kt @@ -19,8 +19,8 @@ package org.eclipse.tractusx.bpdm.pool.controller -import org.eclipse.tractusx.bpdm.common.dto.request.PaginationRequest -import org.eclipse.tractusx.bpdm.common.dto.response.PageDto +import org.eclipse.tractusx.bpdm.common.dto.PageDto +import org.eclipse.tractusx.bpdm.common.dto.PaginationRequest import org.eclipse.tractusx.bpdm.pool.api.PoolLegalEntityApi import org.eclipse.tractusx.bpdm.pool.api.model.LogisticAddressVerboseDto import org.eclipse.tractusx.bpdm.pool.api.model.SiteVerboseDto diff --git a/bpdm-pool/src/main/kotlin/org/eclipse/tractusx/bpdm/pool/controller/MetadataController.kt b/bpdm-pool/src/main/kotlin/org/eclipse/tractusx/bpdm/pool/controller/MetadataController.kt index bccde6cb1..f00715025 100644 --- a/bpdm-pool/src/main/kotlin/org/eclipse/tractusx/bpdm/pool/controller/MetadataController.kt +++ b/bpdm-pool/src/main/kotlin/org/eclipse/tractusx/bpdm/pool/controller/MetadataController.kt @@ -20,15 +20,10 @@ package org.eclipse.tractusx.bpdm.pool.controller import com.neovisionaries.i18n.CountryCode -import org.eclipse.tractusx.bpdm.common.dto.FieldQualityRuleDto -import org.eclipse.tractusx.bpdm.common.dto.IdentifierBusinessPartnerType -import org.eclipse.tractusx.bpdm.common.dto.IdentifierTypeDto -import org.eclipse.tractusx.bpdm.common.dto.request.PaginationRequest -import org.eclipse.tractusx.bpdm.common.dto.response.PageDto +import org.eclipse.tractusx.bpdm.common.dto.PageDto +import org.eclipse.tractusx.bpdm.common.dto.PaginationRequest import org.eclipse.tractusx.bpdm.pool.api.PoolMetadataApi -import org.eclipse.tractusx.bpdm.pool.api.model.CountrySubdivisionDto -import org.eclipse.tractusx.bpdm.pool.api.model.LegalFormDto -import org.eclipse.tractusx.bpdm.pool.api.model.RegionDto +import org.eclipse.tractusx.bpdm.pool.api.model.* import org.eclipse.tractusx.bpdm.pool.api.model.request.LegalFormRequest import org.eclipse.tractusx.bpdm.pool.service.MetadataService import org.springframework.data.domain.PageRequest diff --git a/bpdm-pool/src/main/kotlin/org/eclipse/tractusx/bpdm/pool/controller/SiteController.kt b/bpdm-pool/src/main/kotlin/org/eclipse/tractusx/bpdm/pool/controller/SiteController.kt index 0b96d84af..72abf772d 100644 --- a/bpdm-pool/src/main/kotlin/org/eclipse/tractusx/bpdm/pool/controller/SiteController.kt +++ b/bpdm-pool/src/main/kotlin/org/eclipse/tractusx/bpdm/pool/controller/SiteController.kt @@ -19,8 +19,8 @@ package org.eclipse.tractusx.bpdm.pool.controller -import org.eclipse.tractusx.bpdm.common.dto.request.PaginationRequest -import org.eclipse.tractusx.bpdm.common.dto.response.PageDto +import org.eclipse.tractusx.bpdm.common.dto.PageDto +import org.eclipse.tractusx.bpdm.common.dto.PaginationRequest import org.eclipse.tractusx.bpdm.pool.api.PoolSiteApi import org.eclipse.tractusx.bpdm.pool.api.model.request.* import org.eclipse.tractusx.bpdm.pool.api.model.response.* diff --git a/bpdm-pool/src/main/kotlin/org/eclipse/tractusx/bpdm/pool/entity/FieldQualityRule.kt b/bpdm-pool/src/main/kotlin/org/eclipse/tractusx/bpdm/pool/entity/FieldQualityRule.kt index d683882b9..7c9fdf496 100644 --- a/bpdm-pool/src/main/kotlin/org/eclipse/tractusx/bpdm/pool/entity/FieldQualityRule.kt +++ b/bpdm-pool/src/main/kotlin/org/eclipse/tractusx/bpdm/pool/entity/FieldQualityRule.kt @@ -21,8 +21,8 @@ package org.eclipse.tractusx.bpdm.pool.entity import com.neovisionaries.i18n.CountryCode import jakarta.persistence.* -import org.eclipse.tractusx.bpdm.common.dto.QualityLevel import org.eclipse.tractusx.bpdm.common.model.BaseEntity +import org.eclipse.tractusx.bpdm.pool.api.model.QualityLevel @Entity @Table( diff --git a/bpdm-pool/src/main/kotlin/org/eclipse/tractusx/bpdm/pool/entity/IdentifierType.kt b/bpdm-pool/src/main/kotlin/org/eclipse/tractusx/bpdm/pool/entity/IdentifierType.kt index 6317ac6ed..3d5fb1721 100644 --- a/bpdm-pool/src/main/kotlin/org/eclipse/tractusx/bpdm/pool/entity/IdentifierType.kt +++ b/bpdm-pool/src/main/kotlin/org/eclipse/tractusx/bpdm/pool/entity/IdentifierType.kt @@ -20,8 +20,8 @@ package org.eclipse.tractusx.bpdm.pool.entity import jakarta.persistence.* -import org.eclipse.tractusx.bpdm.common.dto.IdentifierBusinessPartnerType import org.eclipse.tractusx.bpdm.common.model.BaseEntity +import org.eclipse.tractusx.bpdm.pool.api.model.IdentifierBusinessPartnerType @Entity @Table( diff --git a/bpdm-pool/src/main/kotlin/org/eclipse/tractusx/bpdm/pool/repository/IdentifierTypeRepository.kt b/bpdm-pool/src/main/kotlin/org/eclipse/tractusx/bpdm/pool/repository/IdentifierTypeRepository.kt index a8b5bcfdd..74d090cbf 100644 --- a/bpdm-pool/src/main/kotlin/org/eclipse/tractusx/bpdm/pool/repository/IdentifierTypeRepository.kt +++ b/bpdm-pool/src/main/kotlin/org/eclipse/tractusx/bpdm/pool/repository/IdentifierTypeRepository.kt @@ -20,7 +20,7 @@ package org.eclipse.tractusx.bpdm.pool.repository import com.neovisionaries.i18n.CountryCode -import org.eclipse.tractusx.bpdm.common.dto.IdentifierBusinessPartnerType +import org.eclipse.tractusx.bpdm.pool.api.model.IdentifierBusinessPartnerType import org.eclipse.tractusx.bpdm.pool.entity.IdentifierType import org.eclipse.tractusx.bpdm.pool.entity.IdentifierTypeDetail import org.springframework.data.jpa.domain.Specification diff --git a/bpdm-pool/src/main/kotlin/org/eclipse/tractusx/bpdm/pool/service/AddressService.kt b/bpdm-pool/src/main/kotlin/org/eclipse/tractusx/bpdm/pool/service/AddressService.kt index f7cef8e52..2aa097db8 100644 --- a/bpdm-pool/src/main/kotlin/org/eclipse/tractusx/bpdm/pool/service/AddressService.kt +++ b/bpdm-pool/src/main/kotlin/org/eclipse/tractusx/bpdm/pool/service/AddressService.kt @@ -21,8 +21,8 @@ package org.eclipse.tractusx.bpdm.pool.service import jakarta.transaction.Transactional import mu.KotlinLogging -import org.eclipse.tractusx.bpdm.common.dto.request.PaginationRequest -import org.eclipse.tractusx.bpdm.common.dto.response.PageDto +import org.eclipse.tractusx.bpdm.common.dto.PageDto +import org.eclipse.tractusx.bpdm.common.dto.PaginationRequest import org.eclipse.tractusx.bpdm.common.exception.BpdmNotFoundException import org.eclipse.tractusx.bpdm.pool.api.model.LogisticAddressVerboseDto import org.eclipse.tractusx.bpdm.pool.api.model.request.AddressPartnerBpnSearchRequest diff --git a/bpdm-pool/src/main/kotlin/org/eclipse/tractusx/bpdm/pool/service/BusinessPartnerFetchService.kt b/bpdm-pool/src/main/kotlin/org/eclipse/tractusx/bpdm/pool/service/BusinessPartnerFetchService.kt index 0a382d707..5be7eb1d8 100644 --- a/bpdm-pool/src/main/kotlin/org/eclipse/tractusx/bpdm/pool/service/BusinessPartnerFetchService.kt +++ b/bpdm-pool/src/main/kotlin/org/eclipse/tractusx/bpdm/pool/service/BusinessPartnerFetchService.kt @@ -20,8 +20,8 @@ package org.eclipse.tractusx.bpdm.pool.service import mu.KotlinLogging -import org.eclipse.tractusx.bpdm.common.dto.IdentifierBusinessPartnerType import org.eclipse.tractusx.bpdm.common.exception.BpdmNotFoundException +import org.eclipse.tractusx.bpdm.pool.api.model.IdentifierBusinessPartnerType import org.eclipse.tractusx.bpdm.pool.api.model.response.BpnIdentifierMappingDto import org.eclipse.tractusx.bpdm.pool.api.model.response.LegalEntityWithLegalAddressVerboseDto import org.eclipse.tractusx.bpdm.pool.entity.IdentifierType diff --git a/bpdm-pool/src/main/kotlin/org/eclipse/tractusx/bpdm/pool/service/BusinessPartnerSearchService.kt b/bpdm-pool/src/main/kotlin/org/eclipse/tractusx/bpdm/pool/service/BusinessPartnerSearchService.kt index d0b485f60..fed4b9b68 100644 --- a/bpdm-pool/src/main/kotlin/org/eclipse/tractusx/bpdm/pool/service/BusinessPartnerSearchService.kt +++ b/bpdm-pool/src/main/kotlin/org/eclipse/tractusx/bpdm/pool/service/BusinessPartnerSearchService.kt @@ -20,8 +20,8 @@ package org.eclipse.tractusx.bpdm.pool.service import mu.KotlinLogging -import org.eclipse.tractusx.bpdm.common.dto.request.PaginationRequest -import org.eclipse.tractusx.bpdm.common.dto.response.PageDto +import org.eclipse.tractusx.bpdm.common.dto.PageDto +import org.eclipse.tractusx.bpdm.common.dto.PaginationRequest import org.eclipse.tractusx.bpdm.pool.api.model.request.AddressPartnerSearchRequest import org.eclipse.tractusx.bpdm.pool.api.model.request.BusinessPartnerSearchRequest import org.eclipse.tractusx.bpdm.pool.api.model.response.AddressMatchVerboseDto diff --git a/bpdm-pool/src/main/kotlin/org/eclipse/tractusx/bpdm/pool/service/MetadataService.kt b/bpdm-pool/src/main/kotlin/org/eclipse/tractusx/bpdm/pool/service/MetadataService.kt index 84d7cff93..bd979c2c8 100644 --- a/bpdm-pool/src/main/kotlin/org/eclipse/tractusx/bpdm/pool/service/MetadataService.kt +++ b/bpdm-pool/src/main/kotlin/org/eclipse/tractusx/bpdm/pool/service/MetadataService.kt @@ -21,13 +21,12 @@ package org.eclipse.tractusx.bpdm.pool.service import com.neovisionaries.i18n.CountryCode import mu.KotlinLogging -import org.eclipse.tractusx.bpdm.common.dto.* -import org.eclipse.tractusx.bpdm.common.dto.request.PaginationRequest -import org.eclipse.tractusx.bpdm.common.dto.response.PageDto +import org.eclipse.tractusx.bpdm.common.dto.IBaseLegalEntityDto +import org.eclipse.tractusx.bpdm.common.dto.IBaseLogisticAddressDto +import org.eclipse.tractusx.bpdm.common.dto.PageDto +import org.eclipse.tractusx.bpdm.common.dto.PaginationRequest import org.eclipse.tractusx.bpdm.common.service.toPageRequest -import org.eclipse.tractusx.bpdm.pool.api.model.CountrySubdivisionDto -import org.eclipse.tractusx.bpdm.pool.api.model.LegalFormDto -import org.eclipse.tractusx.bpdm.pool.api.model.RegionDto +import org.eclipse.tractusx.bpdm.pool.api.model.* import org.eclipse.tractusx.bpdm.pool.api.model.request.LegalFormRequest import org.eclipse.tractusx.bpdm.pool.dto.AddressMetadataDto import org.eclipse.tractusx.bpdm.pool.dto.LegalEntityMetadataDto diff --git a/bpdm-pool/src/main/kotlin/org/eclipse/tractusx/bpdm/pool/service/PartnerChangelogService.kt b/bpdm-pool/src/main/kotlin/org/eclipse/tractusx/bpdm/pool/service/PartnerChangelogService.kt index 99da4a6b1..b7ff3aa5e 100644 --- a/bpdm-pool/src/main/kotlin/org/eclipse/tractusx/bpdm/pool/service/PartnerChangelogService.kt +++ b/bpdm-pool/src/main/kotlin/org/eclipse/tractusx/bpdm/pool/service/PartnerChangelogService.kt @@ -21,7 +21,8 @@ package org.eclipse.tractusx.bpdm.pool.service import mu.KotlinLogging import org.eclipse.tractusx.bpdm.common.dto.BusinessPartnerType -import org.eclipse.tractusx.bpdm.common.dto.response.PageDto +import org.eclipse.tractusx.bpdm.common.dto.PageDto +import org.eclipse.tractusx.bpdm.pool.api.model.response.ChangelogEntryVerboseDto import org.eclipse.tractusx.bpdm.pool.dto.ChangelogEntryCreateRequest import org.eclipse.tractusx.bpdm.pool.entity.PartnerChangelogEntry import org.eclipse.tractusx.bpdm.pool.repository.PartnerChangelogEntryRepository @@ -74,7 +75,7 @@ class PartnerChangelogService( fromTime: Instant?, pageIndex: Int, pageSize: Int - ): PageDto { + ): PageDto { val spec = Specification.allOf(byBpnsIn(bpns), byBusinessPartnerTypesIn(businessPartnerTypes), byUpdatedGreaterThan(fromTime)) val pageRequest = PageRequest.of(pageIndex, pageSize, Sort.by(PartnerChangelogEntry::updatedAt.name).ascending()) val page = partnerChangelogEntryRepository.findAll(spec, pageRequest) diff --git a/bpdm-pool/src/main/kotlin/org/eclipse/tractusx/bpdm/pool/service/ResponseMappings.kt b/bpdm-pool/src/main/kotlin/org/eclipse/tractusx/bpdm/pool/service/ResponseMappings.kt index f28093e5c..5e0a82a0c 100644 --- a/bpdm-pool/src/main/kotlin/org/eclipse/tractusx/bpdm/pool/service/ResponseMappings.kt +++ b/bpdm-pool/src/main/kotlin/org/eclipse/tractusx/bpdm/pool/service/ResponseMappings.kt @@ -20,10 +20,8 @@ package org.eclipse.tractusx.bpdm.pool.service import org.eclipse.tractusx.bpdm.common.dto.GeoCoordinateDto -import org.eclipse.tractusx.bpdm.common.dto.IdentifierTypeDetailDto -import org.eclipse.tractusx.bpdm.common.dto.IdentifierTypeDto -import org.eclipse.tractusx.bpdm.common.dto.response.PageDto -import org.eclipse.tractusx.bpdm.common.dto.response.type.TypeKeyNameVerboseDto +import org.eclipse.tractusx.bpdm.common.dto.PageDto +import org.eclipse.tractusx.bpdm.common.dto.TypeKeyNameVerboseDto import org.eclipse.tractusx.bpdm.common.service.toDto import org.eclipse.tractusx.bpdm.pool.api.model.* import org.eclipse.tractusx.bpdm.pool.api.model.response.* diff --git a/bpdm-pool/src/main/kotlin/org/eclipse/tractusx/bpdm/pool/service/SearchService.kt b/bpdm-pool/src/main/kotlin/org/eclipse/tractusx/bpdm/pool/service/SearchService.kt index 5ae8e9246..f7d46b320 100644 --- a/bpdm-pool/src/main/kotlin/org/eclipse/tractusx/bpdm/pool/service/SearchService.kt +++ b/bpdm-pool/src/main/kotlin/org/eclipse/tractusx/bpdm/pool/service/SearchService.kt @@ -19,8 +19,8 @@ package org.eclipse.tractusx.bpdm.pool.service -import org.eclipse.tractusx.bpdm.common.dto.request.PaginationRequest -import org.eclipse.tractusx.bpdm.common.dto.response.PageDto +import org.eclipse.tractusx.bpdm.common.dto.PageDto +import org.eclipse.tractusx.bpdm.common.dto.PaginationRequest import org.eclipse.tractusx.bpdm.pool.api.model.request.AddressPartnerSearchRequest import org.eclipse.tractusx.bpdm.pool.api.model.request.BusinessPartnerSearchRequest import org.eclipse.tractusx.bpdm.pool.api.model.response.AddressMatchVerboseDto diff --git a/bpdm-pool/src/main/kotlin/org/eclipse/tractusx/bpdm/pool/service/SiteService.kt b/bpdm-pool/src/main/kotlin/org/eclipse/tractusx/bpdm/pool/service/SiteService.kt index 1cd0c3835..a298f40f6 100644 --- a/bpdm-pool/src/main/kotlin/org/eclipse/tractusx/bpdm/pool/service/SiteService.kt +++ b/bpdm-pool/src/main/kotlin/org/eclipse/tractusx/bpdm/pool/service/SiteService.kt @@ -20,8 +20,8 @@ package org.eclipse.tractusx.bpdm.pool.service import mu.KotlinLogging -import org.eclipse.tractusx.bpdm.common.dto.request.PaginationRequest -import org.eclipse.tractusx.bpdm.common.dto.response.PageDto +import org.eclipse.tractusx.bpdm.common.dto.PageDto +import org.eclipse.tractusx.bpdm.common.dto.PaginationRequest import org.eclipse.tractusx.bpdm.common.exception.BpdmNotFoundException import org.eclipse.tractusx.bpdm.pool.api.model.SiteVerboseDto import org.eclipse.tractusx.bpdm.pool.api.model.request.SiteBpnSearchRequest diff --git a/bpdm-pool/src/test/kotlin/org/eclipse/tractusx/bpdm/pool/controller/AddressControllerIT.kt b/bpdm-pool/src/test/kotlin/org/eclipse/tractusx/bpdm/pool/controller/AddressControllerIT.kt index 1816876c2..50170ba98 100644 --- a/bpdm-pool/src/test/kotlin/org/eclipse/tractusx/bpdm/pool/controller/AddressControllerIT.kt +++ b/bpdm-pool/src/test/kotlin/org/eclipse/tractusx/bpdm/pool/controller/AddressControllerIT.kt @@ -20,11 +20,11 @@ package org.eclipse.tractusx.bpdm.pool.controller import org.assertj.core.api.Assertions.assertThat -import org.eclipse.tractusx.bpdm.common.dto.IdentifierBusinessPartnerType -import org.eclipse.tractusx.bpdm.common.dto.IdentifierTypeDto -import org.eclipse.tractusx.bpdm.common.dto.request.PaginationRequest +import org.eclipse.tractusx.bpdm.common.dto.PaginationRequest import org.eclipse.tractusx.bpdm.pool.Application import org.eclipse.tractusx.bpdm.pool.api.client.PoolApiClient +import org.eclipse.tractusx.bpdm.pool.api.model.IdentifierBusinessPartnerType +import org.eclipse.tractusx.bpdm.pool.api.model.IdentifierTypeDto import org.eclipse.tractusx.bpdm.pool.api.model.LogisticAddressVerboseDto import org.eclipse.tractusx.bpdm.pool.api.model.request.AddressPartnerBpnSearchRequest import org.eclipse.tractusx.bpdm.pool.api.model.response.* diff --git a/bpdm-pool/src/test/kotlin/org/eclipse/tractusx/bpdm/pool/controller/AddressControllerSearchIT.kt b/bpdm-pool/src/test/kotlin/org/eclipse/tractusx/bpdm/pool/controller/AddressControllerSearchIT.kt index 98f0707a9..bf1818d78 100644 --- a/bpdm-pool/src/test/kotlin/org/eclipse/tractusx/bpdm/pool/controller/AddressControllerSearchIT.kt +++ b/bpdm-pool/src/test/kotlin/org/eclipse/tractusx/bpdm/pool/controller/AddressControllerSearchIT.kt @@ -19,8 +19,8 @@ package org.eclipse.tractusx.bpdm.pool.controller -import org.eclipse.tractusx.bpdm.common.dto.request.PaginationRequest -import org.eclipse.tractusx.bpdm.common.dto.response.PageDto +import org.eclipse.tractusx.bpdm.common.dto.PageDto +import org.eclipse.tractusx.bpdm.common.dto.PaginationRequest import org.eclipse.tractusx.bpdm.pool.Application import org.eclipse.tractusx.bpdm.pool.api.client.PoolClientImpl import org.eclipse.tractusx.bpdm.pool.api.model.LogisticAddressVerboseDto diff --git a/bpdm-pool/src/test/kotlin/org/eclipse/tractusx/bpdm/pool/controller/BpnControllerIT.kt b/bpdm-pool/src/test/kotlin/org/eclipse/tractusx/bpdm/pool/controller/BpnControllerIT.kt index 7dcbe1f18..63c1b94ab 100644 --- a/bpdm-pool/src/test/kotlin/org/eclipse/tractusx/bpdm/pool/controller/BpnControllerIT.kt +++ b/bpdm-pool/src/test/kotlin/org/eclipse/tractusx/bpdm/pool/controller/BpnControllerIT.kt @@ -20,9 +20,9 @@ package org.eclipse.tractusx.bpdm.pool.controller import org.assertj.core.api.Assertions.assertThat -import org.eclipse.tractusx.bpdm.common.dto.IdentifierBusinessPartnerType import org.eclipse.tractusx.bpdm.pool.Application import org.eclipse.tractusx.bpdm.pool.api.client.PoolClientImpl +import org.eclipse.tractusx.bpdm.pool.api.model.IdentifierBusinessPartnerType import org.eclipse.tractusx.bpdm.pool.api.model.LegalEntityIdentifierDto import org.eclipse.tractusx.bpdm.pool.api.model.request.IdentifiersSearchRequest import org.eclipse.tractusx.bpdm.pool.util.BusinessPartnerNonVerboseValues diff --git a/bpdm-pool/src/test/kotlin/org/eclipse/tractusx/bpdm/pool/controller/ChangelogControllerIT.kt b/bpdm-pool/src/test/kotlin/org/eclipse/tractusx/bpdm/pool/controller/ChangelogControllerIT.kt index 935d53d63..c1839a034 100644 --- a/bpdm-pool/src/test/kotlin/org/eclipse/tractusx/bpdm/pool/controller/ChangelogControllerIT.kt +++ b/bpdm-pool/src/test/kotlin/org/eclipse/tractusx/bpdm/pool/controller/ChangelogControllerIT.kt @@ -21,8 +21,8 @@ package org.eclipse.tractusx.bpdm.pool.controller import org.assertj.core.api.Assertions import org.eclipse.tractusx.bpdm.common.dto.BusinessPartnerType -import org.eclipse.tractusx.bpdm.common.dto.request.PaginationRequest -import org.eclipse.tractusx.bpdm.common.dto.response.PageDto +import org.eclipse.tractusx.bpdm.common.dto.PageDto +import org.eclipse.tractusx.bpdm.common.dto.PaginationRequest import org.eclipse.tractusx.bpdm.pool.Application import org.eclipse.tractusx.bpdm.pool.api.client.PoolClientImpl import org.eclipse.tractusx.bpdm.pool.api.model.ChangelogType diff --git a/bpdm-pool/src/test/kotlin/org/eclipse/tractusx/bpdm/pool/controller/LegalEntityControllerIT.kt b/bpdm-pool/src/test/kotlin/org/eclipse/tractusx/bpdm/pool/controller/LegalEntityControllerIT.kt index d4f8b51ce..3673046f5 100644 --- a/bpdm-pool/src/test/kotlin/org/eclipse/tractusx/bpdm/pool/controller/LegalEntityControllerIT.kt +++ b/bpdm-pool/src/test/kotlin/org/eclipse/tractusx/bpdm/pool/controller/LegalEntityControllerIT.kt @@ -20,10 +20,10 @@ package org.eclipse.tractusx.bpdm.pool.controller import org.assertj.core.api.Assertions.assertThat -import org.eclipse.tractusx.bpdm.common.dto.IdentifierBusinessPartnerType -import org.eclipse.tractusx.bpdm.common.dto.IdentifierTypeDto import org.eclipse.tractusx.bpdm.pool.Application import org.eclipse.tractusx.bpdm.pool.api.client.PoolClientImpl +import org.eclipse.tractusx.bpdm.pool.api.model.IdentifierBusinessPartnerType +import org.eclipse.tractusx.bpdm.pool.api.model.IdentifierTypeDto import org.eclipse.tractusx.bpdm.pool.api.model.LegalEntityVerboseDto import org.eclipse.tractusx.bpdm.pool.api.model.LogisticAddressVerboseDto import org.eclipse.tractusx.bpdm.pool.api.model.response.* diff --git a/bpdm-pool/src/test/kotlin/org/eclipse/tractusx/bpdm/pool/controller/LegalEntityControllerSearchIT.kt b/bpdm-pool/src/test/kotlin/org/eclipse/tractusx/bpdm/pool/controller/LegalEntityControllerSearchIT.kt index a952b160b..a7bde5d71 100644 --- a/bpdm-pool/src/test/kotlin/org/eclipse/tractusx/bpdm/pool/controller/LegalEntityControllerSearchIT.kt +++ b/bpdm-pool/src/test/kotlin/org/eclipse/tractusx/bpdm/pool/controller/LegalEntityControllerSearchIT.kt @@ -19,8 +19,8 @@ package org.eclipse.tractusx.bpdm.pool.controller -import org.eclipse.tractusx.bpdm.common.dto.request.PaginationRequest -import org.eclipse.tractusx.bpdm.common.dto.response.PageDto +import org.eclipse.tractusx.bpdm.common.dto.PageDto +import org.eclipse.tractusx.bpdm.common.dto.PaginationRequest import org.eclipse.tractusx.bpdm.pool.Application import org.eclipse.tractusx.bpdm.pool.api.client.PoolClientImpl import org.eclipse.tractusx.bpdm.pool.api.model.LegalEntityVerboseDto diff --git a/bpdm-pool/src/test/kotlin/org/eclipse/tractusx/bpdm/pool/controller/MetadataControllerIT.kt b/bpdm-pool/src/test/kotlin/org/eclipse/tractusx/bpdm/pool/controller/MetadataControllerIT.kt index ab1d5b22c..c4b89d37c 100644 --- a/bpdm-pool/src/test/kotlin/org/eclipse/tractusx/bpdm/pool/controller/MetadataControllerIT.kt +++ b/bpdm-pool/src/test/kotlin/org/eclipse/tractusx/bpdm/pool/controller/MetadataControllerIT.kt @@ -22,14 +22,14 @@ package org.eclipse.tractusx.bpdm.pool.controller import com.neovisionaries.i18n.CountryCode import com.neovisionaries.i18n.CountryCode.* import org.assertj.core.api.Assertions.assertThat -import org.eclipse.tractusx.bpdm.common.dto.IdentifierBusinessPartnerType -import org.eclipse.tractusx.bpdm.common.dto.IdentifierTypeDto -import org.eclipse.tractusx.bpdm.common.dto.QualityLevel -import org.eclipse.tractusx.bpdm.common.dto.request.PaginationRequest -import org.eclipse.tractusx.bpdm.common.dto.response.PageDto +import org.eclipse.tractusx.bpdm.common.dto.PageDto +import org.eclipse.tractusx.bpdm.common.dto.PaginationRequest import org.eclipse.tractusx.bpdm.pool.Application import org.eclipse.tractusx.bpdm.pool.api.client.PoolClientImpl +import org.eclipse.tractusx.bpdm.pool.api.model.IdentifierBusinessPartnerType +import org.eclipse.tractusx.bpdm.pool.api.model.IdentifierTypeDto import org.eclipse.tractusx.bpdm.pool.api.model.LegalFormDto +import org.eclipse.tractusx.bpdm.pool.api.model.QualityLevel import org.eclipse.tractusx.bpdm.pool.api.model.request.LegalFormRequest import org.eclipse.tractusx.bpdm.pool.entity.FieldQualityRule import org.eclipse.tractusx.bpdm.pool.entity.IdentifierType diff --git a/bpdm-pool/src/test/kotlin/org/eclipse/tractusx/bpdm/pool/controller/SiteControllerIT.kt b/bpdm-pool/src/test/kotlin/org/eclipse/tractusx/bpdm/pool/controller/SiteControllerIT.kt index 5da1b0c77..a51c7d030 100644 --- a/bpdm-pool/src/test/kotlin/org/eclipse/tractusx/bpdm/pool/controller/SiteControllerIT.kt +++ b/bpdm-pool/src/test/kotlin/org/eclipse/tractusx/bpdm/pool/controller/SiteControllerIT.kt @@ -20,15 +20,11 @@ package org.eclipse.tractusx.bpdm.pool.controller import org.assertj.core.api.Assertions.assertThat -import org.eclipse.tractusx.bpdm.common.dto.IdentifierBusinessPartnerType -import org.eclipse.tractusx.bpdm.common.dto.IdentifierTypeDto -import org.eclipse.tractusx.bpdm.common.dto.request.PaginationRequest -import org.eclipse.tractusx.bpdm.common.dto.response.PageDto +import org.eclipse.tractusx.bpdm.common.dto.PageDto +import org.eclipse.tractusx.bpdm.common.dto.PaginationRequest import org.eclipse.tractusx.bpdm.pool.Application import org.eclipse.tractusx.bpdm.pool.api.client.PoolClientImpl -import org.eclipse.tractusx.bpdm.pool.api.model.LogisticAddressVerboseDto -import org.eclipse.tractusx.bpdm.pool.api.model.SiteDto -import org.eclipse.tractusx.bpdm.pool.api.model.SiteVerboseDto +import org.eclipse.tractusx.bpdm.pool.api.model.* import org.eclipse.tractusx.bpdm.pool.api.model.request.SiteBpnSearchRequest import org.eclipse.tractusx.bpdm.pool.api.model.response.* import org.eclipse.tractusx.bpdm.pool.util.* diff --git a/bpdm-pool/src/test/kotlin/org/eclipse/tractusx/bpdm/pool/service/TaskStepFetchAndReserveServiceTest.kt b/bpdm-pool/src/test/kotlin/org/eclipse/tractusx/bpdm/pool/service/TaskStepFetchAndReserveServiceTest.kt index 3ee390d20..ff43c0970 100644 --- a/bpdm-pool/src/test/kotlin/org/eclipse/tractusx/bpdm/pool/service/TaskStepFetchAndReserveServiceTest.kt +++ b/bpdm-pool/src/test/kotlin/org/eclipse/tractusx/bpdm/pool/service/TaskStepFetchAndReserveServiceTest.kt @@ -5,8 +5,7 @@ import org.assertj.core.api.Assertions.assertThat import org.eclipse.tractusx.bpdm.common.dto.GeoCoordinateDto import org.eclipse.tractusx.bpdm.common.dto.ILegalEntityStateDto import org.eclipse.tractusx.bpdm.common.dto.ISiteStateDto -import org.eclipse.tractusx.bpdm.common.dto.response.* -import org.eclipse.tractusx.bpdm.common.dto.response.type.TypeKeyNameVerboseDto +import org.eclipse.tractusx.bpdm.common.dto.TypeKeyNameVerboseDto import org.eclipse.tractusx.bpdm.common.model.BusinessStateType import org.eclipse.tractusx.bpdm.common.model.ClassificationType import org.eclipse.tractusx.bpdm.common.model.DeliveryServiceType diff --git a/bpdm-pool/src/test/kotlin/org/eclipse/tractusx/bpdm/pool/util/BusinessPartnerNonVerboseValues.kt b/bpdm-pool/src/test/kotlin/org/eclipse/tractusx/bpdm/pool/util/BusinessPartnerNonVerboseValues.kt index 81c700cb1..7bceabd3b 100644 --- a/bpdm-pool/src/test/kotlin/org/eclipse/tractusx/bpdm/pool/util/BusinessPartnerNonVerboseValues.kt +++ b/bpdm-pool/src/test/kotlin/org/eclipse/tractusx/bpdm/pool/util/BusinessPartnerNonVerboseValues.kt @@ -19,7 +19,6 @@ package org.eclipse.tractusx.bpdm.pool.util -import org.eclipse.tractusx.bpdm.common.dto.* import org.eclipse.tractusx.bpdm.pool.api.model.* import org.eclipse.tractusx.bpdm.pool.api.model.request.* diff --git a/bpdm-pool/src/test/kotlin/org/eclipse/tractusx/bpdm/pool/util/BusinessPartnerVerboseValues.kt b/bpdm-pool/src/test/kotlin/org/eclipse/tractusx/bpdm/pool/util/BusinessPartnerVerboseValues.kt index 151881b39..e03cf0131 100644 --- a/bpdm-pool/src/test/kotlin/org/eclipse/tractusx/bpdm/pool/util/BusinessPartnerVerboseValues.kt +++ b/bpdm-pool/src/test/kotlin/org/eclipse/tractusx/bpdm/pool/util/BusinessPartnerVerboseValues.kt @@ -21,7 +21,7 @@ package org.eclipse.tractusx.bpdm.pool.util import com.neovisionaries.i18n.CountryCode import com.neovisionaries.i18n.LanguageCode -import org.eclipse.tractusx.bpdm.common.dto.response.type.TypeKeyNameVerboseDto +import org.eclipse.tractusx.bpdm.common.dto.TypeKeyNameVerboseDto import org.eclipse.tractusx.bpdm.common.model.BusinessStateType import org.eclipse.tractusx.bpdm.common.model.ClassificationType import org.eclipse.tractusx.bpdm.common.service.toDto