Skip to content

Commit

Permalink
Merge pull request #314 from catenax-ng/feat/api-model_rename_dtos_step1
Browse files Browse the repository at this point in the history
Feat/api model rename dtos step1
  • Loading branch information
nicoprow authored Jun 29, 2023
2 parents b3a1f0e + 2dcda9f commit 4bbada1
Show file tree
Hide file tree
Showing 109 changed files with 502 additions and 905 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
package com.catenax.bpdm.bridge.dummy.dto

import org.eclipse.tractusx.bpdm.common.dto.LegalEntityDto
import org.eclipse.tractusx.bpdm.gate.api.model.AddressGateInputResponse
import org.eclipse.tractusx.bpdm.gate.api.model.response.AddressGateInputResponse

data class GateLegalEntityInfo(
val legalNameParts: List<String> = emptyList(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@ import com.catenax.bpdm.bridge.dummy.dto.GateSiteInfo
import mu.KotlinLogging
import org.eclipse.tractusx.bpdm.common.dto.request.PaginationRequest
import org.eclipse.tractusx.bpdm.gate.api.client.GateClient
import org.eclipse.tractusx.bpdm.gate.api.model.*
import org.eclipse.tractusx.bpdm.gate.api.model.LsaType
import org.eclipse.tractusx.bpdm.gate.api.model.request.ChangeLogSearchRequest
import org.eclipse.tractusx.bpdm.gate.api.model.response.ChangelogResponse
import org.eclipse.tractusx.bpdm.gate.api.model.response.*
import org.springframework.stereotype.Service
import java.time.Instant

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ import mu.KotlinLogging
import org.eclipse.tractusx.bpdm.gate.api.client.GateClient
import org.eclipse.tractusx.bpdm.gate.api.exception.BusinessPartnerSharingError
import org.eclipse.tractusx.bpdm.gate.api.model.LsaType
import org.eclipse.tractusx.bpdm.gate.api.model.SharingStateDto
import org.eclipse.tractusx.bpdm.gate.api.model.SharingStateType
import org.eclipse.tractusx.bpdm.gate.api.model.response.SharingStateDto
import org.eclipse.tractusx.bpdm.pool.api.model.response.*
import org.springframework.stereotype.Service
import java.time.LocalDateTime
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,12 @@
package com.catenax.bpdm.bridge.dummy.util


import com.catenax.bpdm.bridge.dummy.util.PostgreSQLContextInitializer.Companion.postgreSQLContainer
import com.github.dockerjava.api.model.Ulimit
import org.springframework.boot.test.util.TestPropertyValues
import org.springframework.context.ApplicationContextInitializer
import org.springframework.context.ConfigurableApplicationContext
import org.testcontainers.containers.GenericContainer
import org.testcontainers.containers.wait.strategy.HttpWaitStrategy
import org.testcontainers.lifecycle.Startable

/**
* When used on a spring boot test, starts a singleton opensearch container that is shared between all integration tests.
Expand All @@ -53,8 +51,6 @@ class OpenSearchContextInitializer : ApplicationContextInitializer<ConfigurableA
.withCreateContainerCmdModifier { cmd ->
cmd.hostConfig!!.withUlimits(arrayOf(Ulimit("nofile", 65536L, 65536L), Ulimit("memlock", -1L, -1L)))
}
.withNetwork(postgreSQLContainer.getNetwork())
.dependsOn(listOf<Startable>(postgreSQLContainer))
}

override fun initialize(applicationContext: ConfigurableApplicationContext) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ package org.eclipse.tractusx.bpdm.common.dto
import io.swagger.v3.oas.annotations.media.Schema

@Schema(name = "NameRegioncodeDto", description = "Region within a country")
data class NameRegioncodeDto(
data class NameRegioncodeVerboseDto(

@get:Schema(description = "Describes the full name of the region within a country according to ISO 3166-214")
val name: String,

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,9 @@ package org.eclipse.tractusx.bpdm.common.dto.response
import io.swagger.v3.oas.annotations.media.Schema
import org.eclipse.tractusx.bpdm.common.dto.response.type.TypeKeyNameDto

@Schema(name = "IdentifierResponse", description = "Identifier record of a logistic address")
data class AddressIdentifierResponse(
@Schema(name = "AddressIdentifierVerboseDto", description = "Identifier record of a logistic address")
data class AddressIdentifierVerboseDto(

@get:Schema(description = "Value of the identifier")
val value: String,

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,9 @@ import org.eclipse.tractusx.bpdm.common.dto.response.type.TypeKeyNameDto
import org.eclipse.tractusx.bpdm.common.model.BusinessStateType
import java.time.LocalDateTime

@Schema(name = "AddressStateResponse", description = "Status record of a legal entity")
data class AddressStateResponse(
@Schema(name = "AddressStateVerboseDto", description = "Status record of a legal entity")
data class AddressStateVerboseDto(

@get:Schema(description = "Exact, official denotation of the status")
val description: String?,

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,14 @@ import org.eclipse.tractusx.bpdm.common.model.DeliveryServiceType
import org.eclipse.tractusx.bpdm.common.service.DataClassUnwrappedJsonDeserializer

@JsonDeserialize(using = DataClassUnwrappedJsonDeserializer::class)
@Schema(name = "AlternativePostalAddress", description = "Alternative Postal Address Part")
data class AlternativePostalAddressResponse(
@Schema(name = "AlternativePostalAddressVerboseDto", description = "Alternative Postal Address Part")
data class AlternativePostalAddressVerboseDto(

@field:JsonUnwrapped
val baseAddress: BasePostalAddressResponse,
val baseAddress: BasePostalAddressVerboseDto,

@field:JsonUnwrapped
val areaPart: AreaDistrictAlternativResponse,
val areaPart: AreaDistrictAlternativVerboseDto,

@get:Schema(description = "Describes the PO Box or private Bag number the delivery should be placed at.")
val deliveryServiceNumber: String = "",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@
package org.eclipse.tractusx.bpdm.common.dto.response

import io.swagger.v3.oas.annotations.media.Schema
import org.eclipse.tractusx.bpdm.common.dto.NameRegioncodeDto
import org.eclipse.tractusx.bpdm.common.dto.NameRegioncodeVerboseDto

@Schema(name = "AreaDistrictDto", description = "Record for administrativeAreaLevel and district part of an alternativ address")
data class AreaDistrictAlternativResponse(
@Schema(name = "AreaDistrictAlternativVerboseDto", description = "Record for administrativeAreaLevel and district part of an alternativ address")
data class AreaDistrictAlternativVerboseDto(

@get:Schema(description = "Region within the country")
val administrativeAreaLevel1: NameRegioncodeDto? = null,
val administrativeAreaLevel1: NameRegioncodeVerboseDto? = null,
)
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,13 @@
package org.eclipse.tractusx.bpdm.common.dto.response

import io.swagger.v3.oas.annotations.media.Schema
import org.eclipse.tractusx.bpdm.common.dto.NameRegioncodeDto
import org.eclipse.tractusx.bpdm.common.dto.NameRegioncodeVerboseDto

@Schema(name = "AreaDistrictDto", description = "Record for administrativeAreaLevel and district part of an address")
data class AreaDistrictResponse(
@Schema(name = "AreaDistrictVerboseDto", description = "Record for administrativeAreaLevel and district part of an address")
data class AreaDistrictVerboseDto(

@get:Schema(description = "Region within the country")
val administrativeAreaLevel1: NameRegioncodeDto? = null,
val administrativeAreaLevel1: NameRegioncodeVerboseDto? = null,

@get:Schema(description = "Further possibility to describe the region/address(e.g. County/Landkreis)")
val administrativeAreaLevel2: String? = null,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ import io.swagger.v3.oas.annotations.media.Schema
import org.eclipse.tractusx.bpdm.common.dto.GeoCoordinateDto
import org.eclipse.tractusx.bpdm.common.dto.response.type.TypeKeyNameDto

@Schema(name = "PostalAddressResponse", description = "Address record of a business partner")
data class BasePostalAddressResponse(
@Schema(name = "BasePostalAddressVerboseDto", description = "Address record of a business partner")
data class BasePostalAddressVerboseDto(

@get:Schema(description = "Geographic coordinates to find this location")
val geographicCoordinates: GeoCoordinateDto? = null,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,9 @@ import io.swagger.v3.oas.annotations.media.Schema
import org.eclipse.tractusx.bpdm.common.dto.response.type.TypeKeyNameDto
import org.eclipse.tractusx.bpdm.common.model.ClassificationType

@Schema(name = "ClassificationResponse", description = "Classification record of a business partner")
data class ClassificationResponse(
@Schema(name = "ClassificationVerboseDto", description = "Classification record of a business partner")
data class ClassificationVerboseDto(

@get:Schema(description = "Name of the classification")
val value: String? = null,

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,9 @@ package org.eclipse.tractusx.bpdm.common.dto.response
import io.swagger.v3.oas.annotations.media.Schema
import org.eclipse.tractusx.bpdm.common.dto.response.type.TypeKeyNameDto

@Schema(name = "LegalEntityIdentifierResponse", description = "Identifier record of a legal entity")
data class LegalEntityIdentifierResponse(
@Schema(name = "LegalEntityIdentifierVerboseDto", description = "Identifier record of a legal entity")
data class LegalEntityIdentifierVerboseDto(

@get:Schema(description = "Value of the identifier")
val value: String,

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,9 @@ import org.eclipse.tractusx.bpdm.common.dto.response.type.TypeKeyNameDto
import org.eclipse.tractusx.bpdm.common.model.BusinessStateType
import java.time.LocalDateTime

@Schema(name = "LegalEntityStateResponse", description = "Status record of a legal entity")
data class LegalEntityStateResponse(
@Schema(name = "LegalEntityStateVerboseDto", description = "Status record of a legal entity")
data class LegalEntityStateVerboseDto(

@get:Schema(description = "Exact, official denotation of the status")
val officialDenotation: String?,

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,28 +24,29 @@ import io.swagger.v3.oas.annotations.media.Schema
import java.time.Instant


@Schema(name = "LegalEntityResponse", description = "Legal entity record")
data class LegalEntityResponse(
@Schema(name = "LegalEntityVerboseDto", description = "Legal entity record")
data class LegalEntityVerboseDto(

@get:Schema(description = "Business Partner Number of this legal entity")
val bpnl: String,

@ArraySchema(arraySchema = Schema(description = "All identifiers of the business partner, including BPN information"))
val identifiers: Collection<LegalEntityIdentifierResponse> = emptyList(),
val identifiers: Collection<LegalEntityIdentifierVerboseDto> = emptyList(),

@get:Schema(description = "Abbreviated name or shorthand")
val legalShortName: String? = null,

@get:Schema(description = "Legal form of the business partner")
val legalForm: LegalFormResponse? = null,
val legalForm: LegalFormDto? = null,

@ArraySchema(arraySchema = Schema(description = "Business status"))
val states: Collection<LegalEntityStateResponse> = emptyList(),
val states: Collection<LegalEntityStateVerboseDto> = emptyList(),

@ArraySchema(arraySchema = Schema(description = "Classifications"))
val classifications: Collection<ClassificationResponse> = emptyList(),
val classifications: Collection<ClassificationVerboseDto> = emptyList(),

@ArraySchema(arraySchema = Schema(description = "Relations to other business partners"))
val relations: Collection<RelationResponse> = emptyList(),
val relations: Collection<RelationVerboseDto> = emptyList(),

@get:Schema(description = "The timestamp the business partner data was last indicated to be still current")
val currentness: Instant,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,9 @@ package org.eclipse.tractusx.bpdm.common.dto.response

import io.swagger.v3.oas.annotations.media.Schema

@Schema(name = "LegalFormResponse", description = "Legal form a business partner can have")
data class LegalFormResponse(
@Schema(name = "LegalFormDto", description = "Legal form a business partner can have")
data class LegalFormDto(

@get:Schema(description = "Unique key to be used for reference")
val technicalKey: String,

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,16 +37,16 @@ data class LogisticAddressResponse(
val name: String? = null,

@ArraySchema(arraySchema = Schema(description = "Address status"))
val states: Collection<AddressStateResponse> = emptyList(),
val states: Collection<AddressStateVerboseDto> = emptyList(),

@ArraySchema(arraySchema = Schema(description = "All identifiers of the Address"))
val identifiers: Collection<AddressIdentifierResponse> = emptyList(),
val identifiers: Collection<AddressIdentifierVerboseDto> = emptyList(),

@get:Schema(description = "Physical postal address")
val physicalPostalAddress: PhysicalPostalAddressResponse,
val physicalPostalAddress: PhysicalPostalAddressVerboseDto,

@get:Schema(description = "Alternative postal address")
val alternativePostalAddress: AlternativePostalAddressResponse? = null,
val alternativePostalAddress: AlternativePostalAddressVerboseDto? = null,

@get:Schema(description = "BPN of the related legal entity, if available")
val bpnLegalEntity: String?,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,19 @@ import io.swagger.v3.oas.annotations.media.Schema

@Schema(description = "Paginated collection of results")
data class PageResponse<T>(

@get:Schema(description = "Total number of all results in all pages")
val totalElements: Long,

@get:Schema(description = "Total number pages")
val totalPages: Int,

@get:Schema(description = "Current page number")
val page: Int,

@get:Schema(description = "Number of results in the page")
val contentSize: Int,

@get:Schema(description = "Collection of results in the page")
val content: Collection<T>
)
Original file line number Diff line number Diff line change
Expand Up @@ -27,17 +27,17 @@ import org.eclipse.tractusx.bpdm.common.dto.StreetDto
import org.eclipse.tractusx.bpdm.common.service.DataClassUnwrappedJsonDeserializer

@JsonDeserialize(using = DataClassUnwrappedJsonDeserializer::class)
@Schema(name = "PhysicalPostalAddress", description = "Physical Postal Address Part")
data class PhysicalPostalAddressResponse(
@Schema(name = "PhysicalPostalAddressVerboseDto", description = "Physical Postal Address Part")
data class PhysicalPostalAddressVerboseDto(

@field:JsonUnwrapped
val baseAddress: BasePostalAddressResponse,
val baseAddress: BasePostalAddressVerboseDto,

@get:Schema(description = "Street")
val street: StreetDto? = null,

@field:JsonUnwrapped
val areaPart: AreaDistrictResponse,
val areaPart: AreaDistrictVerboseDto,

@field:JsonUnwrapped
val basePhysicalAddress: BasePhysicalAddressDto
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,14 @@ import io.swagger.v3.oas.annotations.media.Schema
import org.eclipse.tractusx.bpdm.common.service.DataClassUnwrappedJsonDeserializer

@JsonDeserialize(using = DataClassUnwrappedJsonDeserializer::class)
@Schema(name = "PoolLegalEntityResponse", description = "Legal entity record")
data class PoolLegalEntityResponse(
@Schema(name = "PoolLegalEntityVerboseDto", description = "Legal entity record")
data class PoolLegalEntityVerboseDto(

@get:Schema(description = "Legal name the partner goes by")
val legalName: String,

@field:JsonUnwrapped
val legalEntity: LegalEntityResponse,
val legalEntity: LegalEntityVerboseDto,

@get:Schema(description = "Address of the official seat of this legal entity")
val legalAddress: LogisticAddressResponse,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,9 @@ import org.eclipse.tractusx.bpdm.common.dto.response.type.TypeKeyNameDto
import org.eclipse.tractusx.bpdm.common.model.RelationType
import java.time.LocalDateTime

@Schema(name = "RelationResponse", description = "Directed relation between two business partners")
data class RelationResponse(
@Schema(name = "RelationVerboseDto", description = "Directed relation between two business partners")
data class RelationVerboseDto(

@get:Schema(description = "Type of relation like predecessor or ownership relation")
val type: TypeKeyNameDto<RelationType>,

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,9 @@ import org.eclipse.tractusx.bpdm.common.dto.response.type.TypeKeyNameDto
import org.eclipse.tractusx.bpdm.common.model.BusinessStateType
import java.time.LocalDateTime

@Schema(name = "SiteStateResponse", description = "Status record of a site")
data class SiteStateResponse(
@Schema(name = "SiteStateVerboseDto", description = "Status record of a site")
data class SiteStateVerboseDto(

@get:Schema(description = "Description of the status")
val description: String?,

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,16 +23,17 @@ import io.swagger.v3.oas.annotations.media.ArraySchema
import io.swagger.v3.oas.annotations.media.Schema
import java.time.Instant

@Schema(name = "SiteResponse", description = "Site of a legal entity")
data class SiteResponse(
@Schema(name = "SiteVerboseDto", description = "Site of a legal entity")
data class SiteVerboseDto(

@get:Schema(description = "Business Partner Number, main identifier value for sites")
val bpns: String,

@get:Schema(description = "Site name")
val name: String,

@ArraySchema(arraySchema = Schema(description = "Business status"))
val states: Collection<SiteStateResponse> = emptyList(),
val states: Collection<SiteStateVerboseDto> = emptyList(),

@get:Schema(description = "Business Partner Number of the related legal entity")
val bpnLegalEntity: String,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@ 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.PageResponse
import org.eclipse.tractusx.bpdm.gate.api.model.AddressGateInputRequest
import org.eclipse.tractusx.bpdm.gate.api.model.AddressGateInputResponse
import org.eclipse.tractusx.bpdm.gate.api.model.AddressGateOutputRequest
import org.eclipse.tractusx.bpdm.gate.api.model.AddressGateOutputResponse
import org.eclipse.tractusx.bpdm.gate.api.model.request.AddressGateInputRequest
import org.eclipse.tractusx.bpdm.gate.api.model.request.AddressGateOutputRequest
import org.eclipse.tractusx.bpdm.gate.api.model.response.AddressGateInputResponse
import org.eclipse.tractusx.bpdm.gate.api.model.response.AddressGateOutputResponse
import org.springdoc.core.annotations.ParameterObject
import org.springframework.http.MediaType
import org.springframework.http.ResponseEntity
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@ 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.PageResponse
import org.eclipse.tractusx.bpdm.gate.api.model.LegalEntityGateInputRequest
import org.eclipse.tractusx.bpdm.gate.api.model.LegalEntityGateInputResponse
import org.eclipse.tractusx.bpdm.gate.api.model.LegalEntityGateOutputRequest
import org.eclipse.tractusx.bpdm.gate.api.model.LegalEntityGateOutputResponse
import org.eclipse.tractusx.bpdm.gate.api.model.request.LegalEntityGateInputRequest
import org.eclipse.tractusx.bpdm.gate.api.model.request.LegalEntityGateOutputRequest
import org.eclipse.tractusx.bpdm.gate.api.model.response.LegalEntityGateInputResponse
import org.eclipse.tractusx.bpdm.gate.api.model.response.LegalEntityGateOutputResponse
import org.springdoc.core.annotations.ParameterObject
import org.springframework.http.MediaType
import org.springframework.http.ResponseEntity
Expand Down
Loading

0 comments on commit 4bbada1

Please sign in to comment.