Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: API - Rename generic BPN -> BPNL/BPNS/BPNA #360

Merged
merged 1 commit into from
Jul 26, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,10 @@ data class RelationVerboseDto(
val type: TypeKeyNameVerboseDto<RelationType>,

@get:Schema(description = "BPN of partner which is the source of the relation")
val startBpn: String,
val startBpnl: String,

@get:Schema(description = "BPN of partner which is the target of the relation")
val endBpn: String,
val endBpnl: String,

@get:Schema(description = "Time when the relation started")
val validFrom: LocalDateTime? = null,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,6 @@ data class AddressGateOutputDto(
val siteExternalId: String? = null,

@Schema(description = "Business Partner Number")
val bpn: String
val bpna: String

)
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ import org.eclipse.tractusx.bpdm.gate.api.model.BusinessPartnerRole
@JsonDeserialize(using = DataClassUnwrappedJsonDeserializer::class)
@Schema(name = "LegalEntityGateOutputResponse", description = "Legal entity with external id")
data class LegalEntityGateOutputResponse(

@field:JsonUnwrapped
val legalEntity: LegalEntityDto,

Expand All @@ -44,6 +45,6 @@ data class LegalEntityGateOutputResponse(
val externalId: String,

@Schema(description = "Business Partner Number")
val bpn: String
val bpnl: String

)
Original file line number Diff line number Diff line change
Expand Up @@ -44,5 +44,5 @@ data class SiteGateOutputResponse(
val legalEntityExternalId: String,

@Schema(description = "Business Partner Number")
val bpn: String
val bpns: String
)
Original file line number Diff line number Diff line change
Expand Up @@ -455,7 +455,7 @@ fun LogisticAddress.toAddressGateOutputResponse(logisticAddressPage: LogisticAdd
externalId = externalId,
legalEntityExternalId = legalEntity?.externalId,
siteExternalId = site?.externalId,
bpn = bpn!!,
bpna = bpn!!,
)

return addressGateOutputResponse
Expand All @@ -468,7 +468,7 @@ fun Site.toSiteGateOutputResponse(sitePage: Site): SiteGateOutputResponse {
site = sitePage.toSiteDto(),
externalId = externalId,
legalEntityExternalId = legalEntity.externalId,
bpn = bpn!!,
bpns = bpn!!,
mainAddress = mainAddress.toAddressGateOutputResponse(mainAddress)
)
}
Expand All @@ -480,7 +480,7 @@ fun LegalEntity.toLegalEntityGateOutputResponse(legalEntity: LegalEntity): Legal
legalEntity = legalEntity.toLegalEntityDto(),
legalNameParts = getNamePartValues(legalEntity.nameParts),
externalId = legalEntity.externalId,
bpn = legalEntity.bpn!!,
bpnl = legalEntity.bpn!!,
roles = roles.map { it.roleName },
legalAddress = legalAddress.toAddressGateOutputResponse(legalAddress)
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,7 @@ object ResponseValues {
),
externalId = CommonValues.externalIdAddress1,
legalEntityExternalId = null,
bpn = CommonValues.bpnAddress1
bpna = CommonValues.bpnAddress1
)

val logisticAddressGateOutputResponse2 = AddressGateOutputDto(
Expand All @@ -321,7 +321,7 @@ object ResponseValues {
),
externalId = CommonValues.externalIdAddress2,
siteExternalId = null,
bpn = CommonValues.bpnAddress2
bpna = CommonValues.bpnAddress2
)

val legalEntityGateInputResponse1 = LegalEntityGateInputDto(
Expand Down Expand Up @@ -354,27 +354,27 @@ object ResponseValues {
legalEntity = RequestValues.legalEntity1,
legalNameParts = listOf(CommonValues.name1),
externalId = CommonValues.externalId1,
bpn = CommonValues.bpn1,
bpnl = CommonValues.bpn1,
legalAddress = AddressGateOutputDto(
address = RequestValues.address1,
externalId = "${CommonValues.externalId1}_legalAddress",
legalEntityExternalId = CommonValues.externalId1,
siteExternalId = null,
bpn = CommonValues.bpnAddress1
bpna = CommonValues.bpnAddress1
)
)

val legalEntityGateOutputResponse2 = LegalEntityGateOutputResponse(
legalEntity = RequestValues.legalEntity2,
externalId = CommonValues.externalId2,
legalNameParts = listOf(CommonValues.name2),
bpn = CommonValues.bpn2,
bpnl = CommonValues.bpn2,
legalAddress = AddressGateOutputDto(
address = RequestValues.address2,
externalId = "${CommonValues.externalId2}_legalAddress",
legalEntityExternalId = CommonValues.externalId2,
siteExternalId = null,
bpn = CommonValues.bpnAddress2
bpna = CommonValues.bpnAddress2
)
)

Expand Down Expand Up @@ -406,27 +406,27 @@ object ResponseValues {
site = RequestValues.site1,
externalId = CommonValues.externalIdSite1,
legalEntityExternalId = CommonValues.externalId1,
bpn = CommonValues.bpnSite1,
bpns = CommonValues.bpnSite1,
mainAddress = AddressGateOutputDto(
address = RequestValues.address1,
externalId = "${CommonValues.externalIdSite1}_site",
legalEntityExternalId = null,
siteExternalId = CommonValues.externalIdSite1,
bpn = CommonValues.bpnAddress1
bpna = CommonValues.bpnAddress1
)
)

val persistencesiteGateOutputResponse2 = SiteGateOutputResponse(
site = RequestValues.site2,
externalId = CommonValues.externalIdSite2,
legalEntityExternalId = CommonValues.externalId2,
bpn = CommonValues.bpnSite2,
bpns = CommonValues.bpnSite2,
mainAddress = AddressGateOutputDto(
address = RequestValues.address2,
externalId = "${CommonValues.externalIdSite2}_site",
legalEntityExternalId = null,
siteExternalId = CommonValues.externalIdSite2,
bpn = CommonValues.bpnAddress2
bpna = CommonValues.bpnAddress2
)
)
}
Original file line number Diff line number Diff line change
Expand Up @@ -269,8 +269,8 @@ fun Classification.toDto(): ClassificationVerboseDto {
fun Relation.toDto(): RelationVerboseDto {
return RelationVerboseDto(
type = type.toDto(),
startBpn = startNode.bpn,
endBpn = endNode.bpn,
startBpnl = startNode.bpn,
endBpnl = endNode.bpn,
validFrom = validFrom,
validTo = validTo
)
Expand Down