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.
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
Concept of the shopping lists' line item update actions. #614
Concept of the shopping lists' line item update actions. #614
Changes from 5 commits
bbff90a
23e6a4e
3006072
99b3a94
da821b5
6d35149
1e9fccf
b82c453
02fc905
3fba6c5
7c9fc7a
23e8208
baa0c26
6778f79
b8f0947
97d4d15
8fe4121
76eb9d2
2a78606
d4f24e6
394c063
1ef3339
c745ed0
3902376
6096a78
9d97f9a
18ce8ba
e0e18bc
ded6277
98822a9
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is quantity supposed to update? I see the quantity of existing lineitem 'sku-1' is different.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
b8f0947
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it supposed to have different ID as LineItem SKU-1?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
8fe4121
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't understand here.
In the drafts, the order is ['sku-1', 'sku-3']. Isn't it expected and no need to change the order?
I would understand
ChangeLineitemOrder
is required if the order in drafts is ['sku-3', 'sku-1']There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like same, #614 (comment)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suppose it is going to remove existing 'sku-2' line item.
These two updateActions are appropriate. I am just curious how we determine which updateActions are needed in
UpdateActionUtil
for each LineItem.For example
existing line item : ['sku-4', 'sku-1', 'sku-2']
new line items : ['sku-3', 'sku-4', 'sku-1']
Besides adding 'sku-3' and removing 'sku-2', we have to remove 'sku-1', 'sku-4' from existing line items as well. Otherwise the order is not the same as expected.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch!, You are right, the scenario was the same as scenario 1. 97d4d15
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
From your example, you checked sku-3 and sku-4 is different than to able to match the order, all actions need to be removed and added back because you need to ensure the order.
In scenario 1,
draft : [sku1,..., sku2]
target: [sku2...]
In scenario 2,
draft: [sku1,..., sku3, sku2]
target: [sku1,..., sku2]
sku1 is exactly the same until you find the first difference assume you have N same but a difference in the middle, you don't need to create actions for those N items, here how we will know the difference depends on the comparisons between draft and target objects, so it's like doing sequence comparisons with their order. During the implementation, I could find more examples and could add here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't understand well this consequence. Can you explain?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What kind of explanation? Update action JSON?