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: add house number supplement #694

Merged
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 @@ -72,7 +72,7 @@ object CommonValues {
postalCode = "PostalCode",
city = "City",
district = "District",
street = StreetDto("StreetName"),
street = StreetDto("StreetName", houseNumberSupplement = "House Number Supplement"),
companyPostalCode = "CompanyPostalCode",
industrialZone = "IndustrialZone",
building = "Building",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ interface IBaseStreetDto {
@get:Schema(description = StreetDescription.houseNumber)
val houseNumber: String?

val houseNumberSupplement: String?

@get:Schema(description = StreetDescription.milestone)
val milestone: String?

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@ data class StreetDto(
override val nameSuffix: String? = null,
override val additionalNameSuffix: String? = null,
override val houseNumber: String? = null,
override val houseNumberSupplement: String? = null,
override val milestone: String? = null,
override val direction: String? = null
override val direction: String? = null,

) : IStreetDetailedDto
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ data class PhysicalPostalAddress(
@Embedded
@AttributeOverride(name = "name", column = Column(name = "phy_street_name"))
@AttributeOverride(name = "houseNumber", column = Column(name = "phy_street_number"))
@AttributeOverride(name = "houseNumberSupplement", column = Column(name = "phy_street_number_supplement"))
@AttributeOverride(name = "milestone", column = Column(name = "phy_street_milestone"))
@AttributeOverride(name = "direction", column = Column(name = "phy_street_direction"))
@AttributeOverride(name = "namePrefix", column = Column(name = "phy_name_prefix"))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@ data class Street(
@Column
val houseNumber: String? = null,

@Column
val houseNumberSupplement: String? = null,

/**
* The Milestone is relevant for long roads without specific house numbers.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -249,6 +249,7 @@ class BusinessPartnerMappings {
StreetDto(
name = entity.name,
houseNumber = entity.houseNumber,
houseNumberSupplement = entity.houseNumberSupplement,
milestone = entity.milestone,
direction = entity.direction,
namePrefix = entity.namePrefix,
Expand All @@ -262,6 +263,7 @@ class BusinessPartnerMappings {
Street(
name = dto.name,
houseNumber = dto.houseNumber,
houseNumberSupplement = dto.houseNumberSupplement,
milestone = dto.milestone,
direction = dto.direction,
namePrefix = dto.namePrefix,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ class OrchestratorMappings(
StreetDto(
name = entity.name,
houseNumber = entity.houseNumber,
houseNumberSupplement = entity.houseNumberSupplement,
milestone = entity.milestone,
direction = entity.direction,
namePrefix = entity.namePrefix,
Expand Down Expand Up @@ -235,6 +236,7 @@ class OrchestratorMappings(
Street(
name = dto.name,
houseNumber = dto.houseNumber,
houseNumberSupplement = dto.houseNumberSupplement,
milestone = dto.milestone,
direction = dto.direction,
namePrefix = dto.namePrefix,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@ private fun StreetDto.toStreetEntity(): Street {
return Street(
name = name,
houseNumber = houseNumber,
houseNumberSupplement = houseNumberSupplement,
milestone = milestone,
direction = direction,
namePrefix = namePrefix,
Expand Down Expand Up @@ -343,6 +344,7 @@ private fun Street.toStreetDto(): StreetDto {
return StreetDto(
name = name,
houseNumber = houseNumber,
houseNumberSupplement = houseNumberSupplement,
milestone = milestone,
direction = direction,
namePrefix = namePrefix,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
ALTER TABLE logistic_addresses
ADD COLUMN phy_street_number_supplement VARCHAR(255);

ALTER TABLE postal_addresses
ADD COLUMN phy_street_number_supplement VARCHAR(255);
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,7 @@ internal class BusinessPartnerIT @Autowired constructor(
district = "district9",
street = Street(
name = "unknown street",
houseNumberSupplement = "house-number-supplement",
namePrefix = "Un",
nameSuffix = "know",
additionalNamePrefix = "empty"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@ object BusinessPartnerGenericValues {
street = StreetDto(
name = "name",
houseNumber = "house-number",
houseNumberSupplement = "house-number-supplement",
milestone = "milestone",
direction = "direction",
namePrefix = "name-prefix",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@ object BusinessPartnerVerboseValues {
building = "Bauteil A",
floor = "Etage 1",
door = "Door One",
street = StreetDto(name = "Mercedesstraße", houseNumber = "", direction = "direction1"),
street = StreetDto(name = "Mercedesstraße", houseNumber = "", direction = "direction1", houseNumberSupplement = "A"),
)

val postalAddress2 = PhysicalPostalAddressDto(
Expand All @@ -265,7 +265,7 @@ object BusinessPartnerVerboseValues {
building = "Building Two",
floor = "Floor Two",
door = "Door Two",
street = StreetDto(name = "TODO", houseNumber = "", direction = "direction1"),
street = StreetDto(name = "TODO", houseNumber = "", direction = "direction1", houseNumberSupplement = "B"),
)

val postalAddress3 = PhysicalPostalAddressDto(
Expand All @@ -282,7 +282,7 @@ object BusinessPartnerVerboseValues {
building = "Bauteil A",
floor = "Etage 1",
door = "Door One",
street = StreetDto(name = "Mercedesstraße", houseNumber = "", direction = "direction1"),
street = StreetDto(name = "Mercedesstraße", houseNumber = "", direction = "direction1", houseNumberSupplement = "C"),
)

val bpPostalAddressInputDtoFull = BusinessPartnerPostalAddressDto(
Expand Down Expand Up @@ -346,7 +346,7 @@ object BusinessPartnerVerboseValues {
building = "Bauteil A",
floor = "Etage 1",
door = "Door One",
street = StreetDto(name = "Mercedesstraße", houseNumber = "", direction = "direction1"),
street = StreetDto(name = "Mercedesstraße", houseNumber = "", direction = "direction1", houseNumberSupplement = "A"),
)

val postalAddressLogisticAddress2 = PhysicalPostalAddressDto(
Expand All @@ -363,7 +363,7 @@ object BusinessPartnerVerboseValues {
building = "Building Two",
floor = "Floor Two",
door = "Door Two",
street = StreetDto(name = "TODO", houseNumber = "", direction = "direction1"),
street = StreetDto(name = "TODO", houseNumber = "", direction = "direction1", houseNumberSupplement = "B"),
)

//New Values for Logistic Address Tests
Expand Down Expand Up @@ -780,6 +780,7 @@ object BusinessPartnerVerboseValues {
street = StreetDto(
name = "name",
houseNumber = "house-number",
houseNumberSupplement = "house-number-supplement",
milestone = "milestone",
direction = "direction",
namePrefix = "name-prefix",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,12 @@ import org.eclipse.tractusx.bpdm.common.dto.IStreetDetailedDto
data class StreetDto(
override val name: String? = null,
override val houseNumber: String? = null,
override val houseNumberSupplement: String? = null,
override val milestone: String? = null,
override val direction: String? = null,
override val namePrefix: String? = null,
override val additionalNamePrefix: String? = null,
override val nameSuffix: String? = null,
override val additionalNameSuffix: String? = null
override val additionalNameSuffix: String? = null,

) : IStreetDetailedDto
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@ object BusinessPartnerTestValues {
street = StreetDto(
name = "name",
houseNumber = "house-number",
houseNumberSupplement = "house-number-supplement",
milestone = "milestone",
direction = "direction",
namePrefix = "name-prefix",
Expand Down Expand Up @@ -225,6 +226,7 @@ object BusinessPartnerTestValues {
street = StreetDto(
name = "name-2",
houseNumber = "house-number-2",
houseNumberSupplement = "house-number-supplement-2",
milestone = "milestone-2",
direction = "direction-2",
namePrefix = "name-prefix-2",
Expand Down Expand Up @@ -297,6 +299,7 @@ object BusinessPartnerTestValues {
street = StreetDto(
name = "Street Name 1",
houseNumber = "House Number 1",
houseNumberSupplement = "house-number-supplement-1",
milestone = "Milestone 1",
direction = "Direction 1",
namePrefix = "Name Prefix 1",
Expand Down Expand Up @@ -362,6 +365,7 @@ object BusinessPartnerTestValues {
street = StreetDto(
name = "Street Name 2",
houseNumber = "House Number 2",
houseNumberSupplement = "house-number-supplement-2",
milestone = "Milestone 2",
direction = "Direction 2",
namePrefix = "Name Prefix 2",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@ data class StreetDto(

override val name: String? = null,
override val houseNumber: String? = null,
override val houseNumberSupplement: String? = null,
override val milestone: String? = null,
override val direction: String? = null
override val direction: String? = null,

) : IBaseStreetDto
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ class PhysicalPostalAddress(
@Embedded
@AttributeOverride(name = "name", column = Column(name = "phy_street_name"))
@AttributeOverride(name = "houseNumber", column = Column(name = "phy_street_number"))
@AttributeOverride(name = "houseNumberSupplement", column = Column(name = "phy_street_number_supplement"))
@AttributeOverride(name = "milestone", column = Column(name = "phy_street_milestone"))
@AttributeOverride(name = "direction", column = Column(name = "phy_street_direction"))
val street: Street? = null,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@ class Street(
@Column
val houseNumber: String? = null,

@Column
val houseNumberSupplement: String? = null,

/**
* The Milestone is relevant for long roads without specific house numbers.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -557,6 +557,7 @@ class BusinessPartnerBuildService(
Street(
name = it.name,
houseNumber = it.houseNumber,
houseNumberSupplement = it.houseNumberSupplement,
milestone = it.milestone,
direction = it.direction
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,7 @@ private fun Street.toDto(): StreetDto {
return StreetDto(
name = name,
houseNumber = houseNumber,
houseNumberSupplement = houseNumberSupplement,
milestone = milestone,
direction = direction
)
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
ALTER TABLE logistic_addresses
ADD COLUMN phy_street_number_supplement VARCHAR(255);
Original file line number Diff line number Diff line change
Expand Up @@ -1181,6 +1181,7 @@ class TaskStepFetchAndReserveServiceTest @Autowired constructor(
street = StreetDto(
name = "name_" + bpnAReference.referenceValue,
houseNumber = "houseNumber_" + bpnAReference.referenceValue,
houseNumberSupplement = "houseNumberSupplement_" + bpnAReference.referenceValue,
milestone = "milestone_" + bpnAReference.referenceValue,
direction = "direction_" + bpnAReference.referenceValue,
namePrefix = "namePrefix_" + bpnAReference.referenceValue,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ object BusinessPartnerVerboseValues {
building = "Gebäude eins",
floor = "Stockerk eins",
door = "Raum eins",
street = StreetDto("Bela-Barenyi-Straße", ""),
street = StreetDto("Bela-Barenyi-Straße", houseNumber = "", houseNumberSupplement = "A"),
)

val address2 = PhysicalPostalAddressVerboseDto(
Expand All @@ -155,7 +155,7 @@ object BusinessPartnerVerboseValues {
building = "Building Two",
floor = "Floor Two",
door = "Door Two",
street = StreetDto("", ""),
street = StreetDto(name = "", houseNumber = "", houseNumberSupplement = "B"),
)

val address3 = PhysicalPostalAddressVerboseDto(
Expand All @@ -172,7 +172,7 @@ object BusinessPartnerVerboseValues {
building = "tedifício três",
floor = "piso três",
door = "peça três",
street = StreetDto("", ""),
street = StreetDto(name = "", houseNumber = "", houseNumberSupplement = "C"),
)

val addressPartner1 = LogisticAddressVerboseDto(
Expand Down
Loading