Skip to content

Feat/error handling on material refresh#995

Merged
tom-rm-meyer-ISST merged 12 commits intoeclipse-tractusx:mainfrom
achtzig20:feat/error-handling-on-material-refresh
Oct 21, 2025
Merged

Feat/error handling on material refresh#995
tom-rm-meyer-ISST merged 12 commits intoeclipse-tractusx:mainfrom
achtzig20:feat/error-handling-on-material-refresh

Conversation

@OlgaIvkovic
Copy link
Copy Markdown
Contributor

Description

  • Added more detailed errors to reported elements
  • Added error handling for refresh materials on BE
  • Added download errors for refresh materials on FE

Related issue: #985

Pre-review checks

Please ensure to do as many of the following checks as possible, before asking for committer review:

  • DEPENDENCIES are up-to-date. Dash license tool. Committers can open IP issues for restricted libs.
  • Copyright and license header are present on all affected files
  • If helm chart has been changed, the chart version has been bumped to either next major, minor or patch level (compared to released chart).

Copy link
Copy Markdown
Contributor

@tom-rm-meyer-ISST tom-rm-meyer-ISST left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great overall, thanks! Found a few messages to improve consistency.

Further I would refactor to harmonize validations with non-reported entities.

One further question: How have you tested this? I wasn't able to produce an error visible to the frontend but found one in the logs.

I tried manipulated the customer backends db to have a negative demand and then refreshed as a supplier:

docker exec -it postgres-all /bin/sh

psql -d customer-puris -U <see environement for PG_USER>

select * from own_demand

 demand_category_code | measurement_unit | quantity |         day         |             partner_uuid             |                 uuid                 | demand_location_bpns | material_own_material_number | supplier_location_bpns | last_updated_on_date_time 
----------------------+------------------+----------+---------------------+--------------------------------------+--------------------------------------+----------------------+------------------------------+------------------------+---------------------------
                    0 |                0 |      500 | 2025-10-06 17:07:00 | b5a7a28c-8d37-4a78-a0b7-9b8746f2ba70 | 8e7b9212-46f8-4d56-99bf-911f10dbbdeb | BPNS4444444444XX     | MNR-7307-AU340474.002        | BPNS1234567890ZZ       | 2025-10-06 17:07:38.253
                    1 |                0 |      510 | 2025-10-07 17:07:00 | b5a7a28c-8d37-4a78-a0b7-9b8746f2ba70 | 15a21a49-1a37-4cbb-9c73-4ca306c94fcf | BPNS4444444444XX     | MNR-7307-AU340474.002        | BPNS1234567890ZZ       | 2025-10-06 17:07:38.601
                    2 |                0 |      500 | 2025-10-08 17:07:00 | b5a7a28c-8d37-4a78-a0b7-9b8746f2ba70 | e71bd1d2-4deb-4031-9ce6-2e3a1e9ba348 | BPNS4444444444XX     | MNR-7307-AU340474.002        | BPNS1234567890ZZ       | 2025-10-06 17:07:38.733
                    2 |                0 |      500 | 2025-10-09 17:07:00 | b5a7a28c-8d37-4a78-a0b7-9b8746f2ba70 | 0f0511ed-8c7e-43d9-8d5f-577b8afa4ada | BPNS4444444444XX     | MNR-7307-AU340474.002        | BPNS1234567890ZZ       | 2025-10-06 17:07:38.9
                    2 |                0 |      400 | 2025-10-10 17:07:00 | b5a7a28c-8d37-4a78-a0b7-9b8746f2ba70 | 2be2e08b-9f00-47a9-bd2a-b2bcc40e858e | BPNS4444444444XX     | MNR-7307-AU340474.002        |                        | 2025-10-06 17:07:39.037
                    1 |                0 |      810 | 2025-10-17 17:07:00 | b5a7a28c-8d37-4a78-a0b7-9b8746f2ba70 | 0fd76321-9f5f-432e-8092-4a83b120ce65 | BPNS4444444444XX     | MNR-7307-AU340474.002        | BPNS1234567890ZZ       | 2025-10-06 17:07:42.321
                    **0 |                0 |        0 | 2025-10-07 22:00:00 | b5a7a28c-8d37-4a78-a0b7-9b8746f2ba70 | ded65399-796e-466f-925f-64088c4208c3 | BPNS4444444444XX     | MNR-7307-AU340474.002        |                        | 2025-10-06 17:24:09.274**


UPDATE own_demand SET quantity = -1 where uuid = 'ded65399-796e-466f-925f-64088c4208c3';
UPDATE 1
puris_customer= commit;

select * from own_demand;
 demand_category_code | measurement_unit | quantity |         day         |             partner_uuid             |                 uuid                 | demand_location_bpns | material_own_material_number | supplier_location_bpns | last_updated_on_date_time 
