OBPIH-6291 Validate for inactive suppliers in product source import#4877
Merged
awalkowiak merged 1 commit intodevelopfrom Oct 7, 2024
Merged
OBPIH-6291 Validate for inactive suppliers in product source import#4877awalkowiak merged 1 commit intodevelopfrom
awalkowiak merged 1 commit intodevelopfrom
Conversation
ewaterman
reviewed
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") |
Member
There was a problem hiding this comment.
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
Collaborator
Author
There was a problem hiding this comment.
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
approved these changes
Oct 4, 2024
ewaterman
approved these changes
Oct 4, 2024
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
✨ Description of Change
Link to GitHub issue or Jira ticket:
Description:
📷 Screenshots & Recordings (optional)