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

API: Enhance BPN user link with BPN allowed BPN #901

Open
Phil91 opened this issue Aug 6, 2024 · 1 comment
Open

API: Enhance BPN user link with BPN allowed BPN #901

Phil91 opened this issue Aug 6, 2024 · 1 comment
Assignees
Labels
enhancement New feature or request

Comments

@Phil91
Copy link
Member

Phil91 commented Aug 6, 2024

In the current implementation additional BPNs can get added to user account.

The solution does not verify/support to validate if the BPN is a valid BPN or if this BPN is really correctly added.

With one of the latest BPDM feature enhancements, this is now possible.

Endpoint supported by BPDM: GET /api/catena/legal-entities/\{bpnl}/sites

BPDM Pool Swagger

 

Details of the needed change:

 

Backend

Portal Endpoints impacted by the new function

  • PUT /api/administration/user/owncompany/users/\{companyUserId}/businessPartnerNumbers/\{businessPartnerNumber}
  • POST /api/administration/user/owncompany/users/\{companyUserId}/businessPartnerNumber

 

Both endpoints are used to enhance the user linked BPNs. The user linked BPNs are stored inside the portal db as well as the user jwt token (via keycloak user attributes).

The backend logic of both those endpoints need to get enhanced. The BPN submitted by the user via the api endpoints need to get validated against the BPDM service GET /api/catena/legal-entities/\{bpnl}/sites

Only if the users company BPN is connected to the submitted BPN(s), the BPN(s) should get added to the respektive user (portal db and keycloak user attribute). For those BPNs where the BPDM service check GET /api/catena/legal-entities/\{bpnl}/sites is unsuccessful, the request should fail and the user attributes/portal db should not get updated for those specific BPN(s).

 

Please use for the implementation extended error handling.

Means: if the user tries to add 3 BPNs; one of them being valid and the other two not connected to the company BPNL; in this case the response should be the following

 

API Response of the both API endpoints mentioned above should include following details:

- list of successful added BPNLs
- list of unsuccessful added BPNLs ++ the reason why the BPNL could not get added

 

Frontend Changes

eclipse-tractusx/portal-frontend#989

@Phil91
Copy link
Member Author

Phil91 commented Aug 6, 2024

@MaximilianHauer I've migrated this issue from jira, it was previously assigned to Prasanna, I will take care of the implementation

@evegufy evegufy added this to the Release 24.12 milestone Aug 8, 2024
Phil91 added a commit that referenced this issue Aug 14, 2024
Phil91 added a commit that referenced this issue Aug 14, 2024
Phil91 added a commit to eclipse-tractusx/portal that referenced this issue Sep 11, 2024
Phil91 added a commit that referenced this issue Sep 11, 2024
Phil91 added a commit that referenced this issue Sep 11, 2024
Refs: #901
Co-authored-by: VPrasannaK94 <[email protected]>
Co-authored-by: Norbert Truchsess <[email protected]>
Reviewed-by: Norbert Truchsess <[email protected]>
Reviewed-By: Evelyn Gurschler <[email protected]>
Phil91 added a commit to eclipse-tractusx/portal that referenced this issue Sep 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: IN REVIEW
Development

No branches or pull requests

3 participants