----------------------+------------------+----------+---------------------+--------------------------------------+--------------------------------------+----------------------+------------------------------+------------------------+---------------------------
                    0 |                0 |      500 | 2025-10-06 17:07:00 | b5a7a28c-8d37-4a78-a0b7-9b8746f2ba70 | 8e7b9212-46f8-4d56-99bf-911f10dbbdeb | BPNS4444444444XX     | MNR-7307-AU340474.002        | BPNS1234567890ZZ       | 2025-10-06 17:07:38.253
                    1 |                0 |      510 | 2025-10-07 17:07:00 | b5a7a28c-8d37-4a78-a0b7-9b8746f2ba70 | 15a21a49-1a37-4cbb-9c73-4ca306c94fcf | BPNS4444444444XX     | MNR-7307-AU340474.002        | BPNS1234567890ZZ       | 2025-10-06 17:07:38.601
                    2 |                0 |      500 | 2025-10-08 17:07:00 | b5a7a28c-8d37-4a78-a0b7-9b8746f2ba70 | e71bd1d2-4deb-4031-9ce6-2e3a1e9ba348 | BPNS4444444444XX     | MNR-7307-AU340474.002        | BPNS1234567890ZZ       | 2025-10-06 17:07:38.733
                    2 |                0 |      500 | 2025-10-09 17:07:00 | b5a7a28c-8d37-4a78-a0b7-9b8746f2ba70 | 0f0511ed-8c7e-43d9-8d5f-577b8afa4ada | BPNS4444444444XX     | MNR-7307-AU340474.002        | BPNS1234567890ZZ       | 2025-10-06 17:07:38.9
                    2 |                0 |      400 | 2025-10-10 17:07:00 | b5a7a28c-8d37-4a78-a0b7-9b8746f2ba70 | 2be2e08b-9f00-47a9-bd2a-b2bcc40e858e | BPNS4444444444XX     | MNR-7307-AU340474.002        |                        | 2025-10-06 17:07:39.037
                    1 |                0 |      810 | 2025-10-17 17:07:00 | b5a7a28c-8d37-4a78-a0b7-9b8746f2ba70 | 0fd76321-9f5f-432e-8092-4a83b120ce65 | BPNS4444444444XX     | MNR-7307-AU340474.002        | BPNS1234567890ZZ       | 2025-10-06 17:07:42.321
                    **0 |                0 |       -1 | 2025-10-07 22:00:00 | b5a7a28c-8d37-4a78-a0b7-9b8746f2ba70 | ded65399-796e-466f-925f-64088c4208c3 | BPNS4444444444XX     | MNR-7307-AU340474.002        |                        | 2025-10-06 17:24:09.274**

Frontend renders fine on both sides. Supplier side has no demands at all.

Comment thread CHANGELOG.md
### Added

- /
- Added improved error messages for refresh materials ([#995](https://github.com/eclipse-tractusx/puris/pull/995))
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please update to latest changelog version (changed meanwhile) and consider this a major version.

Please also update:

  • frontend/package.json
  • frontend/package-lock.json
  • backend/pom.xml
  • charts/Chart.yaml
  • charts/README.md
  • docs/admin/Migration_Guide

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please merge main / bump to major version

@OlgaIvkovic
Copy link
Copy Markdown
Contributor Author

Hi Tom! I use DBeaver and insert invalid values to existing entries to test
Here's an example where I edit the quantity of an existing demand in the pusris_customer db to a negative value:
image
And the result in the frontend on 3001 should be:
image

Let me know how it goes after this update please :)

Copy link
Copy Markdown
Contributor

@tom-rm-meyer-ISST tom-rm-meyer-ISST left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There have been two smaller things left.

I tried it out and it worked fine.

But I detected one issue: We use the same error messages as for the excel import and we can't identify the entry that is matched with the error message. Thus I walked through all error messages and suggested more appropriate error messages.

I would be grateful, if you could adapt them. Please also consider the stock service.

Copy link
Copy Markdown
Contributor

@tom-rm-meyer-ISST tom-rm-meyer-ISST left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There have been two smaller things left.

I tried it out and it worked fine.

But I detected one issue: We use the same error messages as for the excel import and we can't identify the entry that is matched with the error message. Thus I walked through all error messages and suggested more appropriate error messages.

I would be grateful, if you could adapt them. Please also consider the stock service.

Copy link
Copy Markdown
Contributor

@tom-rm-meyer-ISST tom-rm-meyer-ISST left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for updating. The messages allow better tracking of the issue!

I still messed up a lot during the previous review: Some typos and even the bigger issue have been the delivery messages.

There already have been a few faulty messages and I introduced new faults including inconsistent naming. I needed to reiterate this code as it's complex; I noticed that it's more complext than it should be (raised #1025 for potential refactorings).

I created an excel and walked through ALL the delivery validations again to propose a harmonized AND correct message.

delivery-analysis-error-messages.xlsx

Beside that, to not run into issues, I would kindly ask you to

  • also add the bpna validations as stated in the spreadsheet as pointed out for the validateReportedResponsibility methods (alternatively you can check if the refactoring makes more sense to you).
  • merge main to include this in the minor change.

And big apologies for the moving target and rereview. Have not thought about it all in the beginning + underestimated delivery complexity. Took me 4 hours today.

@OlgaIvkovic
Copy link
Copy Markdown
Contributor Author

Hi Tom!
I refactored the validation logic to use the new methods you proposed in #995 .
I hope I got the logic right (i think you made some typos in the excel) e.g. row 10 column 3 should probably say origin bpns is given and matches partner site instead of matches own partner site.
It was a bit confusing to understand at first but I hope I applied the validation logic correctly :)

@tom-rm-meyer-ISST tom-rm-meyer-ISST linked an issue Oct 21, 2025 that may be closed by this pull request
3 tasks
Copy link
Copy Markdown
Contributor

@tom-rm-meyer-ISST tom-rm-meyer-ISST left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the refactoring and also taking care of the excel!

Found a few smaller things like copy paste issues and one improvement to not confuse the user (forgot about partial in the analysis).

Functionality, works great!

@tom-rm-meyer-ISST tom-rm-meyer-ISST linked an issue Oct 21, 2025 that may be closed by this pull request
Copy link
Copy Markdown
Contributor

@tom-rm-meyer-ISST tom-rm-meyer-ISST left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks a lot for iterating over this that intensively.

Following TRG 7.07 an external IP check is recommened. I don't see the need to file the request due to collaboratively iterating over this pr.

@tom-rm-meyer-ISST tom-rm-meyer-ISST merged commit d0be42e into eclipse-tractusx:main Oct 21, 2025
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Refactoring] Refactor Delivery Location Validations [Story] Improve error messages during data exchange

3 participants