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