Add validation for uploading Orderables.csv file

Description

Acceptance Criteria:

  • orderable file

  1. When any of the required cells are empty an error message stating that “The orderable file contains at least one empty cell.” is displayed.

  2. When any of the value in the following columns: “packRoundingThreshold”, “packSize” is negative an error message stating that “The orderable file contains negative value in the following column: [<name of the column(s)>].” is displayed. Example: “The orderable file contains negative value in the following column: [packRoundingThreshold].”

  3. When the .csv file does not contain any data an error message stating that “The orderable file does not contain any data.” is displayed.

  4. When the values in the “roundToZero” column is different than the boolean an error message stating that “The orderable file contains wrong format in the following column: [<name of the column>]. The format should be [true] or [false].” is displayed. Example: “The orderable file contains wrong format in the following column: [roundToZero]. The format should be [true] or [false].”

  5. When the data in the following columns: “packRoundingThreshold”, “packSize” are different than INT format, an error message stating that “The orderable file contains wrong format in the following column: [<name of the column(s)>]. The format should be a number.” is displayed. Example: “The orderable file contains wrong format in the following column: [packRoundingThreshold]. The format should be a number.”

  6. When the column headers does not match the name an error message stating that “The orderable file contains at least one invalid header.” is displayed.

  • orderable_mapping file

  1. When any of the required cells are empty an error message stating that “The orderable_mapping file contains at least one empty cell.” is displayed.

  2. When the orderable_mapping file does not contain any data an error message stating that “The orderable_mapping file does not contain any data.” is displayed.

  3. When the column headers does not match the name an error message stating that “The orderable_mapping file contains at least one invalid header.” is displayed.

  4. When the data in the following columns: “from“, “to“, “type“, “entityName“, “defaultValue” are different than in the original file an error message stating that “The orderable_mapping file contains at least one invalid data in the following column: [<name of the column(s)>]. Example: “The orderable_mapping file contains at least one invalid data in the following column: [from, to].”

The mappings are not required.

Attachments

6

Checklists

Activity

Show:
Aleksandra Hinc
October 25, 2023 at 7:33 AM

This is working now.

Aleksandra Hinc
October 23, 2023 at 1:06 PM

Previous comment relates also to “programOrderable.csv” and “tradeItems.csv”.

Aleksandra Hinc
October 23, 2023 at 11:40 AM

Hi I’ve checked this ticket. I have some comments to the points in the description:

orderable file:

1.a. I’ve noticed that all columns are treated as required during the import, but only the following ones should be:

  • “productCode”

  • “packSize”

  • “packRoundingThreshold”

  • “roundToZero”

1.b. The error message is not user friendly enough - please changes it e.g. for:

“The orderable.csv file contains empty field in column: 1, in row: 2. The value should not be null.”

2. The error message is not user friendly enough - please changes it e.g. for:

“The orderable.csv file contains negative value in column: 5, in row: 2. The value should be positive.”

3. Please make small change in the error message:

“Missing mandatory column in uploaded orderable.csv file: […], […].

4. The error message is not user friendly enough - please changes it e.g. for:

“The orderable.csv file contains wrong format in column: x, in row: y. The format should be [true] or [false].”

5. The error message is not user friendly enough - please changes it e.g. for:

“The orderable.csv file contains wrong format in the column: x, in row: y. The format should be a number.”

6. Please make small change in the error message:

“Invalid headers in the uploaded orderable.csv file: [..].”

Aleksandra Hinc
October 23, 2023 at 10:13 AM

I started testing this.

Adam Nawrot
October 20, 2023 at 1:40 PM

Validations are available for testing on UAT instance, could you check it?

Unresolved
Pinned fields
Click on the next to a field label to start pinning.

Details

Assignee

Reporter

Labels

Original estimate

Time tracking

1w 5h logged

Fix versions

Priority

Time Assistant

Created April 5, 2023 at 9:55 AM
Updated July 3, 2024 at 8:43 AM