-
Notifications
You must be signed in to change notification settings - Fork 24
feat: Implement search logic for business partner extension #1382
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
base: main
Are you sure you want to change the base?
feat: Implement search logic for business partner extension #1382
Conversation
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A first feedback to the pull request:
There is now a lot of additional filters that can be combined with business partner searches. And these filters also include variant search clauses and and transforms like making everything lower case. With these very powerful search I could imagine that the performance might take a drastic hit on large data sets. Did you do a performance test
on your data set when using this search?
A possible more optimized solution that still only relies on the database search capabilities could be to introduce search columns to relevant searchable columns. In the search columns you can then store the normalized text value of the value you want to search. By doing this you don't need to execute several variant clauses and don't need to transform text values on the fly.
Hi @nicoprow, thanks for the feedback. For the performance improvement. I plan to add a few columns in the pool for the value normalization.
In those three columns, we would see the German umlaut. We can normalize them in advance so we don't convert them on the fly. Based on this idea, do you have a suggestion? |
I think this would be a very straight forward approach which does not take so much effort. The most important part is just to create a migration script to fill the new columns for the existing entries and update the column values with each business partner update. I think it sounds like a good approach without the need of implementing a too complex alternative |
nicoprow
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I left some change requests and comments here. Some of these comments are actually regarding the underlying requirements. We can use those in the next refinement session as basis for debate
...otlin/org/eclipse/tractusx/bpdm/pool/api/model/request/LegalEntityPropertiesSearchRequest.kt
Outdated
Show resolved
Hide resolved
...otlin/org/eclipse/tractusx/bpdm/pool/api/model/request/LegalEntityPropertiesSearchRequest.kt
Outdated
Show resolved
Hide resolved
| val city: String?, | ||
|
|
||
| @field:Parameter(description = "Filter business partners by country code ISO 3166-1.") | ||
| val country: String?, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It says it should search by ISO country code but that would equal our enum value, so why is this a free text field? Or is it also expected to find matches on full country names like 'Germany'?
...n/kotlin/org/eclipse/tractusx/bpdm/pool/api/model/response/BusinessPartnerSearchResultDto.kt
Outdated
Show resolved
Hide resolved
...n/kotlin/org/eclipse/tractusx/bpdm/pool/api/model/response/BusinessPartnerSearchResultDto.kt
Show resolved
Hide resolved
...n/kotlin/org/eclipse/tractusx/bpdm/pool/api/model/response/BusinessPartnerSearchResultDto.kt
Outdated
Show resolved
Hide resolved
...n/kotlin/org/eclipse/tractusx/bpdm/pool/api/model/response/BusinessPartnerSearchResultDto.kt
Outdated
Show resolved
Hide resolved
...n/kotlin/org/eclipse/tractusx/bpdm/pool/api/model/response/BusinessPartnerSearchResultDto.kt
Outdated
Show resolved
Hide resolved
|
Contributes to #603 |
6678be3 to
e07d13e
Compare
|
Two changes have been added
|
a13fc55 to
836cd97
Compare
c6ab2a9 to
05f29c4
Compare
|
Hello @nicoprow @SujitMBRDI , Here is the summary of the commit:
|
05f29c4 to
1899a04
Compare
|
Summary of the last commit:
CC: @nicoprow @SujitMBRDI |
nicoprow
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Core logic looks good and the behaviour of the search is quite mature.
I found some issues and added them in the review comments.
Additionally, a new entry in the CHANGELOG.md is missing for this feature
...otlin/org/eclipse/tractusx/bpdm/pool/api/model/request/LegalEntityPropertiesSearchRequest.kt
Outdated
Show resolved
Hide resolved
| page = 0, | ||
| contentSize = 0, | ||
| content = emptyList() | ||
| ) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe this should be a 400 Error response instead. Otherwise it is not very clear to the API user why no results are being given. I would instead prefer an error response with an appropriate message for each case
| contentSize = size, | ||
| content = pagedContent | ||
| ) | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Something wrong about the pagination logic. If I have no data in my result I get a contentSize of 10 due to the pagination request size attribute.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For pagination the number of total elements is the the total number of objects you can page through. The content size is the number of objects found in the current page and is the same as content.size
...-pool/src/main/kotlin/org/eclipse/tractusx/bpdm/pool/service/BusinessPartnerSearchService.kt
Show resolved
Hide resolved
| notNullD1.toInstant(ZoneOffset.UTC).truncatedTo(ChronoUnit.SECONDS).equals(notNullD2.truncatedTo(ChronoUnit.SECONDS)) | ||
| } | ||
| } ?: false | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unrelated to the feature. Please revert back for more clarity
bpdm-pool/src/test/kotlin/org/eclipse/tractusx/bpdm/pool/controller/MetadataControllerIT.kt
Outdated
Show resolved
Hide resolved
bpdm-pool/src/main/kotlin/org/eclipse/tractusx/bpdm/pool/entity/LegalEntityDb.kt
Show resolved
Hide resolved
...c/main/kotlin/org/eclipse/tractusx/bpdm/pool/controller/v6/LegalEntityLegacyServiceMapper.kt
Show resolved
Hide resolved
...otlin/org/eclipse/tractusx/bpdm/orchestrator/controller/GoldenRecordTaskEventControllerIT.kt
Outdated
Show resolved
Hide resolved
cabcf3c to
50a0d63
Compare
|
Hi @nicoprow , thank you for the feedback. Here is the summary of the commit:
|
bpdm-pool/src/main/kotlin/org/eclipse/tractusx/bpdm/pool/service/MetadataService.kt
Outdated
Show resolved
Hide resolved
Thank you for the adaptions. It looks good to me. There are also other comments that are missing feedback. Will you work on them as well? Regarding the mapping, the alternative address is now mapped correctly but the physical address still misses some fields (see the DTO). |
7f54bcf to
3f58894
Compare
|
Hi @nicoprow , here is the second wave commit summary
|
3f58894 to
703b31f
Compare
a7095dd to
42f6e49
Compare
42f6e49 to
00bb0f0
Compare
nicoprow
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Basically, looks good to me. The only thing I noticed is that the migration script needs to be increased to version 7.3.0, since we had some version increase meanwhile.
Once that is done I think it's ready to merge and I would approve.
00bb0f0 to
0c7b6b7
Compare
|
In the last commit, two changes.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems like the changes to the Pool actually increased its memory size, I guess because of additional prepared statements?
Anyway, I checked the Charts install with a new Pool memory limit of 1200Mi and it worked fine. You can have a look here:
| memory: 1200Mi |
| memory: 1200Mi |
Please change your pull request accordingly and then it should be good to merge
ce668ae to
6c5119b
Compare
6c5119b to
897e4fd
Compare
897e4fd to
ad4a5ed
Compare




Description
This feature aims to introduce enhanced search functionality for Business Partners in the CX network. It improves the current available options for identifying Business Partners in different scenarios like e.g., within the CX-onboarding process.
The benefit of the new functionality is that a member can search for a business partner based on several characteristics and receives the latest information out of the network.
It is a new feature, but it is partially based on an existing data model.
Pre-review checks
Please ensure to do as many of the following checks as possible, before asking for committer review: