From dd04fb13f3d262f7c74be56e57756b900301ece7 Mon Sep 17 00:00:00 2001 From: rschneider <97682836+rainer-exxcellent@users.noreply.github.com> Date: Thu, 24 Aug 2023 10:04:27 +0200 Subject: [PATCH 1/4] feat(generic bpm): #384 Gate API: Create input endpoints for generic business partner --- .../bpdm/gate/api/GateBusinessPartnerApi.kt | 79 +++++++++++++++++++ .../api/model/BusinessPartnerIdentifierDto.kt | 35 ++++++++ .../model/BusinessPartnerPostalAddressDto.kt | 42 ++++++++++ .../gate/api/model/BusinessPartnerStateDto.kt | 41 ++++++++++ .../api/model/IBaseBusinessPartnerInputDto.kt | 63 +++++++++++++++ .../request/BusinessPartnerInputRequest.kt | 39 +++++++++ .../BusinessPartnerInputResponseDto.kt | 47 +++++++++++ .../controller/BusinessPartnerController.kt | 42 ++++++++++ 8 files changed, 388 insertions(+) create mode 100644 bpdm-gate-api/src/main/kotlin/org/eclipse/tractusx/bpdm/gate/api/GateBusinessPartnerApi.kt create mode 100644 bpdm-gate-api/src/main/kotlin/org/eclipse/tractusx/bpdm/gate/api/model/BusinessPartnerIdentifierDto.kt create mode 100644 bpdm-gate-api/src/main/kotlin/org/eclipse/tractusx/bpdm/gate/api/model/BusinessPartnerPostalAddressDto.kt create mode 100644 bpdm-gate-api/src/main/kotlin/org/eclipse/tractusx/bpdm/gate/api/model/BusinessPartnerStateDto.kt create mode 100644 bpdm-gate-api/src/main/kotlin/org/eclipse/tractusx/bpdm/gate/api/model/IBaseBusinessPartnerInputDto.kt create mode 100644 bpdm-gate-api/src/main/kotlin/org/eclipse/tractusx/bpdm/gate/api/model/request/BusinessPartnerInputRequest.kt create mode 100644 bpdm-gate-api/src/main/kotlin/org/eclipse/tractusx/bpdm/gate/api/model/response/BusinessPartnerInputResponseDto.kt create mode 100644 bpdm-gate/src/main/kotlin/org/eclipse/tractusx/bpdm/gate/controller/BusinessPartnerController.kt 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 new file mode 100644 index 000000000..e00b63895 --- /dev/null +++ b/bpdm-gate-api/src/main/kotlin/org/eclipse/tractusx/bpdm/gate/api/GateBusinessPartnerApi.kt @@ -0,0 +1,79 @@ +/******************************************************************************* + * 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.gate.api + +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 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.gate.api.model.request.BusinessPartnerInputRequest +import org.eclipse.tractusx.bpdm.gate.api.model.response.BusinessPartnerInputResponseDto +import org.springdoc.core.annotations.ParameterObject +import org.springframework.http.MediaType +import org.springframework.web.bind.annotation.PostMapping +import org.springframework.web.bind.annotation.PutMapping +import org.springframework.web.bind.annotation.RequestBody +import org.springframework.web.bind.annotation.RequestMapping +import org.springframework.web.service.annotation.HttpExchange +import org.springframework.web.service.annotation.PostExchange +import org.springframework.web.service.annotation.PutExchange + +@RequestMapping("/api/catena", produces = [MediaType.APPLICATION_JSON_VALUE]) +@HttpExchange("/api/catena") +interface GateBusinessPartnerApi { + + @Operation( + summary = "Create or update business partner with given external ID", + description = "Create or update generic business partner. " + + "Updates instead of creating a new business partner if an already existing external id is used. " + + "The same external id may not occur more than once in a single request. " + + "For a single request, the maximum number of business partners in the request is limited to \${bpdm.api.upsert-limit} entries." + ) + @ApiResponses( + value = [ + ApiResponse(responseCode = "200", description = "Business partner were successfully updated or created"), + ApiResponse(responseCode = "400", description = "On malformed legal entity request", content = [Content()]), + ] + ) + @PutMapping("/input/business-partners") + @PutExchange("/input/business-partners") + fun upsertBusinessPartnersInput(@RequestBody businessPartners: Collection): Collection + + @Operation( + summary = "Search business partner by external ID. An empty external ID list returns a paginated list of all business partners.", + description = "Get page of business partners filtered by a collection of externalIds." + ) + @ApiResponses( + value = [ + ApiResponse(responseCode = "200", description = "The requested page of busines partners"), + ApiResponse(responseCode = "400", description = "On malformed pagination request", content = [Content()]), + ] + ) + @PostMapping("/input/business-partners/search") + @PostExchange("/input/business-partners/search") + fun getBusinessPartnersInputByExternalIds( + @ParameterObject @Valid paginationRequest: PaginationRequest, + @RequestBody externalIds: Collection + ): PageDto + +} \ No newline at end of file diff --git a/bpdm-gate-api/src/main/kotlin/org/eclipse/tractusx/bpdm/gate/api/model/BusinessPartnerIdentifierDto.kt b/bpdm-gate-api/src/main/kotlin/org/eclipse/tractusx/bpdm/gate/api/model/BusinessPartnerIdentifierDto.kt new file mode 100644 index 000000000..813fcf2f4 --- /dev/null +++ b/bpdm-gate-api/src/main/kotlin/org/eclipse/tractusx/bpdm/gate/api/model/BusinessPartnerIdentifierDto.kt @@ -0,0 +1,35 @@ +/******************************************************************************* + * 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.gate.api.model + +import io.swagger.v3.oas.annotations.media.Schema + +@Schema(description = "Identifier record for a business partner", requiredProperties = ["type"]) +data class BusinessPartnerIdentifierDto( + + @get:Schema(description = "Value of the identifier") + val value: String, + + @get:Schema(description = "Technical key of the type to which this identifier belongs to") + val type: String, + + @get:Schema(description = "Body which issued the identifier") + val issuingBody: String? +) 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 new file mode 100644 index 000000000..7302ab6cc --- /dev/null +++ b/bpdm-gate-api/src/main/kotlin/org/eclipse/tractusx/bpdm/gate/api/model/BusinessPartnerPostalAddressDto.kt @@ -0,0 +1,42 @@ +/******************************************************************************* + * 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.gate.api.model + +import io.swagger.v3.oas.annotations.media.Schema +import org.eclipse.tractusx.bpdm.common.dto.AlternativePostalAddressDto +import org.eclipse.tractusx.bpdm.common.dto.openapidescription.LogisticAddressDescription + +@Schema(description = "Postal address of a business partner", requiredProperties = ["physicalPostalAddress"]) +data class BusinessPartnerPostalAddressDto( + + @get:Schema(name = "isLegalAddress", description = LogisticAddressDescription.isLegalAddress) + val isLegalAddress: Boolean = false, + + @get:Schema(name = "isSiteMainAddress", description = LogisticAddressDescription.isMainAddress) + val isSiteMainAddress: Boolean = false, + + // 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 +) diff --git a/bpdm-gate-api/src/main/kotlin/org/eclipse/tractusx/bpdm/gate/api/model/BusinessPartnerStateDto.kt b/bpdm-gate-api/src/main/kotlin/org/eclipse/tractusx/bpdm/gate/api/model/BusinessPartnerStateDto.kt new file mode 100644 index 000000000..aa3e8ccb6 --- /dev/null +++ b/bpdm-gate-api/src/main/kotlin/org/eclipse/tractusx/bpdm/gate/api/model/BusinessPartnerStateDto.kt @@ -0,0 +1,41 @@ +/******************************************************************************* + * 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.gate.api.model + +import io.swagger.v3.oas.annotations.media.Schema +import org.eclipse.tractusx.bpdm.common.dto.openapidescription.LegalEntityStateDescription +import org.eclipse.tractusx.bpdm.common.model.BusinessStateType +import java.time.LocalDateTime + +@Schema(description = LegalEntityStateDescription.header, requiredProperties = ["type"]) +data class BusinessPartnerStateDto( + + @get:Schema(description = "Exact, official denotation of the status") + val description: String?, + + @get:Schema(description = "Date since when the status is/was valid") + val validFrom: LocalDateTime?, + + @get:Schema(description = "Date until the status was valid, if applicable") + val validTo: LocalDateTime?, + + @get:Schema(description = "The type of this specified status") + val type: BusinessStateType +) diff --git a/bpdm-gate-api/src/main/kotlin/org/eclipse/tractusx/bpdm/gate/api/model/IBaseBusinessPartnerInputDto.kt b/bpdm-gate-api/src/main/kotlin/org/eclipse/tractusx/bpdm/gate/api/model/IBaseBusinessPartnerInputDto.kt new file mode 100644 index 000000000..04e23fa12 --- /dev/null +++ b/bpdm-gate-api/src/main/kotlin/org/eclipse/tractusx/bpdm/gate/api/model/IBaseBusinessPartnerInputDto.kt @@ -0,0 +1,63 @@ +/******************************************************************************* + * 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.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.ClassificationDto +import org.eclipse.tractusx.bpdm.common.dto.openapidescription.LegalEntityDescription + + +interface IBaseBusinessPartnerInputDto { + + @get:Schema(description = "ID the record has in the external system where the record originates from") + val externalId: String + + @get:Schema(description = "") + val nameParts: List + + @get:Schema(description = "Abbreviated name or shorthand") + val shortName: String? + + @get:ArraySchema(arraySchema = Schema(description = LegalEntityDescription.identifiers)) + val identifiers: Collection + + @get:Schema(description = "Technical key of the legal form") + val legalForm: String? + + @get:ArraySchema(arraySchema = Schema(description = LegalEntityDescription.states)) + val states: Collection + + @get:ArraySchema(arraySchema = Schema(description = LegalEntityDescription.classifications)) + val classifications: Collection + + @get:Schema(description = "Which roles this business partner takes in relation to the sharing member") + val roles: Collection + + @get:Schema(description = "") + val isOwner: Boolean + + @get:Schema(description = "Address of the official seat of this legal entity") + val postalAddress: BusinessPartnerPostalAddressDto + + +} + + 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 new file mode 100644 index 000000000..7773e6038 --- /dev/null +++ b/bpdm-gate-api/src/main/kotlin/org/eclipse/tractusx/bpdm/gate/api/model/request/BusinessPartnerInputRequest.kt @@ -0,0 +1,39 @@ +/******************************************************************************* + * 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.gate.api.model.request + +import io.swagger.v3.oas.annotations.media.Schema +import org.eclipse.tractusx.bpdm.common.dto.ClassificationDto +import org.eclipse.tractusx.bpdm.gate.api.model.* + + +@Schema(name = "BusinessPartnerInputDto", description = "Generic business partner with external id", requiredProperties = ["externalId", "postalAddress"]) +data class BusinessPartnerInputRequest( + override val externalId: String, + override val nameParts: List = emptyList(), + override val shortName: String?, + override val identifiers: Collection = emptyList(), + override val legalForm: String? = null, + override val states: Collection = emptyList(), + override val classifications: Collection = emptyList(), + override val roles: Collection = emptyList(), + override val postalAddress: BusinessPartnerPostalAddressDto, + override val isOwner: Boolean +) : IBaseBusinessPartnerInputDto \ No newline at end of file diff --git a/bpdm-gate-api/src/main/kotlin/org/eclipse/tractusx/bpdm/gate/api/model/response/BusinessPartnerInputResponseDto.kt b/bpdm-gate-api/src/main/kotlin/org/eclipse/tractusx/bpdm/gate/api/model/response/BusinessPartnerInputResponseDto.kt new file mode 100644 index 000000000..02636a631 --- /dev/null +++ b/bpdm-gate-api/src/main/kotlin/org/eclipse/tractusx/bpdm/gate/api/model/response/BusinessPartnerInputResponseDto.kt @@ -0,0 +1,47 @@ +/******************************************************************************* + * 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.gate.api.model.response + +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 +import org.eclipse.tractusx.bpdm.gate.api.model.* +import java.time.Instant + + +@Schema(description = "Generic business partner with external id", requiredProperties = ["externalId", "postalAddress"]) +data class BusinessPartnerInputResponseDto( + override val externalId: String, + override val nameParts: List = emptyList(), + override val shortName: String?, + override val identifiers: Collection = emptyList(), + override val legalForm: String? = null, + override val states: Collection = emptyList(), + override val classifications: Collection = emptyList(), + override val roles: Collection = emptyList(), + override val postalAddress: BusinessPartnerPostalAddressDto, + override val isOwner: Boolean, + + @get:Schema(description = CommonDescription.createdAt) + val createdAt: Instant, + + @get:Schema(description = CommonDescription.updatedAt) + val updatedAt: Instant, +) : IBaseBusinessPartnerInputDto \ No newline at end of file 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 new file mode 100644 index 000000000..07ec2c102 --- /dev/null +++ b/bpdm-gate/src/main/kotlin/org/eclipse/tractusx/bpdm/gate/controller/BusinessPartnerController.kt @@ -0,0 +1,42 @@ +/******************************************************************************* + * 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.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.gate.api.GateBusinessPartnerApi +import org.eclipse.tractusx.bpdm.gate.api.model.request.BusinessPartnerInputRequest +import org.eclipse.tractusx.bpdm.gate.api.model.response.BusinessPartnerInputResponseDto +import org.springframework.web.bind.annotation.RestController + +@RestController +class BusinessPartnerController() : GateBusinessPartnerApi { + + override fun upsertBusinessPartnersInput(businessPartners: Collection): Collection { + TODO("Not yet implemented") + } + + override fun getBusinessPartnersInputByExternalIds( + paginationRequest: PaginationRequest, + externalIds: Collection + ): PageDto { + TODO("Not yet implemented") + } +} \ No newline at end of file From e3e7a05429fe560ec3859b6cafc6bf3aae9e4e0a Mon Sep 17 00:00:00 2001 From: rschneider <97682836+rainer-exxcellent@users.noreply.github.com> Date: Tue, 5 Sep 2023 07:54:40 +0200 Subject: [PATCH 2/4] feat(generic bpm): #384 Gate API: Create input endpoints for generic business partners - Comments from the review incorporate --- .../openapidescription/CommonDescription.kt | 3 +++ .../LegalEntityDescription.kt | 2 +- .../bpdm/gate/api/GateBusinessPartnerApi.kt | 14 +++++++------- .../api/model/BusinessPartnerIdentifierDto.kt | 2 +- .../gate/api/model/BusinessPartnerStateDto.kt | 8 ++++---- .../api/model/IBaseBusinessPartnerInputDto.kt | 19 +++++++++---------- .../request/BusinessPartnerInputRequest.kt | 2 +- .../request/LegalEntityGateInputRequest.kt | 2 +- .../request/LegalEntityGateOutputRequest.kt | 2 +- ...ponseDto.kt => BusinessPartnerInputDto.kt} | 2 +- .../model/response/LegalEntityGateInputDto.kt | 2 +- .../response/LegalEntityGateOutputResponse.kt | 2 +- .../controller/BusinessPartnerController.kt | 6 +++--- 13 files changed, 34 insertions(+), 32 deletions(-) rename bpdm-gate-api/src/main/kotlin/org/eclipse/tractusx/bpdm/gate/api/model/response/{BusinessPartnerInputResponseDto.kt => BusinessPartnerInputDto.kt} (97%) diff --git a/bpdm-common/src/main/kotlin/org/eclipse/tractusx/bpdm/common/dto/openapidescription/CommonDescription.kt b/bpdm-common/src/main/kotlin/org/eclipse/tractusx/bpdm/common/dto/openapidescription/CommonDescription.kt index 7983245a4..f47d4bb3c 100644 --- a/bpdm-common/src/main/kotlin/org/eclipse/tractusx/bpdm/common/dto/openapidescription/CommonDescription.kt +++ b/bpdm-common/src/main/kotlin/org/eclipse/tractusx/bpdm/common/dto/openapidescription/CommonDescription.kt @@ -29,4 +29,7 @@ object CommonDescription { const val score = "Relative quality score of the match. The higher the better." const val externalId = "The identifier which uniquely identifies (in the internal system landscape of the sharing member) the business partner." + + const val roles = "Roles this business partner takes in relation to the sharing member." + } \ No newline at end of file diff --git a/bpdm-common/src/main/kotlin/org/eclipse/tractusx/bpdm/common/dto/openapidescription/LegalEntityDescription.kt b/bpdm-common/src/main/kotlin/org/eclipse/tractusx/bpdm/common/dto/openapidescription/LegalEntityDescription.kt index 80723ed77..3f963d78c 100644 --- a/bpdm-common/src/main/kotlin/org/eclipse/tractusx/bpdm/common/dto/openapidescription/LegalEntityDescription.kt +++ b/bpdm-common/src/main/kotlin/org/eclipse/tractusx/bpdm/common/dto/openapidescription/LegalEntityDescription.kt @@ -52,5 +52,5 @@ object LegalEntityDescription { const val states = "The list of (temporary) states of the legal entity." const val classifications = "The list of classifications of the legal entity, such as a specific industry." const val relations = "Relations to other business partners." - const val roles = "Roles this business partner takes in relation to the sharing member." + } 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 e00b63895..c51801b67 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 @@ -27,7 +27,7 @@ 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.gate.api.model.request.BusinessPartnerInputRequest -import org.eclipse.tractusx.bpdm.gate.api.model.response.BusinessPartnerInputResponseDto +import org.eclipse.tractusx.bpdm.gate.api.model.response.BusinessPartnerInputDto import org.springdoc.core.annotations.ParameterObject import org.springframework.http.MediaType import org.springframework.web.bind.annotation.PostMapping @@ -45,8 +45,8 @@ interface GateBusinessPartnerApi { @Operation( summary = "Create or update business partner with given external ID", description = "Create or update generic business partner. " + - "Updates instead of creating a new business partner if an already existing external id is used. " + - "The same external id may not occur more than once in a single request. " + + "Updates instead of creating a new business partner if an already existing external ID is used. " + + "The same external ID may not occur more than once in a single request. " + "For a single request, the maximum number of business partners in the request is limited to \${bpdm.api.upsert-limit} entries." ) @ApiResponses( @@ -57,15 +57,15 @@ interface GateBusinessPartnerApi { ) @PutMapping("/input/business-partners") @PutExchange("/input/business-partners") - fun upsertBusinessPartnersInput(@RequestBody businessPartners: Collection): Collection + fun upsertBusinessPartnersInput(@RequestBody businessPartners: Collection): Collection @Operation( summary = "Search business partner by external ID. An empty external ID list returns a paginated list of all business partners.", - description = "Get page of business partners filtered by a collection of externalIds." + description = "Get page of business partners filtered by a collection of external IDs." ) @ApiResponses( value = [ - ApiResponse(responseCode = "200", description = "The requested page of busines partners"), + ApiResponse(responseCode = "200", description = "The requested page of business partners"), ApiResponse(responseCode = "400", description = "On malformed pagination request", content = [Content()]), ] ) @@ -74,6 +74,6 @@ interface GateBusinessPartnerApi { fun getBusinessPartnersInputByExternalIds( @ParameterObject @Valid paginationRequest: PaginationRequest, @RequestBody externalIds: Collection - ): PageDto + ): PageDto } \ No newline at end of file diff --git a/bpdm-gate-api/src/main/kotlin/org/eclipse/tractusx/bpdm/gate/api/model/BusinessPartnerIdentifierDto.kt b/bpdm-gate-api/src/main/kotlin/org/eclipse/tractusx/bpdm/gate/api/model/BusinessPartnerIdentifierDto.kt index 813fcf2f4..f28a3c4e6 100644 --- a/bpdm-gate-api/src/main/kotlin/org/eclipse/tractusx/bpdm/gate/api/model/BusinessPartnerIdentifierDto.kt +++ b/bpdm-gate-api/src/main/kotlin/org/eclipse/tractusx/bpdm/gate/api/model/BusinessPartnerIdentifierDto.kt @@ -25,7 +25,7 @@ import io.swagger.v3.oas.annotations.media.Schema data class BusinessPartnerIdentifierDto( @get:Schema(description = "Value of the identifier") - val value: String, + val value: String?, @get:Schema(description = "Technical key of the type to which this identifier belongs to") val type: String, diff --git a/bpdm-gate-api/src/main/kotlin/org/eclipse/tractusx/bpdm/gate/api/model/BusinessPartnerStateDto.kt b/bpdm-gate-api/src/main/kotlin/org/eclipse/tractusx/bpdm/gate/api/model/BusinessPartnerStateDto.kt index aa3e8ccb6..633d4ba6d 100644 --- a/bpdm-gate-api/src/main/kotlin/org/eclipse/tractusx/bpdm/gate/api/model/BusinessPartnerStateDto.kt +++ b/bpdm-gate-api/src/main/kotlin/org/eclipse/tractusx/bpdm/gate/api/model/BusinessPartnerStateDto.kt @@ -27,15 +27,15 @@ import java.time.LocalDateTime @Schema(description = LegalEntityStateDescription.header, requiredProperties = ["type"]) data class BusinessPartnerStateDto( - @get:Schema(description = "Exact, official denotation of the status") + @get:Schema(description = "Denotation of the status.") val description: String?, - @get:Schema(description = "Date since when the status is/was valid") + @get:Schema(description = "Date since when the status is/was valid.") val validFrom: LocalDateTime?, - @get:Schema(description = "Date until the status was valid, if applicable") + @get:Schema(description = "Date until the status was valid, if applicable.") val validTo: LocalDateTime?, - @get:Schema(description = "The type of this specified status") + @get:Schema(description = "The type of this specified status.") val type: BusinessStateType ) diff --git a/bpdm-gate-api/src/main/kotlin/org/eclipse/tractusx/bpdm/gate/api/model/IBaseBusinessPartnerInputDto.kt b/bpdm-gate-api/src/main/kotlin/org/eclipse/tractusx/bpdm/gate/api/model/IBaseBusinessPartnerInputDto.kt index 04e23fa12..bcb049b5e 100644 --- a/bpdm-gate-api/src/main/kotlin/org/eclipse/tractusx/bpdm/gate/api/model/IBaseBusinessPartnerInputDto.kt +++ b/bpdm-gate-api/src/main/kotlin/org/eclipse/tractusx/bpdm/gate/api/model/IBaseBusinessPartnerInputDto.kt @@ -22,12 +22,11 @@ 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.ClassificationDto -import org.eclipse.tractusx.bpdm.common.dto.openapidescription.LegalEntityDescription - +import org.eclipse.tractusx.bpdm.common.dto.openapidescription.CommonDescription interface IBaseBusinessPartnerInputDto { - @get:Schema(description = "ID the record has in the external system where the record originates from") + @get:Schema(description = CommonDescription.externalId) val externalId: String @get:Schema(description = "") @@ -36,25 +35,25 @@ interface IBaseBusinessPartnerInputDto { @get:Schema(description = "Abbreviated name or shorthand") val shortName: String? - @get:ArraySchema(arraySchema = Schema(description = LegalEntityDescription.identifiers)) + @get:ArraySchema(arraySchema = Schema(description = "The list of identifiers of the business partner.")) val identifiers: Collection - @get:Schema(description = "Technical key of the legal form") + @get:Schema(description = "Technical key of the legal form.") val legalForm: String? - @get:ArraySchema(arraySchema = Schema(description = LegalEntityDescription.states)) + @get:ArraySchema(arraySchema = Schema(description = "The list of (temporary) states of the business partner.")) val states: Collection - @get:ArraySchema(arraySchema = Schema(description = LegalEntityDescription.classifications)) + @get:ArraySchema(arraySchema = Schema(description = "The list of classifications of the legal entity, such as a specific industry.")) val classifications: Collection - @get:Schema(description = "Which roles this business partner takes in relation to the sharing member") + @get:ArraySchema(arraySchema = Schema(description = CommonDescription.roles)) val roles: Collection - @get:Schema(description = "") + @get:Schema(name = "isOwner", description = "True if the sharing member declares itself as the owner of the business partner.") val isOwner: Boolean - @get:Schema(description = "Address of the official seat of this legal entity") + @get:Schema(description = "Address of the official seat of this business partner.") val postalAddress: BusinessPartnerPostalAddressDto 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 7773e6038..ffce80258 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 @@ -24,7 +24,7 @@ import org.eclipse.tractusx.bpdm.common.dto.ClassificationDto import org.eclipse.tractusx.bpdm.gate.api.model.* -@Schema(name = "BusinessPartnerInputDto", description = "Generic business partner with external id", requiredProperties = ["externalId", "postalAddress"]) +@Schema(description = "Generic business partner with external id", requiredProperties = ["externalId", "postalAddress"]) data class BusinessPartnerInputRequest( override val externalId: String, override val nameParts: List = emptyList(), 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 af6a1d4ba..1fb152a48 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 @@ -40,7 +40,7 @@ data class LegalEntityGateInputRequest( @field:JsonUnwrapped val legalEntity: LegalEntityDto, - @get:ArraySchema(arraySchema = Schema(description = LegalEntityDescription.roles)) + @get:ArraySchema(arraySchema = Schema(description = CommonDescription.roles)) val roles: Collection = emptyList(), // TODO OpenAPI description for complex field does not work!! 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 01fd844eb..69fdb4804 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 @@ -40,7 +40,7 @@ data class LegalEntityGateOutputRequest( @field:JsonUnwrapped val legalEntity: LegalEntityDto, - @get:ArraySchema(arraySchema = Schema(description = LegalEntityDescription.roles)) + @get:ArraySchema(arraySchema = Schema(description = CommonDescription.roles)) val roles: Collection = emptyList(), // TODO OpenAPI description for complex field does not work!! diff --git a/bpdm-gate-api/src/main/kotlin/org/eclipse/tractusx/bpdm/gate/api/model/response/BusinessPartnerInputResponseDto.kt b/bpdm-gate-api/src/main/kotlin/org/eclipse/tractusx/bpdm/gate/api/model/response/BusinessPartnerInputDto.kt similarity index 97% rename from bpdm-gate-api/src/main/kotlin/org/eclipse/tractusx/bpdm/gate/api/model/response/BusinessPartnerInputResponseDto.kt rename to bpdm-gate-api/src/main/kotlin/org/eclipse/tractusx/bpdm/gate/api/model/response/BusinessPartnerInputDto.kt index 02636a631..c61959cc8 100644 --- a/bpdm-gate-api/src/main/kotlin/org/eclipse/tractusx/bpdm/gate/api/model/response/BusinessPartnerInputResponseDto.kt +++ b/bpdm-gate-api/src/main/kotlin/org/eclipse/tractusx/bpdm/gate/api/model/response/BusinessPartnerInputDto.kt @@ -27,7 +27,7 @@ import java.time.Instant @Schema(description = "Generic business partner with external id", requiredProperties = ["externalId", "postalAddress"]) -data class BusinessPartnerInputResponseDto( +data class BusinessPartnerInputDto( override val externalId: String, override val nameParts: List = emptyList(), override val shortName: String?, 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 619bc87d4..0fab63791 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 @@ -40,7 +40,7 @@ data class LegalEntityGateInputDto( @field:JsonUnwrapped val legalEntity: LegalEntityDto, - @get:ArraySchema(arraySchema = Schema(description = LegalEntityDescription.roles)) + @get:ArraySchema(arraySchema = Schema(description = CommonDescription.roles)) val roles: Collection = emptyList(), // TODO OpenAPI description for complex field does not work!! 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 516875136..01a6d7e32 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 @@ -39,7 +39,7 @@ data class LegalEntityGateOutputResponse( @field:JsonUnwrapped val legalEntity: LegalEntityDto, - @get:ArraySchema(arraySchema = Schema(description = LegalEntityDescription.roles)) + @get:ArraySchema(arraySchema = Schema(description = CommonDescription.roles)) val roles: Collection = emptyList(), // TODO OpenAPI description for complex field does not work!! 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 07ec2c102..ba3cbb89c 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 @@ -23,20 +23,20 @@ import org.eclipse.tractusx.bpdm.common.dto.request.PaginationRequest import org.eclipse.tractusx.bpdm.common.dto.response.PageDto import org.eclipse.tractusx.bpdm.gate.api.GateBusinessPartnerApi import org.eclipse.tractusx.bpdm.gate.api.model.request.BusinessPartnerInputRequest -import org.eclipse.tractusx.bpdm.gate.api.model.response.BusinessPartnerInputResponseDto +import org.eclipse.tractusx.bpdm.gate.api.model.response.BusinessPartnerInputDto import org.springframework.web.bind.annotation.RestController @RestController class BusinessPartnerController() : GateBusinessPartnerApi { - override fun upsertBusinessPartnersInput(businessPartners: Collection): Collection { + override fun upsertBusinessPartnersInput(businessPartners: Collection): Collection { TODO("Not yet implemented") } override fun getBusinessPartnersInputByExternalIds( paginationRequest: PaginationRequest, externalIds: Collection - ): PageDto { + ): PageDto { TODO("Not yet implemented") } } \ No newline at end of file From ce31453d820f64f5d27a12f4a552d5f7f2a28c36 Mon Sep 17 00:00:00 2001 From: rschneider <97682836+rainer-exxcellent@users.noreply.github.com> Date: Thu, 7 Sep 2023 14:42:43 +0200 Subject: [PATCH 3/4] feat(generic bpm): #387 Gate API: Create input endpoints for generic business partners - add enum for AddressType --- .../bpdm/gate/api/model/AddressType.kt | 28 +++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 bpdm-gate-api/src/main/kotlin/org/eclipse/tractusx/bpdm/gate/api/model/AddressType.kt diff --git a/bpdm-gate-api/src/main/kotlin/org/eclipse/tractusx/bpdm/gate/api/model/AddressType.kt b/bpdm-gate-api/src/main/kotlin/org/eclipse/tractusx/bpdm/gate/api/model/AddressType.kt new file mode 100644 index 000000000..1299b5310 --- /dev/null +++ b/bpdm-gate-api/src/main/kotlin/org/eclipse/tractusx/bpdm/gate/api/model/AddressType.kt @@ -0,0 +1,28 @@ +/******************************************************************************* + * 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.gate.api.model + +enum class AddressType { + + LegalAndSiteMainAddress, + LegalAddress, + SiteMainAddress, + AdditionalAddress +} \ No newline at end of file From 73f89b24937377f319dd95dc98d101dba30d38ad Mon Sep 17 00:00:00 2001 From: rschneider <97682836+rainer-exxcellent@users.noreply.github.com> Date: Thu, 7 Sep 2023 16:11:03 +0200 Subject: [PATCH 4/4] feat(generic bpm): #387 Gate API: Create input endpoints for generic business partners - add enum AddressType to open api --- ...> BusinessPartnerPostalAddressInputDto.kt} | 12 ++++----- .../api/model/IBaseBusinessPartnerInputDto.kt | 2 +- .../BusinessPartnerAddressDescription.kt | 25 +++++++++++++++++++ .../request/BusinessPartnerInputRequest.kt | 2 +- .../model/response/BusinessPartnerInputDto.kt | 2 +- 5 files changed, 33 insertions(+), 10 deletions(-) rename bpdm-gate-api/src/main/kotlin/org/eclipse/tractusx/bpdm/gate/api/model/{BusinessPartnerPostalAddressDto.kt => BusinessPartnerPostalAddressInputDto.kt} (78%) create mode 100644 bpdm-gate-api/src/main/kotlin/org/eclipse/tractusx/bpdm/gate/api/model/openapidescription/BusinessPartnerAddressDescription.kt 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/BusinessPartnerPostalAddressInputDto.kt similarity index 78% rename from bpdm-gate-api/src/main/kotlin/org/eclipse/tractusx/bpdm/gate/api/model/BusinessPartnerPostalAddressDto.kt rename to bpdm-gate-api/src/main/kotlin/org/eclipse/tractusx/bpdm/gate/api/model/BusinessPartnerPostalAddressInputDto.kt index 7302ab6cc..b4d80b583 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/BusinessPartnerPostalAddressInputDto.kt @@ -22,15 +22,13 @@ package org.eclipse.tractusx.bpdm.gate.api.model import io.swagger.v3.oas.annotations.media.Schema 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 -@Schema(description = "Postal address of a business partner", requiredProperties = ["physicalPostalAddress"]) -data class BusinessPartnerPostalAddressDto( +@Schema(description = "Postal address of a input business partner", requiredProperties = ["physicalPostalAddress"]) +data class BusinessPartnerPostalAddressInputDto( - @get:Schema(name = "isLegalAddress", description = LogisticAddressDescription.isLegalAddress) - val isLegalAddress: Boolean = false, - - @get:Schema(name = "isSiteMainAddress", description = LogisticAddressDescription.isMainAddress) - val isSiteMainAddress: Boolean = false, + @get:Schema( description = BusinessPartnerAddressDescription.addressType) + val addressType: AddressType?, // TODO OpenAPI description for complex field does not work!! @get:Schema(description = LogisticAddressDescription.physicalPostalAddress) diff --git a/bpdm-gate-api/src/main/kotlin/org/eclipse/tractusx/bpdm/gate/api/model/IBaseBusinessPartnerInputDto.kt b/bpdm-gate-api/src/main/kotlin/org/eclipse/tractusx/bpdm/gate/api/model/IBaseBusinessPartnerInputDto.kt index bcb049b5e..d825fe9c5 100644 --- a/bpdm-gate-api/src/main/kotlin/org/eclipse/tractusx/bpdm/gate/api/model/IBaseBusinessPartnerInputDto.kt +++ b/bpdm-gate-api/src/main/kotlin/org/eclipse/tractusx/bpdm/gate/api/model/IBaseBusinessPartnerInputDto.kt @@ -54,7 +54,7 @@ interface IBaseBusinessPartnerInputDto { val isOwner: Boolean @get:Schema(description = "Address of the official seat of this business partner.") - val postalAddress: BusinessPartnerPostalAddressDto + val postalAddress: BusinessPartnerPostalAddressInputDto } 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/openapidescription/BusinessPartnerAddressDescription.kt new file mode 100644 index 000000000..0523612de --- /dev/null +++ b/bpdm-gate-api/src/main/kotlin/org/eclipse/tractusx/bpdm/gate/api/model/openapidescription/BusinessPartnerAddressDescription.kt @@ -0,0 +1,25 @@ +/******************************************************************************* + * 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.gate.api.model.openapidescription + +object BusinessPartnerAddressDescription { + + const val addressType = "Type of the address" +} \ No newline at end of file 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 ffce80258..270d4c0a0 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 @@ -34,6 +34,6 @@ data class BusinessPartnerInputRequest( override val states: Collection = emptyList(), override val classifications: Collection = emptyList(), override val roles: Collection = emptyList(), - override val postalAddress: BusinessPartnerPostalAddressDto, + override val postalAddress: BusinessPartnerPostalAddressInputDto, override val isOwner: Boolean ) : IBaseBusinessPartnerInputDto \ No newline at end of file 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 c61959cc8..850fa1349 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 @@ -36,7 +36,7 @@ data class BusinessPartnerInputDto( override val states: Collection = emptyList(), override val classifications: Collection = emptyList(), override val roles: Collection = emptyList(), - override val postalAddress: BusinessPartnerPostalAddressDto, + override val postalAddress: BusinessPartnerPostalAddressInputDto, override val isOwner: Boolean, @get:Schema(description = CommonDescription.createdAt)