This repository was archived by the owner on Sep 21, 2022. It is now read-only.
Accept User input for Fulfillment type in PDP & Fulfillment Grouping#45
Open
Accept User input for Fulfillment type in PDP & Fulfillment Grouping#45
Conversation
Signed-off-by: Sujith <mail.sujithvn@gmail.com>
Signed-off-by: Sujith <mail.sujithvn@gmail.com>
Signed-off-by: Sujith <mail.sujithvn@gmail.com>
Signed-off-by: Sujith <mail.sujithvn@gmail.com>
vanpho93
reviewed
Jul 19, 2022
| // Every time the cart is updated, create any missing fulfillment groups as necessary. | ||
| // We need one group per type per shop, containing only the items from that shop. | ||
| // Also make sure that every item is assigned to a fulfillment group. | ||
| // Update: Refer MCOSS-52: |
Member
There was a problem hiding this comment.
Unit test for this would be great.
Signed-off-by: Sujith <mail.sujithvn@gmail.com>
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Resolves #MCOSS-52
Impact: breaking
Type: feature
Issue
Currently "shipping" is the only fulfillment group in the cart/order and the current logic is to add the items into the the first matching group (comparing supported fulfillment type and existing groups).
Solution
Code fixed to pass all the supported fulfillment types into the grouping logic. This ensures that all the required groups based on the types can be created. Additionally code changes made to add the item to all the matching groups (earlier it was just the first matching).
In case the UI provided the optional field of selected fulfillment type (assuming the user selected it in the PDP page), then this is considered and the item is added only to the selected group.
Breaking changes
As the item is added to all the supported groups, we have to explicitly make the user select one of the group during the checkout and remove the items from the remaining groups. In case the user has already selected the fulfillment type in previous screens and provided the selectedFulfillmentType in API, then the item is already grouped under a single one.
Testing
Sample