Skip to content

Commit

Permalink
feat(api): eclipse-tractusx#179 Pool API: Legal Entity Response shoul…
Browse files Browse the repository at this point in the history
…d fix after merge
  • Loading branch information
rainer-exxcellent committed Jun 1, 2023
1 parent cfe67be commit 58685c3
Show file tree
Hide file tree
Showing 8 changed files with 17 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,18 @@

package org.eclipse.tractusx.bpdm.common.dto.response

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.service.DataClassUnwrappedJsonDeserializer

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

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

@Schema(description = "Legal Entity")
@field:JsonUnwrapped
val legalEntity: LegalEntityResponse,
)
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
package org.eclipse.tractusx.bpdm.gate.api.model


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.response.LegalEntityResponse
Expand All @@ -31,7 +32,7 @@ data class LegalEntityGateOutput(

val legalNameParts: Array<String> = emptyArray(),

@Schema(description = "Legal Entity")
@field:JsonUnwrapped
val legalEntity: LegalEntityResponse,

@Schema(description = "ID the record has in the external system where the record originates from")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,8 @@ package org.eclipse.tractusx.bpdm.gate.service
import mu.KotlinLogging
import org.eclipse.tractusx.bpdm.common.dto.response.LegalEntityResponse
import org.eclipse.tractusx.bpdm.common.dto.response.LogisticAddressResponse
import org.eclipse.tractusx.bpdm.common.dto.response.PoolLegalEntityResponse
import org.eclipse.tractusx.bpdm.common.dto.saas.BusinessPartnerSaas
import org.eclipse.tractusx.bpdm.common.dto.saas.FetchResponse
import org.eclipse.tractusx.bpdm.common.exception.BpdmMappingException
import org.eclipse.tractusx.bpdm.common.dto.response.PageResponse
import org.eclipse.tractusx.bpdm.common.dto.response.PoolLegalEntityResponse
import org.eclipse.tractusx.bpdm.common.exception.BpdmNotFoundException
import org.eclipse.tractusx.bpdm.gate.api.model.LegalEntityGateInputRequest
import org.eclipse.tractusx.bpdm.gate.api.model.LegalEntityGateInputResponse
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@ internal class LegalEntityControllerInputIT @Autowired constructor(
private val objectMapper: ObjectMapper,
val gateClient: GateClient,
private val legalEntityRepository: LegalEntityRepository,
private val testHelpers: DbTestHelpers
) {
companion object {
@RegisterExtension
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@

package org.eclipse.tractusx.bpdm.pool.api.model.response

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.response.LegalEntityResponse
Expand All @@ -34,7 +35,7 @@ data class BusinessPartnerResponse(
@get:Schema(description = "Legal name the partner goes by")
val legalName: String,

@Schema(description = "Legal Entity")
@field:JsonUnwrapped
val legalEntity: LegalEntityResponse,

val addresses: Collection<LogisticAddressResponse>,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,13 @@

package org.eclipse.tractusx.bpdm.pool.api.model.response

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.response.LegalEntityResponse
import org.eclipse.tractusx.bpdm.common.service.DataClassUnwrappedJsonDeserializer

@JsonDeserialize(using = DataClassUnwrappedJsonDeserializer::class)
@Schema(name = "LegalEntityMatchResponse", description = "Match with score for a business partner record of type legal entity")
data class LegalEntityMatchResponse(
@Schema(description = "Relative quality score of the match. The higher the better")
Expand All @@ -30,6 +34,6 @@ data class LegalEntityMatchResponse(
@get:Schema(description = "Legal name the partner goes by")
val legalName: String,

@Schema(description = "Legal Entity")
@field:JsonUnwrapped
val legalEntity: LegalEntityResponse
)
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@

package org.eclipse.tractusx.bpdm.pool.api.model.response

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.response.LegalEntityResponse
Expand All @@ -31,7 +32,7 @@ data class LegalEntityPartnerCreateResponse(
@get:Schema(description = "Legal name the partner goes by")
val legalName: String,

@Schema(description = "Legal Entity")
@field:JsonUnwrapped
val legalEntity: LegalEntityResponse,

@Schema(description = "User defined index to conveniently match this entry to the corresponding entry from the request")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,6 @@ package org.eclipse.tractusx.bpdm.pool.service

import org.eclipse.tractusx.bpdm.common.dto.IdentifierLsaType
import org.eclipse.tractusx.bpdm.common.dto.response.PoolLegalEntityResponse
import org.eclipse.tractusx.bpdm.common.dto.response.LegalEntityResponse
import org.eclipse.tractusx.bpdm.common.dto.response.PoolLegalEntityResponse
import org.eclipse.tractusx.bpdm.common.exception.BpdmNotFoundException
import org.eclipse.tractusx.bpdm.pool.api.model.response.BpnIdentifierMappingResponse
import org.eclipse.tractusx.bpdm.pool.api.model.response.BusinessPartnerResponse
Expand Down

0 comments on commit 58685c3

Please sign in to comment.