reactioncommerce / reaction

Mailchimp Open Commerce is an API-first, headless commerce platform built using Node.js, React, GraphQL. Deployed via Docker and Kubernetes.
https://mailchimp.com/developer/open-commerce/
GNU General Public License v3.0
12.36k stars 2.18k forks source link

Location Inventory BE #6808

Open brendan-shea-pm opened 1 year ago

brendan-shea-pm commented 1 year ago

Location Attributes

Operator will be able to create and edit Locations, which will represent a places a user has inventory such as a warehouse, store, drop ship location, or marketplace. Checkout will eventually be updated to reference Location information in order to fulfill orders through a variety of Fulfillment Methods. Locations will have attributes including:

Location ID: A user assigned value, such as a store number or other internal identifier

Location Name: A user assigned, customer-friendly name for the location

Location Type: Describes the type of location, certain other attributes will be based on type (eg: a Store type will have a Store Hours attribute, but a Warehouse would not have a Store Hours attribute) Values for Location Type are:

Active Location: This is a true/false toggle that indicates whether a Location's Inventory should be considered for order fulfillment

Address: The physical address including Address Line 1, Address Line 2, City, State/Region, Zip/Postal code, Country

Phone Number: The phone number, including country code, for the location

Fulfillment Types: Indicates which types of fulfillment types are available for a Location. For each Location, each of these Fulfillment Types will either be true or false, and will default to false. New Fulfillment Types will be added over time. Fulfillment Types include:

Fulfillment Methods: Fulfillment Methods are different kinds of Fulfillment Types, so a subcategory of type. These Methods can be enabled or disabled for location. For example:

Added by Sujith as per the below update/discussion with Brendan

That requirement was meant to offer flexibility in the future as more fulfillment types get added, but if it makes implementation too complicated I think it’s fine to restrict each location to a single fulfillment type. Use case was more focussed on a Store than a Warehouse. So a Store could have Store Pickup, Ship to Store, Local Delivery etc, but as the last 2 are future dev this is not a hard requirement

Local Fulfillment Only A true/false toggle that indicates whether a Location can fulfill orders to a country outside the one the warehouse is located in

The following attributes apply to Locations that have the Location Type attribute of Store

_Store Hours: The hours that the store is open for business

Each Location can have unique values for the following attributes per Fulfillment Method available at the store, because attributes related to instructions and hours will vary within a single store based on different fulfillment methods. For example, at Store #245 the In Store Pickup fulfillment method with have Pickup Instructions v.1 and Store #245 will have a separate Pickup Intructions v.2 for it's Curbside Pickup fulfillment method.

Store Pickup Hours: Hours that a customer can pick up an item in store. May be the same as Store Hours.

Expected Pickup Time: Indicates how much time a customer should expect will pass before an item is available for pickup in store. Values include (in hours) 2, 4, 6, 12, 24, 48, 120 (5 days), 168 (1 week), 336 (2 weeks)

Pickup Instructions: A text string that a user will complete to instruct a customer on how to pick their item up at the store._

Inventory

Inventory at the sku level should be available for each location. Users will want to see how much total inventory is available at a store in addition to being able to see inventory totals for a specific sku. Inventory for skus will be referenced in the new Checkout. @zenweasel will be able to add more context on how this should work from a technical perspective

Location Priority

Locations will also have attributes related to prioritization. This prioritization will impact how order fulfillment takes place during checkout. Priority attributes include:

Default Location: A true/false toggle that can apply to one Location per Shop. When a Location is marked Default, this will be the Location whose Inventory is used to fulfill an order if no other Location is specified.

Location Priority: Each Location will have a Location Priority rank (1 - 10000) which determines the order in which checkout considers that inventory for fulfillment. 1 is the highest rank

Checkout based on Location Inventory

Checkout process should be updated to take Location into consideration. A series of checks should be done based on Location Inventories and Priority to determine how an order is fulfilled. More information will be added as more Fulfillment Methods are added and when we build our Multi Order Fulfillment, but for now we will focus on Shipping:

Shipping: Prioritization in Order Fulfillment First check to see whether all items in the order can be fulfilled by a single Location, by checking: 1) Select Highest Priority Location 2) Is the Location Active

If no locations are able to fulfill all skus in the order, then use the Default Location

Reference Material

Initiative Info: https://www.notion.so/merchstack/3e4c6d5d26b1406fa869319ecf6077fd?v=9dff0889cacd433cb4df1738c776309a&p=9a9c3df394a7404d83a7d06ce5cbad04&pm=s

Mockups: Location Management section: https://www.figma.com/file/vWot2cXXgjcsLpMq4SAX90/Kinetic?node-id=2907%3A48472&t=QR6caFM5ZW8ec1rh-0

brendan-shea-pm commented 1 year ago

@zenweasel Lmk what you think about this ticket, happy to break it up. Also, let me know if there's anything I may have missed in terms of the scope we discussed yesterday

sujithvn commented 1 year ago

@brendan-shea-pm

Myself and @zenweasel had a discussion around the requirements. I just wanted to clarify on "Fulfillment Methods" mentioned as an attribute of the Location. Are we referring to FulfillmentType here?

Below is my understanding, please correct if something is not right. Say for example, at the shop-level we have defined one fulfillment-type (shipping) and few fulfillment-methods are defined under this type. Now, if we have location-type as 'warehouse', then this would translate into "shipping" as the fulfillment-type and all the fulfillment-methods under the fulfillment-type defined at the shop-level will be by default available in this location.

brendan-shea-pm commented 1 year ago

Hi @sujithvn Can you give me an example of a fulfillment-method in your example where location-type = warehouse and fulfillment-type = shipping? I think we are mostly aligned but want to make sure I'm understanding.

sujithvn commented 1 year ago

@brendan-shea-pm

As per the initial fulfillment-type implement, example would be

fft-type [ex Shipping] -> fft-methods [flat-rate, dynamic-rate] fft-type [expickup] -> fft-methods [in-store, kerb-side]

Meanwhile, I received the update from your discussion with @zenweasel and my question above was before that.

brendan-shea-pm commented 1 year ago

Ok yes we're aligned, thanks @sujithvn

brendan-shea-pm commented 1 year ago

Updated the ticket to reflect the fulfillment method / type distinction. Also noted that enabling the method for a location should be part of the requirement, will go into this more in Store Pickup but wanted to give a heads up. This will give operators the option, as an example, to only offer In Store pickup at a location and not Curbside.

sujithvn commented 1 year ago

Updated the ticket to reflect the decision to have one fft-type per location

brendan-shea-pm commented 1 year ago

Hey @sujithvn I made some updates to reflect that Fulfillment Methods at each location can have different versions of certain attributes (Pickup Instructions, Store Pickup Hours, Expected Pickup Time) based on fulfillment method. So for example, a single store Location will have a set of Pickup Instructions related to its In Store Pickup fulfillment method, but a separate set of Pickup Instructions for their Curbside Pickup fulfillment method.

This functionality is more related to Store Pickup, but I figured it would be better to capture it here with the rest of the Location specific attributes.