Skip to content

Commit

Permalink
fix(gate/common): Fixed Common entities and DTO according to Data model
Browse files Browse the repository at this point in the history
  • Loading branch information
alexsilva-CGI committed May 3, 2023
1 parent 6c947d1 commit 40d92cd
Show file tree
Hide file tree
Showing 4 changed files with 1 addition and 72 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@

package org.eclipse.tractusx.bpdm.common.model

<<<<<<<< HEAD:bpdm-common/src/main/kotlin/org/eclipse/tractusx/bpdm/common/model/SaasAddressType.kt
enum class SaasAddressType(private val typeName: String) : SaasType, HasDefaultValue<SaasAddressType> {

LEGAL_ALTERNATIVE("Alternative Legal Address"),
Expand All @@ -36,29 +35,12 @@ enum class SaasAddressType(private val typeName: String) : SaasType, HasDefaultV
override fun getTechnicalKey(): String {
return name
}
========
enum class SaasPostalDeliveryPointType(private val typeName: String, private val url: String) : NamedUrlType, HasDefaultValue<SaasPostalDeliveryPointType> {
INTERURBAN_DELIVERY_POINT("Interurban Delivery Point", ""),
MAIL_STATION("Mail Station", ""),
MAILBOX("Mailbox", ""),
OTHER("Other Type", ""),
POST_OFFICE_BOX("Post Office Box", "");
>>>>>>>> 92436eba (fix/feat(pool/datamodel): Adapt data model branch changes):bpdm-common/src/main/kotlin/org/eclipse/tractusx/bpdm/common/model/SaasPostalDeliveryPointType.kt

override fun getTypeName(): String {
return typeName
}

<<<<<<<< HEAD:bpdm-common/src/main/kotlin/org/eclipse/tractusx/bpdm/common/model/SaasAddressType.kt
override fun getDefault(): SaasAddressType {
return UNSPECIFIC
========
override fun getUrl(): String {
return url
}

override fun getDefault(): SaasPostalDeliveryPointType {
return OTHER
>>>>>>>> 92436eba (fix/feat(pool/datamodel): Adapt data model branch changes):bpdm-common/src/main/kotlin/org/eclipse/tractusx/bpdm/common/model/SaasPostalDeliveryPointType.kt
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@

package org.eclipse.tractusx.bpdm.common.model

<<<<<<<< HEAD:bpdm-common/src/main/kotlin/org/eclipse/tractusx/bpdm/common/model/SaasLocalityType.kt
enum class SaasLocalityType(private val typeName: String) : SaasType, HasDefaultValue<SaasLocalityType> {
BLOCK("Block"),
CITY("City"),
Expand All @@ -31,28 +30,12 @@ enum class SaasLocalityType(private val typeName: String) : SaasType, HasDefault
override fun getTechnicalKey(): String {
return name
}
========
enum class SaasThoroughfareType(private val typeName: String, private val url: String) : NamedUrlType, HasDefaultValue<SaasThoroughfareType> {
INDUSTRIAL_ZONE("An industrial zone", ""),
OTHER("Other type", ""),
RIVER("River", ""),
SQUARE("Square", ""),
STREET("Street", "");
>>>>>>>> 92436eba (fix/feat(pool/datamodel): Adapt data model branch changes):bpdm-common/src/main/kotlin/org/eclipse/tractusx/bpdm/common/model/SaasThoroughfareType.kt

override fun getTypeName(): String {
return typeName
}

<<<<<<<< HEAD:bpdm-common/src/main/kotlin/org/eclipse/tractusx/bpdm/common/model/SaasLocalityType.kt
override fun getDefault(): SaasLocalityType {
========
override fun getUrl(): String {
return url
}

override fun getDefault(): SaasThoroughfareType {
>>>>>>>> 92436eba (fix/feat(pool/datamodel): Adapt data model branch changes):bpdm-common/src/main/kotlin/org/eclipse/tractusx/bpdm/common/model/SaasThoroughfareType.kt
return OTHER
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@

package org.eclipse.tractusx.bpdm.common.model

<<<<<<<< HEAD:bpdm-common/src/main/kotlin/org/eclipse/tractusx/bpdm/common/model/SaasPremiseType.kt
enum class SaasPremiseType(private val typeName: String) : SaasType, HasDefaultValue<SaasPremiseType> {
BUILDING("Building"),
OTHER("Other type"),
Expand All @@ -33,29 +32,12 @@ enum class SaasPremiseType(private val typeName: String) : SaasType, HasDefaultV
override fun getTechnicalKey(): String {
return name
}
========
enum class SaasLocalityType(private val typeName: String, private val url: String) : NamedUrlType, HasDefaultValue<SaasLocalityType> {
BLOCK("Block", ""),
CITY("City", ""),
DISTRICT("District", ""),
OTHER("Other", ""),
POST_OFFICE_CITY("Post Office City", ""),
QUARTER("Quarter", "");
>>>>>>>> 92436eba (fix/feat(pool/datamodel): Adapt data model branch changes):bpdm-common/src/main/kotlin/org/eclipse/tractusx/bpdm/common/model/SaasLocalityType.kt

override fun getTypeName(): String {
return typeName
}

<<<<<<<< HEAD:bpdm-common/src/main/kotlin/org/eclipse/tractusx/bpdm/common/model/SaasPremiseType.kt
override fun getDefault(): SaasPremiseType {
========
override fun getUrl(): String {
return url
}

override fun getDefault(): SaasLocalityType {
>>>>>>>> 92436eba (fix/feat(pool/datamodel): Adapt data model branch changes):bpdm-common/src/main/kotlin/org/eclipse/tractusx/bpdm/common/model/SaasLocalityType.kt
return OTHER
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,8 @@
* SPDX-License-Identifier: Apache-2.0
******************************************************************************/

package org.eclipse.tractusx.bpdm.common.service
package org.eclipse.tractusx.bpdm.common.model

<<<<<<<< HEAD:bpdm-common/src/main/kotlin/org/eclipse/tractusx/bpdm/common/model/SaasType.kt
import org.eclipse.tractusx.bpdm.common.dto.saas.TypeKeyNameUrlSaas

/**
Expand All @@ -37,20 +36,3 @@ inline fun <reified T> TypeKeyNameUrlSaas.toSaasType(): T?
where T : Enum<T>, T : SaasType {
return technicalKey?.let { enumValueOf<T>(it) }
}
========
import org.eclipse.tractusx.bpdm.common.dto.saas.AddressSaas

class SaasAddressesMapping(val addresses: Collection<AddressSaas>) {

// TODO change to technicalKey == ...
fun saasAlternativeAddressMapping(): SaasAddressToDtoMapping? {
val address = addresses.find { address -> address.types.any { it.name == "Alternative Legal Address" } }
return address?.let { SaasAddressToDtoMapping(it) }
}

fun saasPhysicalAddressMapping(): SaasAddressToDtoMapping? {
val address = addresses.find { address -> address.types.any { it.name == "Legal Address" } }
return address?.let { SaasAddressToDtoMapping(it) }
}
}
>>>>>>>> 92436eba (fix/feat(pool/datamodel): Adapt data model branch changes):bpdm-common/src/main/kotlin/org/eclipse/tractusx/bpdm/common/service/SaasAddressesMapping.kt

0 comments on commit 40d92cd

Please sign in to comment.