Skip to content

OBPIH-6291 Validate for inactive suppliers in product source import#4877

Merged
awalkowiak merged 1 commit intodevelopfrom
OBPIH-6291
Oct 7, 2024
Merged

OBPIH-6291 Validate for inactive suppliers in product source import#4877
awalkowiak merged 1 commit intodevelopfrom
OBPIH-6291

Conversation

@kchelstowski
Copy link
Collaborator

✨ Description of Change

A concise summary of what is being changed. Please provide enough context for reviewers to be able to understand the change and why it is necessary. If the issue/ticket already provides enough information, you can put "See ticket" as the description.

Link to GitHub issue or Jira ticket:

Description:


📷 Screenshots & Recordings (optional)

If this PR contains a UI change, consider adding one or more screenshots here or link to a screen recording to help reviewers visualize the change. Otherwise, you can remove this section.

@kchelstowski kchelstowski self-assigned this Oct 4, 2024
@github-actions github-actions bot added the domain: backend Changes or discussions relating to the backend server label Oct 4, 2024
Allow assigning an inactive supplier to an inactive source (or to a source that is about to become inactive)
*/
if (supplier && !supplier.active && (params.active || !productSupplierExists)) {
command.errors.reject("Row ${index + 1}: Supplier '${supplier.name}' is no longer active. Choose an active supplier")
Copy link
Member

Choose a reason for hiding this comment

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

Does merging the two cases (ProductSupplier does not exist and Organization is inactive) into the same error message give us enough context on the frontend to know what to do? Seems like for the first case we need to change params.id, and for the second we need to change params.supplierName or params.active

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

the existence of the product supplier only indicates whether we are editing a source or creating a brand new one. Since the requirements are different for editing and creating a brand new one (explained in the comment above the if), I needed this indication whether the source exists or not.

@awalkowiak awalkowiak merged commit d03003e into develop Oct 7, 2024
@awalkowiak awalkowiak deleted the OBPIH-6291 branch October 7, 2024 08:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

domain: backend Changes or discussions relating to the backend server

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants