-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Resolves #497 - Add support for multi-location inventory
- Loading branch information
1 parent
50d5fa2
commit 74c4753
Showing
4 changed files
with
58 additions
and
5 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -254,3 +254,6 @@ actions: | |
|
||
|
||
|
||
### Output JQ | ||
|
||
You will need to escape \ when using the `--output-jq` argument. |
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,6 +2,7 @@ name: "multi-location-inventory" | |
description: | ||
long: "Sample commands for working with Multi Location Inventory (https://elasticpath.dev/docs/api/pxm/inventory_mli/inventories-introduction)" | ||
short: "Multi Location Inventory" | ||
actions: | ||
create-prerequisites: | ||
description: | ||
short: "Create necessary prerequisites" | ||
|
@@ -30,17 +31,46 @@ description: | |
description: | ||
short: "Setup inventory" | ||
commands: | ||
- epcc create mli-inventory-location name "Milton Keynes Warehouse" slug "milton-keynes-warehouse" description "Southern dispatch location for all inventory" geolocation.lat '51.477928' geolocation.l | ||
- | | ||
epcc get -s mli-inventory-stocks | ||
epcc get -s mli-inventory-locations | ||
- | | ||
epcc create mli-inventory-location --if-alias-does-not-exist slug=milton-keynes-warehouse name "Milton Keynes Warehouse" slug "milton-keynes-warehouse" description "Southern dispatch location for all inventory" address[0] "Troughton Supplies" address[1] "38 Pipernel Grove" address[2] "Walnut Tree" address[3] "MK7 4UL" geolocation.lat '51.477928' geolocation.lon -- '-0.001545' | ||
epcc create mli-inventory-location --if-alias-does-not-exist slug=manchester-warehouse name "Manchester Warehouse" slug "manchester-warehouse" description "Northern dispatch location for all inventory" address[0] "Tonge Supplies" address[1] "10 Lower Darcy St" address[2] "Bolton" address[3] "BL2 1PP" geolocation.lat '53.5707004' geolocation.lon -- '-2.4071741' | ||
- | | ||
epcc create mli-inventory-stock --if-alias-does-not-exist BestEverRangeStock --save-as-alias BestEverRangeStock id name=BestEver_Electric_Range locations.milton-keynes-warehouse.available 1 locations.manchester-warehouse.available 2 | ||
epcc create mli-inventory-stock --if-alias-does-not-exist GasRangeStock --save-as-alias GasRangeStock id name=BestEver_Gas_Range locations.milton-keynes-warehouse.available 0 locations.manchester-warehouse.available 1 | ||
reset-inventory: | ||
description: | ||
short: "Reset inventory" | ||
commands: | ||
- | | ||
epcc get -s mli-inventory-stocks | ||
epcc get -s mli-inventory-locations | ||
- | | ||
epcc delete mli-inventory-stock BestEverRangeStock --if-alias-exists BestEverRangeStock | ||
epcc delete mli-inventory-stock GasRangeStock --if-alias-exists GasRangeStock | ||
- | | ||
epcc delete mli-inventory-location slug=milton-keynes-warehouse --if-alias-exists slug=milton-keynes-warehouse | ||
epcc delete mli-inventory-location slug=manchester-warehouse --if-alias-exists slug=manchester-warehouse | ||
create-order: | ||
description: | ||
short: "Create an order" | ||
commands: | ||
- epcc delete cart sample_cart | ||
- epcc create cart name sample_cart id sample_cart description sample_cart | ||
- epcc create cart-product-item id=sample_cart quantity 1 id sku=BE-Gas-Range-2b2b | ||
- epcc create cart-product-item id=sample_cart quantity 1 id sku=BE-Gas-Range-2b2b location manchester-warehouse | ||
- epcc create cart-checkout sample_cart customer.name Billy customer.email "[email protected]" billing_address.first_name Jack billing_address.last_name Macdowall billing_address.company_name Macdowalls billing_address.line_1 "1225 Invention Avenue" billing_address.line_2 Birmingham billing_address.postcode "B21 9AF" billing_address.county "West midlands" billing_address.country "UK" shipping_address.first_name Otis shipping_address.last_name Sedmak shipping_address.company_name "Sedmak & Co." shipping_address.line_1 "1251, Rexmere Ave" shipping_address.line_2 "Farmingville, Suffolk" shipping_address.postcode '"11738"' shipping_address.county "New York" shipping_address.country US shipping_address.instructions "Leave in porch" | ||
- epcc get order last_read=entity | ||
check-inventory: | ||
description: | ||
short: "Friendly printout of inventory" | ||
commands: | ||
- | | ||
epcc get mli-inventory-stocks --output-jq '.data[] | . as $root | "ID: \\\($root.id), Global: \\\($root.attributes.available), " + ($root.attributes.locations | to_entries | map("\\\(.key): \\\(.value.available)") | join(", "))' | ||
authorize-payment: | ||
description: | ||
short: "Authorize a payment" | ||
|
This file contains 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