+
Skip to content

00 fulfillment base #6610

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

Merged
merged 96 commits into from
May 18, 2023
Merged

00 fulfillment base #6610

merged 96 commits into from
May 18, 2023

Conversation

sujithvn
Copy link
Contributor

@sujithvn sujithvn commented Nov 1, 2022

Signed-off-by: Sujith mail.sujithvn@gmail.com

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'.

PR Details in order

feat/fulfillment-types
 | 
 | __ 00 fulfillment base <--- This PR #6610 
 |        | __ 01-01 fulfillment-type-shipping       #6614 (old #6579)
 |        | __ 01-02 fulfillment-type-pickup. #6613 (old #6577) 
 |__02 fulfillment-type-impacted-plugins. [carts, products, orders, catalogs] #6615 (old #6582) 
 |__03 placeOrder refactor #6616 (old #6583)

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 01 fulfillment base

API-PLUGIN-FULFILLMENT

This is the base plugin, basic features listed below.
Mutations

  • createFulfillmentType - this is for internal call only from ff-type plugins (NEW)
  • createFulfillmentMethod - this is for internal call only from ff-method plugins (NEW)
  • updateFulfillmentType - public mutation which allows to update certain specific fields of the ff-type (NEW)
  • updateFulfillmentMethod - public mutation which allows to update certain specific fields of the ff-type (NEW)
  • updateFulfillmentOptionsForGroup - Existing code/functionality from the old shipment plugin. This updates the cart with quote details from all available ff-methods for the provided ff-type
  • selectFulfillmentOptionForGroup - Existing code/functionality from the old shipment plugin. This updates the cart with one of the selected ff-method from the available quote presented by above mutation.

Queries

  • fulfillmentType - returns the ff-type matching the provided ID (NEW)
  • fulfillmentTypes - returns all the ff-types (NEW)
  • fulfillmentMethods - returns all the ff-methods for the specified ff-type (NEW)
  • fulfillmentMethodsWithQuotes - Calls the quote providing functions by collecting them via functionByType. Calls are made only for the specific methods of the provided ff-type.
  • getFulfillmentMethodsWithQuotes - Existing code/functionality from the old shipment plugin. Deprecated and calls fulfillmentMethodsWithQuotes internally

Others

  • preStartup - extends all impacted schemas mostly with dynamic values for 'allowedValues' (NEW)
  • startup - inserts the default 'undecided' entry to the new Fulfillment collection (NEW)
  • registration - collects all the "registeredFulfillmentType" from ff-type plugins and adds allRegisteredFulfillmentTypes to context (contextAddition) (NEW)
  • util folder - copied over from shipment plugin (Existing code)

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 1, 2022

⚠️ No Changeset found

Latest commit: 7503a64

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

Signed-off-by: Sujith <mail.sujithvn@gmail.com>
Signed-off-by: Sujith <mail.sujithvn@gmail.com>
…fillment-base

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>
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>
Signed-off-by: Sujith <mail.sujithvn@gmail.com>
@sujithvn sujithvn force-pushed the 00-fulfillment-base branch from 76d2384 to fd9d72c Compare November 1, 2022 11:28
@sujithvn sujithvn mentioned this pull request Nov 1, 2022
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>
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>
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>
Signed-off-by: Sujith <mail.sujithvn@gmail.com>
sujithvn added 28 commits March 13, 2023 13:28
Signed-off-by: Sujith <mail.sujithvn@gmail.com>
Signed-off-by: Sujith <mail.sujithvn@gmail.com>
Signed-off-by: Sujith <mail.sujithvn@gmail.com>
…ateOrder

Signed-off-by: Sujith <mail.sujithvn@gmail.com>
…ctor-validateOrder

Signed-off-by: Sujith <mail.sujithvn@gmail.com>
…or-validateOrder

Signed-off-by: Sujith <mail.sujithvn@gmail.com>
Signed-off-by: Sujith <mail.sujithvn@gmail.com>
…efactor-validateOrder

Signed-off-by: Sujith <mail.sujithvn@gmail.com>
Signed-off-by: Sujith <mail.sujithvn@gmail.com>
Signed-off-by: Sujith <mail.sujithvn@gmail.com>
conflict resolved: pnpm-lock
Signed-off-by: Sujith <mail.sujithvn@gmail.com>
Signed-off-by: Sujith <mail.sujithvn@gmail.com>
…ction into 00-fulfillment-base

Signed-off-by: Sujith <mail.sujithvn@gmail.com>
Signed-off-by: Sujith <mail.sujithvn@gmail.com>
…ed-plugins

New fulfillment impacted plugins
…ction into 00-fulfillment-base

Signed-off-by: Sujith <mail.sujithvn@gmail.com>
…ateOrder

Signed-off-by: Sujith <mail.sujithvn@gmail.com>
…r-validateOrder

New place order refactor validate order
…ction into 00-fulfillment-base

Signed-off-by: Sujith <mail.sujithvn@gmail.com>
Conflict res: pnpm-lock, preStartup

Signed-off-by: Sujith <mail.sujithvn@gmail.com>
Signed-off-by: Sujith <mail.sujithvn@gmail.com>
…ction into 00-fulfillment-base

Signed-off-by: Sujith <mail.sujithvn@gmail.com>
Signed-off-by: Sujith <mail.sujithvn@gmail.com>
Signed-off-by: Sujith <mail.sujithvn@gmail.com>
@sujithvn sujithvn merged commit 6d7b785 into feat/fulfillment-types 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
点击 这是indexloc提供的php浏览器服务,不要输入任何密码和下载