Skip to content

Conversation

@sujithvn
Copy link
Contributor

@sujithvn sujithvn commented Nov 3, 2022

Signed-off-by: Sujith [email protected]

This PR replaces #6577

Resolves #6471
Impact: breaking
Type: feature

Issue

In the current system, the only way for order fulfillment is via shipping which is hardcoded into the system. We need to introduce the flexibility for users to add their own fulfillment types via plugins.

Solution

We are creating a base fulfillment plugin which would enable other fulfillment types (like shipping, pickup, digital) to be introduced via plugins. Each of the newly introduced fulfillment type plugin would need to have the specific fulfillment methods also to be added as separate plugins. Example, fulfillment type 'pickup' could have fulfillment methods like 'store pickup' and 'curb-side pickup'.

This PR is 3rd entry for new-fulfillment-type-pickup

PR Details in order

feat/fulfillment-types
 | 
 | __ 00 fulfillment base #6610 
 |        | __ new-fulfillment-type-shipping       #6614 
 |        | __ new-fulfillment-type-pickup.       <--- This PR #6613
 |__ new-fulfillment-impacted-plugins. [carts, products, orders, catalogs]   #6615 
 |__ new-placeOrder refactor #6616 

Existing PRs based on the #6480 (to be updated to point to #6610)

We shall change the base branch of the 3 existing PRs (i18n #6545, dataMigration #6633 , setDefaultFFtype #6543) to point to 00 fulfillment base

API-PLUGIN-FULFILLMENT-TYPE-PICKUP

  • Registers the 'pickup' as a ff-type via registeredFulfillmentTypes: ["pickup"]
  • Inserts the default entry for pickup ff-type in Fulfillment collection

API-PLUGIN-FULFILLMENT-METHOD-PICKUP-STORE

  • getFulfillmentMethodsWithQuotesPickupStore - returns the quote or equivalent details for the method when called from base ff plugin
  • preStartup - extends the union of "methodAdditionalData" with data structure specific to Store
  • startup - Inserts the required ff-method entry into Fulfillment collection
  • util/checkAndCreateFulfillmentMethod - confirms existing ff-type entry and adds a new ff-method under it.
  • util/collectStoreDetails - dummy function to simulate api providing Store specific info while returning quotes.
  • util/ validateOrderMethodsstore - dummy function to simulate Store specific validations done. Called by prepareOrder.js

Breaking changes

Since this is the new way of handling fulfillment, the existing shipment plugins would not work along with this. User would need to migrate the data (migration script will be developed) and remove the shipment plugins (api-plugin-shipments and api-plugin-shipments-flat-rate).

Testing

All this is new code and at this stage this is not integrated to reaction, meaning the plugins.json is not updated to include this plugin. Hence proper testing can be carried out only after merging in the remaining PRs.

@changeset-bot
Copy link

changeset-bot bot commented Nov 3, 2022

⚠️ No Changeset found

Latest commit: 22b0c79

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@sujithvn sujithvn requested review from aldeed, brent-hoover, tedraykov and vanpho93 and removed request for brent-hoover November 3, 2022 09:55
@sujithvn sujithvn marked this pull request as ready for review November 9, 2022 05:38
Copy link
Contributor

@aldeed aldeed left a comment

Choose a reason for hiding this comment

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

One pattern suggestion but otherwise LGTM

@sujithvn sujithvn merged commit 141145c into 00-fulfillment-base May 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants