Skip to content

Commit

Permalink
feat(generic bpm): eclipse-tractusx#387 Gate API: Create input endpoi…
Browse files Browse the repository at this point in the history
…nts for generic business partners

- add enum AddressType to open api
  • Loading branch information
rainer-exxcellent committed Sep 7, 2023
1 parent e773e01 commit f66c16d
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
Original file line number Diff line number Diff line change
@@ -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"
}
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ data class BusinessPartnerInputDto(
override val states: Collection<BusinessPartnerStateDto> = emptyList(),
override val classifications: Collection<ClassificationDto> = emptyList(),
override val roles: Collection<BusinessPartnerRole> = emptyList(),
override val postalAddress: BusinessPartnerPostalAddressDto,
override val postalAddress: BusinessPartnerPostalAddressInputDto,
override val isOwner: Boolean,

@get:Schema(description = CommonDescription.createdAt)
Expand Down

0 comments on commit f66c16d

Please sign in to comment.