diff --git a/bpdm-gate-api/src/main/kotlin/org/eclipse/tractusx/bpdm/gate/api/model/AddressType.kt b/bpdm-common/src/main/kotlin/org/eclipse/tractusx/bpdm/common/dto/AddressType.kt similarity index 95% rename from bpdm-gate-api/src/main/kotlin/org/eclipse/tractusx/bpdm/gate/api/model/AddressType.kt rename to bpdm-common/src/main/kotlin/org/eclipse/tractusx/bpdm/common/dto/AddressType.kt index 1299b5310..aa507d0d7 100644 --- a/bpdm-gate-api/src/main/kotlin/org/eclipse/tractusx/bpdm/gate/api/model/AddressType.kt +++ b/bpdm-common/src/main/kotlin/org/eclipse/tractusx/bpdm/common/dto/AddressType.kt @@ -17,7 +17,7 @@ * SPDX-License-Identifier: Apache-2.0 ******************************************************************************/ -package org.eclipse.tractusx.bpdm.gate.api.model +package org.eclipse.tractusx.bpdm.common.dto enum class AddressType { diff --git a/bpdm-common/src/main/kotlin/org/eclipse/tractusx/bpdm/common/dto/AlternativePostalAddressDto.kt b/bpdm-common/src/main/kotlin/org/eclipse/tractusx/bpdm/common/dto/AlternativePostalAddressDto.kt index cb9872e8b..a436bc210 100644 --- a/bpdm-common/src/main/kotlin/org/eclipse/tractusx/bpdm/common/dto/AlternativePostalAddressDto.kt +++ b/bpdm-common/src/main/kotlin/org/eclipse/tractusx/bpdm/common/dto/AlternativePostalAddressDto.kt @@ -35,11 +35,9 @@ data class AlternativePostalAddressDto( override val geographicCoordinates: GeoCoordinateDto?, - @get:Schema(description = PostalAddressDescription.country) - val country: CountryCode, + override val country: CountryCode, - @get:Schema(description = PostalAddressDescription.administrativeAreaLevel1) - val administrativeAreaLevel1: String?, + override val administrativeAreaLevel1: String?, override val postalCode: String?, diff --git a/bpdm-gate-api/src/main/kotlin/org/eclipse/tractusx/bpdm/gate/api/model/BusinessPartnerIdentifierDto.kt b/bpdm-common/src/main/kotlin/org/eclipse/tractusx/bpdm/common/dto/BusinessPartnerIdentifierDto.kt similarity index 96% rename from bpdm-gate-api/src/main/kotlin/org/eclipse/tractusx/bpdm/gate/api/model/BusinessPartnerIdentifierDto.kt rename to bpdm-common/src/main/kotlin/org/eclipse/tractusx/bpdm/common/dto/BusinessPartnerIdentifierDto.kt index 440f66e29..6b700c5f7 100644 --- a/bpdm-gate-api/src/main/kotlin/org/eclipse/tractusx/bpdm/gate/api/model/BusinessPartnerIdentifierDto.kt +++ b/bpdm-common/src/main/kotlin/org/eclipse/tractusx/bpdm/common/dto/BusinessPartnerIdentifierDto.kt @@ -17,7 +17,7 @@ * SPDX-License-Identifier: Apache-2.0 ******************************************************************************/ -package org.eclipse.tractusx.bpdm.gate.api.model +package org.eclipse.tractusx.bpdm.common.dto import io.swagger.v3.oas.annotations.media.Schema diff --git a/bpdm-gate-api/src/main/kotlin/org/eclipse/tractusx/bpdm/gate/api/model/BusinessPartnerRole.kt b/bpdm-common/src/main/kotlin/org/eclipse/tractusx/bpdm/common/dto/BusinessPartnerRole.kt similarity index 95% rename from bpdm-gate-api/src/main/kotlin/org/eclipse/tractusx/bpdm/gate/api/model/BusinessPartnerRole.kt rename to bpdm-common/src/main/kotlin/org/eclipse/tractusx/bpdm/common/dto/BusinessPartnerRole.kt index 8a6261939..8dd6a28b2 100644 --- a/bpdm-gate-api/src/main/kotlin/org/eclipse/tractusx/bpdm/gate/api/model/BusinessPartnerRole.kt +++ b/bpdm-common/src/main/kotlin/org/eclipse/tractusx/bpdm/common/dto/BusinessPartnerRole.kt @@ -17,7 +17,7 @@ * SPDX-License-Identifier: Apache-2.0 ******************************************************************************/ -package org.eclipse.tractusx.bpdm.gate.api.model +package org.eclipse.tractusx.bpdm.common.dto enum class BusinessPartnerRole { SUPPLIER, diff --git a/bpdm-gate-api/src/main/kotlin/org/eclipse/tractusx/bpdm/gate/api/model/BusinessPartnerStateDto.kt b/bpdm-common/src/main/kotlin/org/eclipse/tractusx/bpdm/common/dto/BusinessPartnerStateDto.kt similarity index 97% rename from bpdm-gate-api/src/main/kotlin/org/eclipse/tractusx/bpdm/gate/api/model/BusinessPartnerStateDto.kt rename to bpdm-common/src/main/kotlin/org/eclipse/tractusx/bpdm/common/dto/BusinessPartnerStateDto.kt index aa814a5e6..b7ad2c0f9 100644 --- a/bpdm-gate-api/src/main/kotlin/org/eclipse/tractusx/bpdm/gate/api/model/BusinessPartnerStateDto.kt +++ b/bpdm-common/src/main/kotlin/org/eclipse/tractusx/bpdm/common/dto/BusinessPartnerStateDto.kt @@ -17,7 +17,7 @@ * SPDX-License-Identifier: Apache-2.0 ******************************************************************************/ -package org.eclipse.tractusx.bpdm.gate.api.model +package org.eclipse.tractusx.bpdm.common.dto import io.swagger.v3.oas.annotations.media.Schema import org.eclipse.tractusx.bpdm.common.dto.openapidescription.LegalEntityStateDescription diff --git a/bpdm-common/src/main/kotlin/org/eclipse/tractusx/bpdm/common/dto/IBaseAlternativePostalAddressDto.kt b/bpdm-common/src/main/kotlin/org/eclipse/tractusx/bpdm/common/dto/IBaseAlternativePostalAddressDto.kt index 4ffa766b5..269ff915a 100644 --- a/bpdm-common/src/main/kotlin/org/eclipse/tractusx/bpdm/common/dto/IBaseAlternativePostalAddressDto.kt +++ b/bpdm-common/src/main/kotlin/org/eclipse/tractusx/bpdm/common/dto/IBaseAlternativePostalAddressDto.kt @@ -31,18 +31,24 @@ interface IBaseAlternativePostalAddressDto { // OpenAPI description for complex field does not work! val geographicCoordinates: GeoCoordinateDto? + @get:Schema(description = PostalAddressDescription.country) + val country: Any? + + @get:Schema(description = PostalAddressDescription.administrativeAreaLevel1) + val administrativeAreaLevel1: Any? + @get:Schema(description = PostalAddressDescription.postalCode) val postalCode: String? @get:Schema(description = PostalAddressDescription.city) - val city: String + val city: String? @get:Schema(description = PostalAddressDescription.deliveryServiceType) - val deliveryServiceType: DeliveryServiceType + val deliveryServiceType: DeliveryServiceType? @get:Schema(description = PostalAddressDescription.deliveryServiceQualifier) val deliveryServiceQualifier: String? @get:Schema(description = PostalAddressDescription.deliveryServiceNumber) - val deliveryServiceNumber: String + val deliveryServiceNumber: String? } diff --git a/bpdm-gate-api/src/main/kotlin/org/eclipse/tractusx/bpdm/gate/api/model/IBaseBusinessPartnerDto.kt b/bpdm-common/src/main/kotlin/org/eclipse/tractusx/bpdm/common/dto/IBaseBusinessPartnerDto.kt similarity index 90% rename from bpdm-gate-api/src/main/kotlin/org/eclipse/tractusx/bpdm/gate/api/model/IBaseBusinessPartnerDto.kt rename to bpdm-common/src/main/kotlin/org/eclipse/tractusx/bpdm/common/dto/IBaseBusinessPartnerDto.kt index b9bf812f5..62771683a 100644 --- a/bpdm-gate-api/src/main/kotlin/org/eclipse/tractusx/bpdm/gate/api/model/IBaseBusinessPartnerDto.kt +++ b/bpdm-common/src/main/kotlin/org/eclipse/tractusx/bpdm/common/dto/IBaseBusinessPartnerDto.kt @@ -17,19 +17,13 @@ * SPDX-License-Identifier: Apache-2.0 ******************************************************************************/ -package org.eclipse.tractusx.bpdm.gate.api.model +package org.eclipse.tractusx.bpdm.common.dto import io.swagger.v3.oas.annotations.media.ArraySchema import io.swagger.v3.oas.annotations.media.Schema -import org.eclipse.tractusx.bpdm.common.dto.ClassificationDto -import org.eclipse.tractusx.bpdm.common.dto.openapidescription.CommonDescription - interface IBaseBusinessPartnerDto { - @get:Schema(description = CommonDescription.externalId) - val externalId: String - @get:ArraySchema(arraySchema = Schema(description = "The list of name parts to accommodate the different number of name fields in different systems.")) val nameParts: List @@ -51,6 +45,9 @@ interface IBaseBusinessPartnerDto { @get:ArraySchema(arraySchema = Schema(description = "Roles this business partner takes in relation to the sharing member. Sorted and duplicates removed by the service.")) val roles: Collection + @get:Schema(description = "Address of the official seat of this business partner.") + val postalAddress: IBaseBusinessPartnerPostalAddressDto + @get:Schema(name = "isOwner", description = "True if the sharing member declares itself as the owner of the business partner.") val isOwner: Boolean diff --git a/bpdm-common/src/main/kotlin/org/eclipse/tractusx/bpdm/common/dto/IBaseBusinessPartnerPostalAddressDto.kt b/bpdm-common/src/main/kotlin/org/eclipse/tractusx/bpdm/common/dto/IBaseBusinessPartnerPostalAddressDto.kt new file mode 100644 index 000000000..767fa40b5 --- /dev/null +++ b/bpdm-common/src/main/kotlin/org/eclipse/tractusx/bpdm/common/dto/IBaseBusinessPartnerPostalAddressDto.kt @@ -0,0 +1,37 @@ +/******************************************************************************* + * 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 + +import io.swagger.v3.oas.annotations.media.Schema +import org.eclipse.tractusx.bpdm.common.dto.openapidescription.LogisticAddressDescription + +interface IBaseBusinessPartnerPostalAddressDto { + + @get:Schema(description = "Type of the address") + val addressType: AddressType? + + // TODO OpenAPI description for complex field does not work!! + @get:Schema(description = LogisticAddressDescription.physicalPostalAddress) + val physicalPostalAddress: IBasePhysicalPostalAddressDto? + + // TODO OpenAPI description for complex field does not work!! + @get:Schema(description = LogisticAddressDescription.alternativePostalAddress) + val alternativePostalAddress: IBaseAlternativePostalAddressDto? +} diff --git a/bpdm-common/src/main/kotlin/org/eclipse/tractusx/bpdm/common/dto/IBasePhysicalPostalAddressDto.kt b/bpdm-common/src/main/kotlin/org/eclipse/tractusx/bpdm/common/dto/IBasePhysicalPostalAddressDto.kt index 336247fb7..add476881 100644 --- a/bpdm-common/src/main/kotlin/org/eclipse/tractusx/bpdm/common/dto/IBasePhysicalPostalAddressDto.kt +++ b/bpdm-common/src/main/kotlin/org/eclipse/tractusx/bpdm/common/dto/IBasePhysicalPostalAddressDto.kt @@ -30,6 +30,12 @@ interface IBasePhysicalPostalAddressDto { // OpenAPI description for complex field does not work! val geographicCoordinates: GeoCoordinateDto? + @get:Schema(description = PostalAddressDescription.country) + val country: Any? + + @get:Schema(description = PostalAddressDescription.administrativeAreaLevel1) + val administrativeAreaLevel1: Any? + @get:Schema(description = PostalAddressDescription.administrativeAreaLevel2) val administrativeAreaLevel2: String? @@ -40,11 +46,14 @@ interface IBasePhysicalPostalAddressDto { val postalCode: String? @get:Schema(description = PostalAddressDescription.city) - val city: String + val city: String? @get:Schema(description = PostalAddressDescription.district) val district: String? + // OpenAPI description for complex field does not work! + val street: IBaseStreetDto? + @get:Schema(description = PostalAddressDescription.companyPostalCode) val companyPostalCode: String? diff --git a/bpdm-common/src/main/kotlin/org/eclipse/tractusx/bpdm/common/dto/IBaseStreetDto.kt b/bpdm-common/src/main/kotlin/org/eclipse/tractusx/bpdm/common/dto/IBaseStreetDto.kt new file mode 100644 index 000000000..7da1ae362 --- /dev/null +++ b/bpdm-common/src/main/kotlin/org/eclipse/tractusx/bpdm/common/dto/IBaseStreetDto.kt @@ -0,0 +1,38 @@ +/******************************************************************************* + * 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 + +import io.swagger.v3.oas.annotations.media.Schema +import org.eclipse.tractusx.bpdm.common.dto.openapidescription.StreetDescription + +interface IBaseStreetDto { + + @get:Schema(description = StreetDescription.name) + val name: String? + + @get:Schema(description = StreetDescription.houseNumber) + val houseNumber: String? + + @get:Schema(description = StreetDescription.milestone) + val milestone: String? + + @get:Schema(description = StreetDescription.direction) + val direction: String? +} diff --git a/bpdm-common/src/main/kotlin/org/eclipse/tractusx/bpdm/common/dto/IStreetDetailedDto.kt b/bpdm-common/src/main/kotlin/org/eclipse/tractusx/bpdm/common/dto/IStreetDetailedDto.kt new file mode 100644 index 000000000..d45b9c007 --- /dev/null +++ b/bpdm-common/src/main/kotlin/org/eclipse/tractusx/bpdm/common/dto/IStreetDetailedDto.kt @@ -0,0 +1,38 @@ +/******************************************************************************* + * 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 + +import io.swagger.v3.oas.annotations.media.Schema +import org.eclipse.tractusx.bpdm.common.dto.openapidescription.StreetDescription + +interface IStreetDetailedDto : IBaseStreetDto { + + @get:Schema(description = StreetDescription.namePrefix) + val namePrefix: String? + + @get:Schema(description = StreetDescription.additionalNamePrefix) + val additionalNamePrefix: String? + + @get:Schema(description = StreetDescription.nameSuffix) + val nameSuffix: String? + + @get:Schema(description = StreetDescription.additionalNameSuffix) + val additionalNameSuffix: String? +} diff --git a/bpdm-common/src/main/kotlin/org/eclipse/tractusx/bpdm/common/dto/PhysicalPostalAddressDto.kt b/bpdm-common/src/main/kotlin/org/eclipse/tractusx/bpdm/common/dto/PhysicalPostalAddressDto.kt index 0c78fe8a8..2d655f4ae 100644 --- a/bpdm-common/src/main/kotlin/org/eclipse/tractusx/bpdm/common/dto/PhysicalPostalAddressDto.kt +++ b/bpdm-common/src/main/kotlin/org/eclipse/tractusx/bpdm/common/dto/PhysicalPostalAddressDto.kt @@ -31,11 +31,9 @@ data class PhysicalPostalAddressDto( override val geographicCoordinates: GeoCoordinateDto?, - @get:Schema(description = PostalAddressDescription.country) - val country: CountryCode, + override val country: CountryCode, - @get:Schema(description = PostalAddressDescription.administrativeAreaLevel1) - val administrativeAreaLevel1: String?, + override val administrativeAreaLevel1: String?, override val administrativeAreaLevel2: String?, @@ -47,8 +45,7 @@ data class PhysicalPostalAddressDto( override val district: String?, - // OpenAPI description for complex field does not work! - val street: StreetDto?, + override val street: StreetDto?, override val companyPostalCode: String?, diff --git a/bpdm-common/src/main/kotlin/org/eclipse/tractusx/bpdm/common/dto/StreetDto.kt b/bpdm-common/src/main/kotlin/org/eclipse/tractusx/bpdm/common/dto/StreetDto.kt index 79736b5ed..75a5ad95e 100644 --- a/bpdm-common/src/main/kotlin/org/eclipse/tractusx/bpdm/common/dto/StreetDto.kt +++ b/bpdm-common/src/main/kotlin/org/eclipse/tractusx/bpdm/common/dto/StreetDto.kt @@ -25,15 +25,9 @@ import org.eclipse.tractusx.bpdm.common.dto.openapidescription.StreetDescription @Schema(description = StreetDescription.header) data class StreetDto( - @get:Schema(description = StreetDescription.name) - val name: String? = null, + override val name: String? = null, + override val houseNumber: String? = null, + override val milestone: String? = null, + override val direction: String? = null - @get:Schema(description = StreetDescription.houseNumber) - val houseNumber: String? = null, - - @get:Schema(description = StreetDescription.milestone) - val milestone: String? = null, - - @get:Schema(description = StreetDescription.direction) - val direction: String? = null -) +) : IBaseStreetDto diff --git a/bpdm-common/src/main/kotlin/org/eclipse/tractusx/bpdm/common/dto/response/AlternativePostalAddressVerboseDto.kt b/bpdm-common/src/main/kotlin/org/eclipse/tractusx/bpdm/common/dto/response/AlternativePostalAddressVerboseDto.kt index 67c490491..80dfb5725 100644 --- a/bpdm-common/src/main/kotlin/org/eclipse/tractusx/bpdm/common/dto/response/AlternativePostalAddressVerboseDto.kt +++ b/bpdm-common/src/main/kotlin/org/eclipse/tractusx/bpdm/common/dto/response/AlternativePostalAddressVerboseDto.kt @@ -36,10 +36,10 @@ data class AlternativePostalAddressVerboseDto( override val geographicCoordinates: GeoCoordinateDto?, // OpenAPI description for complex field does not work! - val country: TypeKeyNameVerboseDto, + override val country: TypeKeyNameVerboseDto, // OpenAPI description for complex field does not work! - val administrativeAreaLevel1: RegionDto?, + override val administrativeAreaLevel1: RegionDto?, override val postalCode: String?, diff --git a/bpdm-common/src/main/kotlin/org/eclipse/tractusx/bpdm/common/dto/response/PhysicalPostalAddressVerboseDto.kt b/bpdm-common/src/main/kotlin/org/eclipse/tractusx/bpdm/common/dto/response/PhysicalPostalAddressVerboseDto.kt index b1a3c0048..4e4796ad1 100644 --- a/bpdm-common/src/main/kotlin/org/eclipse/tractusx/bpdm/common/dto/response/PhysicalPostalAddressVerboseDto.kt +++ b/bpdm-common/src/main/kotlin/org/eclipse/tractusx/bpdm/common/dto/response/PhysicalPostalAddressVerboseDto.kt @@ -36,10 +36,10 @@ data class PhysicalPostalAddressVerboseDto( override val geographicCoordinates: GeoCoordinateDto?, // OpenAPI description for complex field does not work! - val country: TypeKeyNameVerboseDto, + override val country: TypeKeyNameVerboseDto, // OpenAPI description for complex field does not work! - val administrativeAreaLevel1: RegionDto?, + override val administrativeAreaLevel1: RegionDto?, override val administrativeAreaLevel2: String?, @@ -51,8 +51,7 @@ data class PhysicalPostalAddressVerboseDto( override val district: String?, - // OpenAPI description for complex field does not work! - val street: StreetDto?, + override val street: StreetDto?, override val companyPostalCode: String?, diff --git a/bpdm-gate-api/src/main/kotlin/org/eclipse/tractusx/bpdm/gate/api/model/BusinessPartnerPostalAddressInputDto.kt b/bpdm-gate-api/src/main/kotlin/org/eclipse/tractusx/bpdm/gate/api/model/BusinessPartnerPostalAddressInputDto.kt index fc991f0a4..5e1437342 100644 --- a/bpdm-gate-api/src/main/kotlin/org/eclipse/tractusx/bpdm/gate/api/model/BusinessPartnerPostalAddressInputDto.kt +++ b/bpdm-gate-api/src/main/kotlin/org/eclipse/tractusx/bpdm/gate/api/model/BusinessPartnerPostalAddressInputDto.kt @@ -20,21 +20,15 @@ package org.eclipse.tractusx.bpdm.gate.api.model import io.swagger.v3.oas.annotations.media.Schema +import org.eclipse.tractusx.bpdm.common.dto.AddressType import org.eclipse.tractusx.bpdm.common.dto.AlternativePostalAddressDto -import org.eclipse.tractusx.bpdm.common.dto.openapidescription.LogisticAddressDescription -import org.eclipse.tractusx.bpdm.gate.api.model.openapidescription.BusinessPartnerAddressDescription +import org.eclipse.tractusx.bpdm.common.dto.IBaseBusinessPartnerPostalAddressDto @Schema(description = "Postal address of a input business partner", requiredProperties = ["physicalPostalAddress"]) data class BusinessPartnerPostalAddressInputDto( - @get:Schema( description = BusinessPartnerAddressDescription.addressType) - val addressType: AddressType?, + override val addressType: AddressType?, + override val physicalPostalAddress: PhysicalPostalAddressGateDto, + override val alternativePostalAddress: AlternativePostalAddressDto? = null - // 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: AlternativePostalAddressDto? = null -) +) : IBaseBusinessPartnerPostalAddressDto diff --git a/bpdm-gate-api/src/main/kotlin/org/eclipse/tractusx/bpdm/gate/api/model/BusinessPartnerPostalAddressOutputDto.kt b/bpdm-gate-api/src/main/kotlin/org/eclipse/tractusx/bpdm/gate/api/model/BusinessPartnerPostalAddressOutputDto.kt index 73a7b5379..2060b69f7 100644 --- a/bpdm-gate-api/src/main/kotlin/org/eclipse/tractusx/bpdm/gate/api/model/BusinessPartnerPostalAddressOutputDto.kt +++ b/bpdm-gate-api/src/main/kotlin/org/eclipse/tractusx/bpdm/gate/api/model/BusinessPartnerPostalAddressOutputDto.kt @@ -20,21 +20,15 @@ package org.eclipse.tractusx.bpdm.gate.api.model import io.swagger.v3.oas.annotations.media.Schema +import org.eclipse.tractusx.bpdm.common.dto.AddressType import org.eclipse.tractusx.bpdm.common.dto.AlternativePostalAddressDto -import org.eclipse.tractusx.bpdm.common.dto.openapidescription.LogisticAddressDescription -import org.eclipse.tractusx.bpdm.gate.api.model.openapidescription.BusinessPartnerAddressDescription +import org.eclipse.tractusx.bpdm.common.dto.IBaseBusinessPartnerPostalAddressDto @Schema(description = "Postal address of a output business partner", requiredProperties = ["physicalPostalAddress"]) data class BusinessPartnerPostalAddressOutputDto( - @get:Schema(description = BusinessPartnerAddressDescription.addressType) - val addressType: AddressType, + override val addressType: AddressType, + override val physicalPostalAddress: PhysicalPostalAddressGateDto, + override val alternativePostalAddress: AlternativePostalAddressDto? = null - // 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: AlternativePostalAddressDto? = null -) +) : IBaseBusinessPartnerPostalAddressDto diff --git a/bpdm-gate-api/src/main/kotlin/org/eclipse/tractusx/bpdm/gate/api/model/openapidescription/BusinessPartnerAddressDescription.kt b/bpdm-gate-api/src/main/kotlin/org/eclipse/tractusx/bpdm/gate/api/model/IBaseBusinessPartnerGateDto.kt similarity index 69% rename from bpdm-gate-api/src/main/kotlin/org/eclipse/tractusx/bpdm/gate/api/model/openapidescription/BusinessPartnerAddressDescription.kt rename to bpdm-gate-api/src/main/kotlin/org/eclipse/tractusx/bpdm/gate/api/model/IBaseBusinessPartnerGateDto.kt index 0523612de..d9b60e0d2 100644 --- a/bpdm-gate-api/src/main/kotlin/org/eclipse/tractusx/bpdm/gate/api/model/openapidescription/BusinessPartnerAddressDescription.kt +++ b/bpdm-gate-api/src/main/kotlin/org/eclipse/tractusx/bpdm/gate/api/model/IBaseBusinessPartnerGateDto.kt @@ -17,9 +17,14 @@ * SPDX-License-Identifier: Apache-2.0 ******************************************************************************/ -package org.eclipse.tractusx.bpdm.gate.api.model.openapidescription +package org.eclipse.tractusx.bpdm.gate.api.model -object BusinessPartnerAddressDescription { +import io.swagger.v3.oas.annotations.media.Schema +import org.eclipse.tractusx.bpdm.common.dto.IBaseBusinessPartnerDto +import org.eclipse.tractusx.bpdm.common.dto.openapidescription.CommonDescription - const val addressType = "Type of the address" -} \ No newline at end of file +interface IBaseBusinessPartnerGateDto : IBaseBusinessPartnerDto { + + @get:Schema(description = CommonDescription.externalId) + val externalId: String +} 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/LogisticAddressGateDto.kt index fdcc3f8cc..5b728763d 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/LogisticAddressGateDto.kt @@ -24,6 +24,7 @@ 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.AlternativePostalAddressDto +import org.eclipse.tractusx.bpdm.common.dto.BusinessPartnerRole import org.eclipse.tractusx.bpdm.common.dto.openapidescription.LogisticAddressDescription @Schema(description = LogisticAddressDescription.header) 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/PhysicalPostalAddressGateDto.kt index dd26341d7..98132567e 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/PhysicalPostalAddressGateDto.kt @@ -36,11 +36,9 @@ data class PhysicalPostalAddressGateDto( override val geographicCoordinates: GeoCoordinateDto?, - @get:Schema(description = PostalAddressDescription.country) - val country: CountryCode, + override val country: CountryCode, - @get:Schema(description = PostalAddressDescription.administrativeAreaLevel1) - val administrativeAreaLevel1: String?, + override val administrativeAreaLevel1: String?, override val administrativeAreaLevel2: String?, @@ -52,8 +50,7 @@ data class PhysicalPostalAddressGateDto( override val district: String?, - // OpenAPI description for complex field does not work! - val street: StreetGateDto?, + override val street: StreetGateDto?, override val companyPostalCode: 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 9439a5a1b..6a90d4c77 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 @@ -21,6 +21,7 @@ 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 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/StreetGateDto.kt index b616908ce..71f02fff5 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/StreetGateDto.kt @@ -20,32 +20,19 @@ package org.eclipse.tractusx.bpdm.gate.api.model import io.swagger.v3.oas.annotations.media.Schema +import org.eclipse.tractusx.bpdm.common.dto.IStreetDetailedDto import org.eclipse.tractusx.bpdm.common.dto.openapidescription.StreetDescription @Schema(description = StreetDescription.header) data class StreetGateDto( - @get:Schema(description = StreetDescription.namePrefix) - val namePrefix: String? = null, + override val namePrefix: String? = null, + override val additionalNamePrefix: String? = null, + override val name: String? = null, + override val nameSuffix: String? = null, + override val additionalNameSuffix: String? = null, + override val houseNumber: String? = null, + override val milestone: String? = null, + override val direction: String? = null - @get:Schema(description = StreetDescription.additionalNamePrefix) - val additionalNamePrefix: String? = null, - - @get:Schema(description = StreetDescription.name) - val name: String? = null, - - @get:Schema(description = StreetDescription.nameSuffix) - val nameSuffix: String? = null, - - @get:Schema(description = StreetDescription.additionalNameSuffix) - val additionalNameSuffix: String? = null, - - @get:Schema(description = StreetDescription.houseNumber) - val houseNumber: String? = null, - - @get:Schema(description = StreetDescription.milestone) - val milestone: String? = null, - - @get:Schema(description = StreetDescription.direction) - val direction: String? = null -) +) : IStreetDetailedDto diff --git a/bpdm-gate-api/src/main/kotlin/org/eclipse/tractusx/bpdm/gate/api/model/request/BusinessPartnerInputRequest.kt b/bpdm-gate-api/src/main/kotlin/org/eclipse/tractusx/bpdm/gate/api/model/request/BusinessPartnerInputRequest.kt index b86a317e9..5210ca368 100644 --- a/bpdm-gate-api/src/main/kotlin/org/eclipse/tractusx/bpdm/gate/api/model/request/BusinessPartnerInputRequest.kt +++ b/bpdm-gate-api/src/main/kotlin/org/eclipse/tractusx/bpdm/gate/api/model/request/BusinessPartnerInputRequest.kt @@ -20,9 +20,12 @@ package org.eclipse.tractusx.bpdm.gate.api.model.request import io.swagger.v3.oas.annotations.media.Schema +import org.eclipse.tractusx.bpdm.common.dto.BusinessPartnerIdentifierDto +import org.eclipse.tractusx.bpdm.common.dto.BusinessPartnerRole +import org.eclipse.tractusx.bpdm.common.dto.BusinessPartnerStateDto import org.eclipse.tractusx.bpdm.common.dto.ClassificationDto -import org.eclipse.tractusx.bpdm.gate.api.model.* - +import org.eclipse.tractusx.bpdm.gate.api.model.BusinessPartnerPostalAddressInputDto +import org.eclipse.tractusx.bpdm.gate.api.model.IBaseBusinessPartnerGateDto @Schema( description = "Generic business partner with external id", @@ -37,14 +40,10 @@ data class BusinessPartnerInputRequest( override val states: Collection = emptyList(), override val classifications: Collection = emptyList(), override val roles: Collection = emptyList(), - - @get:Schema(description = "Address of the official seat of this business partner.") - val postalAddress: BusinessPartnerPostalAddressInputDto, - + override val postalAddress: BusinessPartnerPostalAddressInputDto, override val isOwner: Boolean = false, - override val bpnL: String? = null, override val bpnS: String? = null, override val bpnA: String? = null -) : IBaseBusinessPartnerDto +) : IBaseBusinessPartnerGateDto 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 1fb152a48..7d13e3573 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 @@ -23,11 +23,11 @@ import com.fasterxml.jackson.annotation.JsonUnwrapped import com.fasterxml.jackson.databind.annotation.JsonDeserialize 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.LegalEntityDto 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.BusinessPartnerRole import org.eclipse.tractusx.bpdm.gate.api.model.LogisticAddressGateDto @JsonDeserialize(using = DataClassUnwrappedJsonDeserializer::class) diff --git a/bpdm-gate-api/src/main/kotlin/org/eclipse/tractusx/bpdm/gate/api/model/request/LegalEntityGateOutputRequest.kt b/bpdm-gate-api/src/main/kotlin/org/eclipse/tractusx/bpdm/gate/api/model/request/LegalEntityGateOutputRequest.kt index 69fdb4804..4cd91f4c2 100644 --- a/bpdm-gate-api/src/main/kotlin/org/eclipse/tractusx/bpdm/gate/api/model/request/LegalEntityGateOutputRequest.kt +++ b/bpdm-gate-api/src/main/kotlin/org/eclipse/tractusx/bpdm/gate/api/model/request/LegalEntityGateOutputRequest.kt @@ -23,12 +23,12 @@ import com.fasterxml.jackson.annotation.JsonUnwrapped import com.fasterxml.jackson.databind.annotation.JsonDeserialize 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.LegalEntityDto 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.AddressGateOutputChildRequest -import org.eclipse.tractusx.bpdm.gate.api.model.BusinessPartnerRole @JsonDeserialize(using = DataClassUnwrappedJsonDeserializer::class) @Schema(description = LegalEntityDescription.headerUpsertRequest) diff --git a/bpdm-gate-api/src/main/kotlin/org/eclipse/tractusx/bpdm/gate/api/model/response/BusinessPartnerInputDto.kt b/bpdm-gate-api/src/main/kotlin/org/eclipse/tractusx/bpdm/gate/api/model/response/BusinessPartnerInputDto.kt index e783523ba..ebe7c82b1 100644 --- a/bpdm-gate-api/src/main/kotlin/org/eclipse/tractusx/bpdm/gate/api/model/response/BusinessPartnerInputDto.kt +++ b/bpdm-gate-api/src/main/kotlin/org/eclipse/tractusx/bpdm/gate/api/model/response/BusinessPartnerInputDto.kt @@ -20,12 +20,15 @@ package org.eclipse.tractusx.bpdm.gate.api.model.response import io.swagger.v3.oas.annotations.media.Schema +import org.eclipse.tractusx.bpdm.common.dto.BusinessPartnerIdentifierDto +import org.eclipse.tractusx.bpdm.common.dto.BusinessPartnerRole +import org.eclipse.tractusx.bpdm.common.dto.BusinessPartnerStateDto import org.eclipse.tractusx.bpdm.common.dto.ClassificationDto import org.eclipse.tractusx.bpdm.common.dto.openapidescription.CommonDescription -import org.eclipse.tractusx.bpdm.gate.api.model.* +import org.eclipse.tractusx.bpdm.gate.api.model.BusinessPartnerPostalAddressInputDto +import org.eclipse.tractusx.bpdm.gate.api.model.IBaseBusinessPartnerGateDto import java.time.Instant - @Schema(description = "Generic business partner with external id", requiredProperties = ["externalId", "postalAddress"]) data class BusinessPartnerInputDto( override val externalId: String, @@ -36,12 +39,8 @@ data class BusinessPartnerInputDto( override val states: Collection = emptyList(), override val classifications: Collection = emptyList(), override val roles: Collection = emptyList(), - - @get:Schema(description = "Address of the official seat of this business partner.") - val postalAddress: BusinessPartnerPostalAddressInputDto, - + override val postalAddress: BusinessPartnerPostalAddressInputDto, override val isOwner: Boolean, - override val bpnL: String?, override val bpnS: String?, override val bpnA: String?, @@ -52,4 +51,4 @@ data class BusinessPartnerInputDto( @get:Schema(description = CommonDescription.updatedAt) val updatedAt: Instant -) : IBaseBusinessPartnerDto +) : IBaseBusinessPartnerGateDto diff --git a/bpdm-gate-api/src/main/kotlin/org/eclipse/tractusx/bpdm/gate/api/model/response/BusinessPartnerOutputDto.kt b/bpdm-gate-api/src/main/kotlin/org/eclipse/tractusx/bpdm/gate/api/model/response/BusinessPartnerOutputDto.kt index e4559e855..4716e47bf 100644 --- a/bpdm-gate-api/src/main/kotlin/org/eclipse/tractusx/bpdm/gate/api/model/response/BusinessPartnerOutputDto.kt +++ b/bpdm-gate-api/src/main/kotlin/org/eclipse/tractusx/bpdm/gate/api/model/response/BusinessPartnerOutputDto.kt @@ -20,12 +20,15 @@ package org.eclipse.tractusx.bpdm.gate.api.model.response import io.swagger.v3.oas.annotations.media.Schema +import org.eclipse.tractusx.bpdm.common.dto.BusinessPartnerIdentifierDto +import org.eclipse.tractusx.bpdm.common.dto.BusinessPartnerRole +import org.eclipse.tractusx.bpdm.common.dto.BusinessPartnerStateDto import org.eclipse.tractusx.bpdm.common.dto.ClassificationDto import org.eclipse.tractusx.bpdm.common.dto.openapidescription.CommonDescription -import org.eclipse.tractusx.bpdm.gate.api.model.* +import org.eclipse.tractusx.bpdm.gate.api.model.BusinessPartnerPostalAddressOutputDto +import org.eclipse.tractusx.bpdm.gate.api.model.IBaseBusinessPartnerGateDto import java.time.Instant - @Schema(description = "Generic business partner output with external id", requiredProperties = ["externalId", "postalAddress", "bpnL", "bpnA"]) data class BusinessPartnerOutputDto( override val externalId: String, @@ -36,12 +39,8 @@ data class BusinessPartnerOutputDto( override val states: Collection = emptyList(), override val classifications: Collection = emptyList(), override val roles: Collection = emptyList(), - - @get:Schema(description = "Address of the official seat of this business partner.") - val postalAddress: BusinessPartnerPostalAddressOutputDto, - + override val postalAddress: BusinessPartnerPostalAddressOutputDto, override val isOwner: Boolean, - override val bpnL: String, override val bpnS: String?, override val bpnA: String, @@ -52,4 +51,4 @@ data class BusinessPartnerOutputDto( @get:Schema(description = CommonDescription.updatedAt) val updatedAt: Instant -) : IBaseBusinessPartnerDto +) : IBaseBusinessPartnerGateDto diff --git a/bpdm-gate-api/src/main/kotlin/org/eclipse/tractusx/bpdm/gate/api/model/response/LegalEntityGateInputDto.kt b/bpdm-gate-api/src/main/kotlin/org/eclipse/tractusx/bpdm/gate/api/model/response/LegalEntityGateInputDto.kt index 0fab63791..ab4d21a78 100644 --- a/bpdm-gate-api/src/main/kotlin/org/eclipse/tractusx/bpdm/gate/api/model/response/LegalEntityGateInputDto.kt +++ b/bpdm-gate-api/src/main/kotlin/org/eclipse/tractusx/bpdm/gate/api/model/response/LegalEntityGateInputDto.kt @@ -23,11 +23,11 @@ import com.fasterxml.jackson.annotation.JsonUnwrapped import com.fasterxml.jackson.databind.annotation.JsonDeserialize 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.LegalEntityDto 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.BusinessPartnerRole // TODO rename to LegalEntityGateInputResponse @JsonDeserialize(using = DataClassUnwrappedJsonDeserializer::class) diff --git a/bpdm-gate-api/src/main/kotlin/org/eclipse/tractusx/bpdm/gate/api/model/response/LegalEntityGateOutputResponse.kt b/bpdm-gate-api/src/main/kotlin/org/eclipse/tractusx/bpdm/gate/api/model/response/LegalEntityGateOutputResponse.kt index 01a6d7e32..7961954e5 100644 --- a/bpdm-gate-api/src/main/kotlin/org/eclipse/tractusx/bpdm/gate/api/model/response/LegalEntityGateOutputResponse.kt +++ b/bpdm-gate-api/src/main/kotlin/org/eclipse/tractusx/bpdm/gate/api/model/response/LegalEntityGateOutputResponse.kt @@ -23,11 +23,11 @@ import com.fasterxml.jackson.annotation.JsonUnwrapped import com.fasterxml.jackson.databind.annotation.JsonDeserialize 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.LegalEntityDto 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.BusinessPartnerRole @JsonDeserialize(using = DataClassUnwrappedJsonDeserializer::class) @Schema(description = LegalEntityDescription.header) diff --git a/bpdm-gate/src/main/kotlin/org/eclipse/tractusx/bpdm/gate/entity/Roles.kt b/bpdm-gate/src/main/kotlin/org/eclipse/tractusx/bpdm/gate/entity/Roles.kt index afd0f7651..a8794f457 100644 --- a/bpdm-gate/src/main/kotlin/org/eclipse/tractusx/bpdm/gate/entity/Roles.kt +++ b/bpdm-gate/src/main/kotlin/org/eclipse/tractusx/bpdm/gate/entity/Roles.kt @@ -39,8 +39,8 @@ package org.eclipse.tractusx.bpdm.gate.entity import jakarta.persistence.* +import org.eclipse.tractusx.bpdm.common.dto.BusinessPartnerRole import org.eclipse.tractusx.bpdm.common.model.BaseEntity -import org.eclipse.tractusx.bpdm.gate.api.model.BusinessPartnerRole @Entity @Table(name = "roles") diff --git a/bpdm-gate/src/main/kotlin/org/eclipse/tractusx/bpdm/gate/entity/generic/BusinessPartner.kt b/bpdm-gate/src/main/kotlin/org/eclipse/tractusx/bpdm/gate/entity/generic/BusinessPartner.kt index 31aecb68b..fc758a1ce 100644 --- a/bpdm-gate/src/main/kotlin/org/eclipse/tractusx/bpdm/gate/entity/generic/BusinessPartner.kt +++ b/bpdm-gate/src/main/kotlin/org/eclipse/tractusx/bpdm/gate/entity/generic/BusinessPartner.kt @@ -20,9 +20,9 @@ package org.eclipse.tractusx.bpdm.gate.entity.generic import jakarta.persistence.* +import org.eclipse.tractusx.bpdm.common.dto.BusinessPartnerRole import org.eclipse.tractusx.bpdm.common.model.BaseEntity import org.eclipse.tractusx.bpdm.common.model.StageType -import org.eclipse.tractusx.bpdm.gate.api.model.BusinessPartnerRole import java.util.* @Entity diff --git a/bpdm-gate/src/main/kotlin/org/eclipse/tractusx/bpdm/gate/entity/generic/PostalAddress.kt b/bpdm-gate/src/main/kotlin/org/eclipse/tractusx/bpdm/gate/entity/generic/PostalAddress.kt index ec336c5a3..ab1b9ab7d 100644 --- a/bpdm-gate/src/main/kotlin/org/eclipse/tractusx/bpdm/gate/entity/generic/PostalAddress.kt +++ b/bpdm-gate/src/main/kotlin/org/eclipse/tractusx/bpdm/gate/entity/generic/PostalAddress.kt @@ -20,8 +20,8 @@ package org.eclipse.tractusx.bpdm.gate.entity.generic import jakarta.persistence.* +import org.eclipse.tractusx.bpdm.common.dto.AddressType import org.eclipse.tractusx.bpdm.common.model.BaseEntity -import org.eclipse.tractusx.bpdm.gate.api.model.AddressType import org.eclipse.tractusx.bpdm.gate.entity.AlternativePostalAddress import org.eclipse.tractusx.bpdm.gate.entity.PhysicalPostalAddress 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 fe0aa93f1..d03b9a610 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 @@ -19,13 +19,14 @@ package org.eclipse.tractusx.bpdm.gate.service -import org.eclipse.tractusx.bpdm.common.dto.AlternativePostalAddressDto -import org.eclipse.tractusx.bpdm.common.dto.ClassificationDto -import org.eclipse.tractusx.bpdm.common.dto.GeoCoordinateDto +import org.eclipse.tractusx.bpdm.common.dto.* import org.eclipse.tractusx.bpdm.common.exception.BpdmNullMappingException import org.eclipse.tractusx.bpdm.common.model.StageType import org.eclipse.tractusx.bpdm.common.util.replace -import org.eclipse.tractusx.bpdm.gate.api.model.* +import org.eclipse.tractusx.bpdm.gate.api.model.BusinessPartnerPostalAddressInputDto +import org.eclipse.tractusx.bpdm.gate.api.model.BusinessPartnerPostalAddressOutputDto +import org.eclipse.tractusx.bpdm.gate.api.model.PhysicalPostalAddressGateDto +import org.eclipse.tractusx.bpdm.gate.api.model.StreetGateDto 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/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 d05da0b64..bf1cd7788 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 @@ -24,7 +24,7 @@ import org.eclipse.tractusx.bpdm.common.dto.response.PageDto import org.eclipse.tractusx.bpdm.common.model.StageType import org.eclipse.tractusx.bpdm.common.service.toPageDto import org.eclipse.tractusx.bpdm.gate.api.model.ChangelogType -import org.eclipse.tractusx.bpdm.gate.api.model.IBaseBusinessPartnerDto +import org.eclipse.tractusx.bpdm.gate.api.model.IBaseBusinessPartnerGateDto 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 @@ -94,7 +94,7 @@ class BusinessPartnerService( } private fun getExistingEntityByExternalId( - dtos: Collection, + dtos: Collection, stage: StageType ): Map { val externalIds = dtos.map { it.externalId }.toSet() @@ -102,7 +102,7 @@ class BusinessPartnerService( .associateBy { it.externalId } } - private fun initSharingState(dto: IBaseBusinessPartnerDto) { + private fun initSharingState(dto: IBaseBusinessPartnerGateDto) { // TODO make businessPartnerType optional sharingStateService.upsertSharingState(SharingStateDto(BusinessPartnerType.ADDRESS, dto.externalId)) } diff --git a/bpdm-gate/src/test/kotlin/org/eclipse/tractusx/bpdm/gate/entity/generic/BusinessPartnerIT.kt b/bpdm-gate/src/test/kotlin/org/eclipse/tractusx/bpdm/gate/entity/generic/BusinessPartnerIT.kt index 0ed737869..92df3dca8 100644 --- a/bpdm-gate/src/test/kotlin/org/eclipse/tractusx/bpdm/gate/entity/generic/BusinessPartnerIT.kt +++ b/bpdm-gate/src/test/kotlin/org/eclipse/tractusx/bpdm/gate/entity/generic/BusinessPartnerIT.kt @@ -42,9 +42,9 @@ import com.github.tomakehurst.wiremock.client.WireMock.* import com.github.tomakehurst.wiremock.core.WireMockConfiguration import com.github.tomakehurst.wiremock.junit5.WireMockExtension 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.model.* -import org.eclipse.tractusx.bpdm.gate.api.model.AddressType -import org.eclipse.tractusx.bpdm.gate.api.model.BusinessPartnerRole import org.eclipse.tractusx.bpdm.gate.entity.AlternativePostalAddress import org.eclipse.tractusx.bpdm.gate.entity.GeographicCoordinate import org.eclipse.tractusx.bpdm.gate.entity.PhysicalPostalAddress