From 168ca19227c4c7d3a5592c47498f48410c719601 Mon Sep 17 00:00:00 2001 From: Alexander Schranz Date: Tue, 30 Jul 2019 22:07:31 +0200 Subject: [PATCH] Add onHand to product response --- doc/swagger.yml | 3 +++ spec/Factory/Product/ProductVariantViewFactorySpec.php | 2 ++ src/Factory/Product/ProductVariantViewFactory.php | 1 + .../config/serializer/Product/ProductVariantView.yml | 3 +++ src/View/Product/ProductVariantView.php | 3 +++ tests/DataFixtures/ORM/shop.yml | 1 + .../cart/add_multiple_products_to_cart_response.json | 3 +++ .../add_multiple_products_to_new_cart_response.json | 3 +++ ...sed_on_options_multiple_times_to_cart_response.json | 1 + ...duct_variant_based_on_options_to_cart_response.json | 1 + ...roduct_variant_multiple_times_to_cart_response.json | 1 + .../cart/add_product_variant_to_cart_response.json | 1 + ...simple_product_multiple_times_to_cart_response.json | 1 + .../cart/add_simple_product_to_cart_response.json | 1 + .../cart/add_simple_product_to_new_cart_response.json | 1 + ...t_with_coupon_based_promotion_applied_response.json | 1 + ...led_cart_with_product_variant_summary_response.json | 2 ++ ...lled_cart_with_simple_product_summary_response.json | 1 + ...led_cart_with_product_variant_summary_response.json | 1 + ...lled_cart_with_simple_product_summary_response.json | 1 + .../Expected/cart/recalculated_cart_after_log_in.json | 1 + .../cart/reprocessed_cart_after_deleting_an_item.json | 1 + .../Expected/checkout/cart_addressed_response.json | 1 + ...ifferent_shipping_and_billing_address_response.json | 1 + .../checkout/cart_with_chosen_payment_response.json | 1 + .../checkout/cart_with_chosen_shipment_response.json | 1 + ...th_chosen_shipment_with_per_item_rate_response.json | 1 + ...th_chosen_shipment_with_per_item_rate_response.json | 1 + .../Expected/order/order_details_response.json | 1 + .../Expected/order/order_details_response_guest.json | 1 + .../Responses/Expected/order/orders_list_response.json | 1 + .../german_product_list_page_by_code_response.json | 8 ++++++++ .../german_product_list_page_by_slug_response.json | 8 ++++++++ .../german_product_with_options_details_page.json | 7 +++++++ .../product/german_simple_product_details_page.json | 1 + .../limited_product_list_page_by_code_response.json | 2 ++ .../limited_product_list_page_by_slug_response.json | 2 ++ .../product/product_list_latest_2_response.json | 8 ++++++++ .../product/product_list_latest_4_response.json | 10 ++++++++++ .../product/product_list_page_by_code_response.json | 10 ++++++++++ .../product/product_list_page_by_slug_response.json | 10 ++++++++++ .../product_t_shirt_list_page_by_code_response.json | 2 ++ .../product_t_shirt_list_page_by_slug_response.json | 2 ++ .../product/product_with_options_details_page.json | 7 +++++++ .../product/product_with_variant_details_page.json | 2 ++ .../Expected/product/simple_product_details_page.json | 1 + 46 files changed, 123 insertions(+) diff --git a/doc/swagger.yml b/doc/swagger.yml index c5126358e..99a66c9d0 100644 --- a/doc/swagger.yml +++ b/doc/swagger.yml @@ -1334,6 +1334,9 @@ definitions: type: "object" additionalProperties: type: "string" + onHand: + type: "integer" + example: 12 price: $ref: "#/definitions/Price" images: diff --git a/spec/Factory/Product/ProductVariantViewFactorySpec.php b/spec/Factory/Product/ProductVariantViewFactorySpec.php index 4b3c9d92f..4d1845df1 100644 --- a/spec/Factory/Product/ProductVariantViewFactorySpec.php +++ b/spec/Factory/Product/ProductVariantViewFactorySpec.php @@ -52,6 +52,7 @@ function it_builds_product_variant_view( $variantView = new ProductVariantView(); $variant->getCode()->willReturn('SMALL_RED_LOGAN_HAT_CODE'); + $variant->getOnHand()->willReturn(12); $variant->getTranslation('en_GB')->willReturn($productVariantTranslation); $variant->getChannelPricingForChannel($channel)->willReturn($channelPrice); $variant->getOptionValues()->willReturn(new ArrayCollection([ @@ -85,6 +86,7 @@ function it_builds_product_variant_view( $variantView->name = 'Small red Logan hat code'; $variantView->price = new PriceView(); $variantView->axis = ['HAT_SIZE_S', 'HAT_COLOR_RED']; + $variantView->onHand = 12; $variantView->nameAxis = [ 'HAT_SIZE_S' => 'Size S', 'HAT_COLOR_RED' => 'Color Red', diff --git a/src/Factory/Product/ProductVariantViewFactory.php b/src/Factory/Product/ProductVariantViewFactory.php index 0f5a8eb90..23db45071 100644 --- a/src/Factory/Product/ProductVariantViewFactory.php +++ b/src/Factory/Product/ProductVariantViewFactory.php @@ -37,6 +37,7 @@ public function create(ProductVariantInterface $variant, ChannelInterface $chann $variantView->code = $variant->getCode(); $variantView->name = $variant->getTranslation($locale)->getName(); + $variantView->onHand = $variant->getOnHand(); $variantView->price = $this->priceViewFactory->create( $channelPricing->getPrice(), $channel->getBaseCurrency()->getCode() diff --git a/src/Resources/config/serializer/Product/ProductVariantView.yml b/src/Resources/config/serializer/Product/ProductVariantView.yml index 4ad3e337c..8ad42d134 100644 --- a/src/Resources/config/serializer/Product/ProductVariantView.yml +++ b/src/Resources/config/serializer/Product/ProductVariantView.yml @@ -14,6 +14,9 @@ Sylius\ShopApiPlugin\View\Product\ProductVariantView: nameAxis: expose: true type: array + onHand: + expose: true + type: int price: expose: true type: Sylius\ShopApiPlugin\View\PriceView diff --git a/src/View/Product/ProductVariantView.php b/src/View/Product/ProductVariantView.php index 0d03fb905..cf44696b3 100644 --- a/src/View/Product/ProductVariantView.php +++ b/src/View/Product/ProductVariantView.php @@ -21,6 +21,9 @@ class ProductVariantView /** @var array */ public $nameAxis = []; + /** @var int */ + public $onHand; + /** @var PriceView */ public $price; diff --git a/tests/DataFixtures/ORM/shop.yml b/tests/DataFixtures/ORM/shop.yml index 8299b715e..0466e4d67 100644 --- a/tests/DataFixtures/ORM/shop.yml +++ b/tests/DataFixtures/ORM/shop.yml @@ -117,6 +117,7 @@ Sylius\Component\Core\Model\ProductVariant: product: "@mug" currentLocale: "en_GB" translations: ["@en_gb_mug_variant_translation", "@de_de_mug_variant_translation"] + onHand: 12 channelPricings: WEB_GB: "@gb_mug_web_channel_pricing" WEB_DE: "@de_mug_web_channel_pricing" diff --git a/tests/Responses/Expected/cart/add_multiple_products_to_cart_response.json b/tests/Responses/Expected/cart/add_multiple_products_to_cart_response.json index 7864db4cb..5f637bcb9 100644 --- a/tests/Responses/Expected/cart/add_multiple_products_to_cart_response.json +++ b/tests/Responses/Expected/cart/add_multiple_products_to_cart_response.json @@ -29,6 +29,7 @@ "name": "Logan Mug", "axis": [], "nameAxis": {}, + "onHand": 12, "price": { "current": 1999, "currency": "GBP" @@ -81,6 +82,7 @@ "name": "Small Logan T-Shirt", "axis": [], "nameAxis": {}, + "onHand": 0, "price": { "current": 1999, "currency": "GBP" @@ -141,6 +143,7 @@ "HAT_SIZE_S": "Size S", "HAT_COLOR_RED": "Color Red" }, + "onHand": 0, "price": { "current": 500, "currency": "GBP" diff --git a/tests/Responses/Expected/cart/add_multiple_products_to_new_cart_response.json b/tests/Responses/Expected/cart/add_multiple_products_to_new_cart_response.json index b3ce6804e..c06223ad3 100644 --- a/tests/Responses/Expected/cart/add_multiple_products_to_new_cart_response.json +++ b/tests/Responses/Expected/cart/add_multiple_products_to_new_cart_response.json @@ -29,6 +29,7 @@ "name": "Logan Mug", "axis": [], "nameAxis": {}, + "onHand": 12, "price": { "current": 1999, "currency": "GBP" @@ -81,6 +82,7 @@ "name": "Small Logan T-Shirt", "axis": [], "nameAxis": {}, + "onHand": 0, "price": { "current": 1999, "currency": "GBP" @@ -141,6 +143,7 @@ "HAT_SIZE_S": "Size S", "HAT_COLOR_RED": "Color Red" }, + "onHand": 0, "price": { "current": 500, "currency": "GBP" diff --git a/tests/Responses/Expected/cart/add_product_variant_based_on_options_multiple_times_to_cart_response.json b/tests/Responses/Expected/cart/add_product_variant_based_on_options_multiple_times_to_cart_response.json index 2520e8371..050bf7e07 100644 --- a/tests/Responses/Expected/cart/add_product_variant_based_on_options_multiple_times_to_cart_response.json +++ b/tests/Responses/Expected/cart/add_product_variant_based_on_options_multiple_times_to_cart_response.json @@ -35,6 +35,7 @@ "HAT_SIZE_S": "Size S", "HAT_COLOR_RED": "Color Red" }, + "onHand": 0, "price": { "current": 500, "currency": "GBP" diff --git a/tests/Responses/Expected/cart/add_product_variant_based_on_options_to_cart_response.json b/tests/Responses/Expected/cart/add_product_variant_based_on_options_to_cart_response.json index c5ba71795..cfcf1d5c0 100644 --- a/tests/Responses/Expected/cart/add_product_variant_based_on_options_to_cart_response.json +++ b/tests/Responses/Expected/cart/add_product_variant_based_on_options_to_cart_response.json @@ -35,6 +35,7 @@ "HAT_SIZE_S": "Size S", "HAT_COLOR_RED": "Color Red" }, + "onHand": 0, "price": { "current": 500, "currency": "GBP" diff --git a/tests/Responses/Expected/cart/add_product_variant_multiple_times_to_cart_response.json b/tests/Responses/Expected/cart/add_product_variant_multiple_times_to_cart_response.json index 0a578c293..08bfa5603 100644 --- a/tests/Responses/Expected/cart/add_product_variant_multiple_times_to_cart_response.json +++ b/tests/Responses/Expected/cart/add_product_variant_multiple_times_to_cart_response.json @@ -29,6 +29,7 @@ "name": "Small Logan T-Shirt", "axis": [], "nameAxis": {}, + "onHand": 0, "price": { "current": 1999, "currency": "GBP" diff --git a/tests/Responses/Expected/cart/add_product_variant_to_cart_response.json b/tests/Responses/Expected/cart/add_product_variant_to_cart_response.json index accbaa6ec..5e37d8111 100644 --- a/tests/Responses/Expected/cart/add_product_variant_to_cart_response.json +++ b/tests/Responses/Expected/cart/add_product_variant_to_cart_response.json @@ -29,6 +29,7 @@ "name": "Small Logan T-Shirt", "axis": [], "nameAxis": {}, + "onHand": 0, "price": { "current": 1999, "currency": "GBP" diff --git a/tests/Responses/Expected/cart/add_simple_product_multiple_times_to_cart_response.json b/tests/Responses/Expected/cart/add_simple_product_multiple_times_to_cart_response.json index 09011e06a..9d57492bd 100644 --- a/tests/Responses/Expected/cart/add_simple_product_multiple_times_to_cart_response.json +++ b/tests/Responses/Expected/cart/add_simple_product_multiple_times_to_cart_response.json @@ -29,6 +29,7 @@ "name": "Logan Mug", "axis": [], "nameAxis": {}, + "onHand": 12, "price": { "current": 1999, "currency": "GBP" diff --git a/tests/Responses/Expected/cart/add_simple_product_to_cart_response.json b/tests/Responses/Expected/cart/add_simple_product_to_cart_response.json index c90e34457..3e8a4e794 100644 --- a/tests/Responses/Expected/cart/add_simple_product_to_cart_response.json +++ b/tests/Responses/Expected/cart/add_simple_product_to_cart_response.json @@ -29,6 +29,7 @@ "name": "Logan Mug", "axis": [], "nameAxis": {}, + "onHand": 12, "price": { "current": 1999, "currency": "GBP" diff --git a/tests/Responses/Expected/cart/add_simple_product_to_new_cart_response.json b/tests/Responses/Expected/cart/add_simple_product_to_new_cart_response.json index be0dab646..c5691b31c 100644 --- a/tests/Responses/Expected/cart/add_simple_product_to_new_cart_response.json +++ b/tests/Responses/Expected/cart/add_simple_product_to_new_cart_response.json @@ -29,6 +29,7 @@ "name": "Logan Mug", "axis": [], "nameAxis": {}, + "onHand": 12, "price": { "current": 1999, "currency": "GBP" diff --git a/tests/Responses/Expected/cart/cart_with_coupon_based_promotion_applied_response.json b/tests/Responses/Expected/cart/cart_with_coupon_based_promotion_applied_response.json index 4354413e6..8adbabddd 100644 --- a/tests/Responses/Expected/cart/cart_with_coupon_based_promotion_applied_response.json +++ b/tests/Responses/Expected/cart/cart_with_coupon_based_promotion_applied_response.json @@ -29,6 +29,7 @@ "name": "Logan Mug", "axis": [], "nameAxis": {}, + "onHand": 12, "price": { "current": 1999, "currency": "GBP" diff --git a/tests/Responses/Expected/cart/filled_cart_with_product_variant_summary_response.json b/tests/Responses/Expected/cart/filled_cart_with_product_variant_summary_response.json index 70a3dbd8d..1ebdac71e 100644 --- a/tests/Responses/Expected/cart/filled_cart_with_product_variant_summary_response.json +++ b/tests/Responses/Expected/cart/filled_cart_with_product_variant_summary_response.json @@ -29,6 +29,7 @@ "name": "Small Logan T-Shirt", "axis": [], "nameAxis": {}, + "onHand": 0, "price": { "current": 1999, "currency": "GBP" @@ -89,6 +90,7 @@ "HAT_SIZE_S": "Size S", "HAT_COLOR_RED": "Color Red" }, + "onHand": 0, "price": { "current": 500, "currency": "GBP" diff --git a/tests/Responses/Expected/cart/filled_cart_with_simple_product_summary_response.json b/tests/Responses/Expected/cart/filled_cart_with_simple_product_summary_response.json index aa900bef3..393cd2ae7 100644 --- a/tests/Responses/Expected/cart/filled_cart_with_simple_product_summary_response.json +++ b/tests/Responses/Expected/cart/filled_cart_with_simple_product_summary_response.json @@ -29,6 +29,7 @@ "name": "Logan Mug", "axis": [], "nameAxis": {}, + "onHand": 12, "price": { "current": 1999, "currency": "GBP" diff --git a/tests/Responses/Expected/cart/german_filled_cart_with_product_variant_summary_response.json b/tests/Responses/Expected/cart/german_filled_cart_with_product_variant_summary_response.json index d6687df3b..dc20452f6 100644 --- a/tests/Responses/Expected/cart/german_filled_cart_with_product_variant_summary_response.json +++ b/tests/Responses/Expected/cart/german_filled_cart_with_product_variant_summary_response.json @@ -35,6 +35,7 @@ "HAT_SIZE_S": "Size S", "HAT_COLOR_RED": "Farbe Rot" }, + "onHand": 0, "price": { "current": 590, "currency": "EUR" diff --git a/tests/Responses/Expected/cart/german_filled_cart_with_simple_product_summary_response.json b/tests/Responses/Expected/cart/german_filled_cart_with_simple_product_summary_response.json index 5e0dfd0f5..61570a76c 100644 --- a/tests/Responses/Expected/cart/german_filled_cart_with_simple_product_summary_response.json +++ b/tests/Responses/Expected/cart/german_filled_cart_with_simple_product_summary_response.json @@ -28,6 +28,7 @@ "name": "Logan Becher", "axis": [], "nameAxis": {}, + "onHand": 12, "price": { "current": 2099, "currency": "EUR" diff --git a/tests/Responses/Expected/cart/recalculated_cart_after_log_in.json b/tests/Responses/Expected/cart/recalculated_cart_after_log_in.json index 2df518c57..3ff3546b1 100644 --- a/tests/Responses/Expected/cart/recalculated_cart_after_log_in.json +++ b/tests/Responses/Expected/cart/recalculated_cart_after_log_in.json @@ -29,6 +29,7 @@ "name": "Logan Mug", "axis": [], "nameAxis": {}, + "onHand": 12, "price": { "current": 1999, "currency": "GBP" diff --git a/tests/Responses/Expected/cart/reprocessed_cart_after_deleting_an_item.json b/tests/Responses/Expected/cart/reprocessed_cart_after_deleting_an_item.json index 3e41ad834..410c3d34e 100644 --- a/tests/Responses/Expected/cart/reprocessed_cart_after_deleting_an_item.json +++ b/tests/Responses/Expected/cart/reprocessed_cart_after_deleting_an_item.json @@ -29,6 +29,7 @@ "name": "Logan Mug", "axis": [], "nameAxis": {}, + "onHand": 12, "price": { "current": 1999, "currency": "GBP" diff --git a/tests/Responses/Expected/checkout/cart_addressed_response.json b/tests/Responses/Expected/checkout/cart_addressed_response.json index 1838677cd..c4943ef0d 100644 --- a/tests/Responses/Expected/checkout/cart_addressed_response.json +++ b/tests/Responses/Expected/checkout/cart_addressed_response.json @@ -29,6 +29,7 @@ "name": "Logan Mug", "axis": [], "nameAxis": {}, + "onHand": 12, "price": { "current": 1999, "currency": "GBP" diff --git a/tests/Responses/Expected/checkout/cart_addressed_with_different_shipping_and_billing_address_response.json b/tests/Responses/Expected/checkout/cart_addressed_with_different_shipping_and_billing_address_response.json index f9177546c..7ffe5daea 100644 --- a/tests/Responses/Expected/checkout/cart_addressed_with_different_shipping_and_billing_address_response.json +++ b/tests/Responses/Expected/checkout/cart_addressed_with_different_shipping_and_billing_address_response.json @@ -29,6 +29,7 @@ "name": "Logan Mug", "axis": [], "nameAxis": {}, + "onHand": 12, "price": { "current": 1999, "currency": "GBP" diff --git a/tests/Responses/Expected/checkout/cart_with_chosen_payment_response.json b/tests/Responses/Expected/checkout/cart_with_chosen_payment_response.json index b694700af..43ed14b88 100644 --- a/tests/Responses/Expected/checkout/cart_with_chosen_payment_response.json +++ b/tests/Responses/Expected/checkout/cart_with_chosen_payment_response.json @@ -29,6 +29,7 @@ "name": "Logan Mug", "axis": [], "nameAxis": {}, + "onHand": 12, "price": { "current": 1999, "currency": "GBP" diff --git a/tests/Responses/Expected/checkout/cart_with_chosen_shipment_response.json b/tests/Responses/Expected/checkout/cart_with_chosen_shipment_response.json index 8c19efe09..206403081 100644 --- a/tests/Responses/Expected/checkout/cart_with_chosen_shipment_response.json +++ b/tests/Responses/Expected/checkout/cart_with_chosen_shipment_response.json @@ -29,6 +29,7 @@ "name": "Logan Mug", "axis": [], "nameAxis": {}, + "onHand": 12, "price": { "current": 1999, "currency": "GBP" diff --git a/tests/Responses/Expected/checkout/cart_with_chosen_shipment_with_per_item_rate_response.json b/tests/Responses/Expected/checkout/cart_with_chosen_shipment_with_per_item_rate_response.json index fc20b9a9d..3ea3449bc 100644 --- a/tests/Responses/Expected/checkout/cart_with_chosen_shipment_with_per_item_rate_response.json +++ b/tests/Responses/Expected/checkout/cart_with_chosen_shipment_with_per_item_rate_response.json @@ -29,6 +29,7 @@ "name": "Logan Mug", "axis": [], "nameAxis": {}, + "onHand": 12, "price": { "current": 1999, "currency": "GBP" diff --git a/tests/Responses/Expected/checkout/modified_cart_with_chosen_shipment_with_per_item_rate_response.json b/tests/Responses/Expected/checkout/modified_cart_with_chosen_shipment_with_per_item_rate_response.json index 1a36b02f3..c8682ca55 100644 --- a/tests/Responses/Expected/checkout/modified_cart_with_chosen_shipment_with_per_item_rate_response.json +++ b/tests/Responses/Expected/checkout/modified_cart_with_chosen_shipment_with_per_item_rate_response.json @@ -29,6 +29,7 @@ "name": "Logan Mug", "axis": [], "nameAxis": {}, + "onHand": 12, "price": { "current": 1999, "currency": "GBP" diff --git a/tests/Responses/Expected/order/order_details_response.json b/tests/Responses/Expected/order/order_details_response.json index f90f5e5e9..d330704c5 100644 --- a/tests/Responses/Expected/order/order_details_response.json +++ b/tests/Responses/Expected/order/order_details_response.json @@ -29,6 +29,7 @@ "name": "Logan Mug", "axis": [], "nameAxis": {}, + "onHand": 12, "price": { "current": 1999, "currency": "GBP" diff --git a/tests/Responses/Expected/order/order_details_response_guest.json b/tests/Responses/Expected/order/order_details_response_guest.json index c2c85d7f2..39413deee 100644 --- a/tests/Responses/Expected/order/order_details_response_guest.json +++ b/tests/Responses/Expected/order/order_details_response_guest.json @@ -29,6 +29,7 @@ "name": "Logan Mug", "axis": [], "nameAxis": {}, + "onHand": 12, "price": { "current": 1999, "currency": "GBP" diff --git a/tests/Responses/Expected/order/orders_list_response.json b/tests/Responses/Expected/order/orders_list_response.json index 978a596c3..73f33421a 100644 --- a/tests/Responses/Expected/order/orders_list_response.json +++ b/tests/Responses/Expected/order/orders_list_response.json @@ -30,6 +30,7 @@ "name": "Logan Mug", "axis": [], "nameAxis": {}, + "onHand": 12, "price": { "current": 1999, "currency": "GBP" diff --git a/tests/Responses/Expected/product/german_product_list_page_by_code_response.json b/tests/Responses/Expected/product/german_product_list_page_by_code_response.json index c2f65bd8d..2b2998d28 100644 --- a/tests/Responses/Expected/product/german_product_list_page_by_code_response.json +++ b/tests/Responses/Expected/product/german_product_list_page_by_code_response.json @@ -29,6 +29,7 @@ "name": "Logan Becher", "axis": [], "nameAxis": {}, + "onHand": 12, "price": { "current": 1999, "currency": "GBP" @@ -87,6 +88,7 @@ "HAT_SIZE_S": "Size S", "HAT_COLOR_RED": "Farbe Rot" }, + "onHand": 0, "price": { "current": 500, "currency": "GBP" @@ -104,6 +106,7 @@ "HAT_SIZE_L": "Size L", "HAT_COLOR_RED": "Farbe Rot" }, + "onHand": 0, "price": { "current": 999, "currency": "GBP" @@ -121,6 +124,7 @@ "HAT_SIZE_S": "Size S", "HAT_COLOR_BLUE": "Farbe Blau" }, + "onHand": 0, "price": { "current": 1500, "currency": "GBP" @@ -138,6 +142,7 @@ "HAT_SIZE_L": "Size L", "HAT_COLOR_BLUE": "Farbe Blau" }, + "onHand": 0, "price": { "current": 2599, "currency": "GBP" @@ -167,6 +172,7 @@ "name": "Logan Becher", "axis": [], "nameAxis": {}, + "onHand": 12, "price": { "current": 1999, "currency": "GBP" @@ -219,6 +225,7 @@ "name": "Small Logan T-Shirt", "axis": [], "nameAxis": {}, + "onHand": 0, "price": { "current": 1999, "currency": "GBP" @@ -235,6 +242,7 @@ "name": "Large Logan T-Shirt", "axis": [], "nameAxis": {}, + "onHand": 0, "price": { "current": 2999, "currency": "GBP" diff --git a/tests/Responses/Expected/product/german_product_list_page_by_slug_response.json b/tests/Responses/Expected/product/german_product_list_page_by_slug_response.json index 171bf944d..47870c824 100644 --- a/tests/Responses/Expected/product/german_product_list_page_by_slug_response.json +++ b/tests/Responses/Expected/product/german_product_list_page_by_slug_response.json @@ -29,6 +29,7 @@ "name": "Logan Becher", "axis": [], "nameAxis": {}, + "onHand": 12, "price": { "current": 1999, "currency": "GBP" @@ -87,6 +88,7 @@ "HAT_SIZE_S": "Size S", "HAT_COLOR_RED": "Farbe Rot" }, + "onHand": 0, "price": { "current": 500, "currency": "GBP" @@ -104,6 +106,7 @@ "HAT_SIZE_L": "Size L", "HAT_COLOR_RED": "Farbe Rot" }, + "onHand": 0, "price": { "current": 999, "currency": "GBP" @@ -121,6 +124,7 @@ "HAT_SIZE_S": "Size S", "HAT_COLOR_BLUE": "Farbe Blau" }, + "onHand": 0, "price": { "current": 1500, "currency": "GBP" @@ -138,6 +142,7 @@ "HAT_SIZE_L": "Size L", "HAT_COLOR_BLUE": "Farbe Blau" }, + "onHand": 0, "price": { "current": 2599, "currency": "GBP" @@ -167,6 +172,7 @@ "name": "Logan Becher", "axis": [], "nameAxis": {}, + "onHand": 12, "price": { "current": 1999, "currency": "GBP" @@ -219,6 +225,7 @@ "name": "Small Logan T-Shirt", "axis": [], "nameAxis": {}, + "onHand": 0, "price": { "current": 1999, "currency": "GBP" @@ -235,6 +242,7 @@ "name": "Large Logan T-Shirt", "axis": [], "nameAxis": {}, + "onHand": 0, "price": { "current": 2999, "currency": "GBP" diff --git a/tests/Responses/Expected/product/german_product_with_options_details_page.json b/tests/Responses/Expected/product/german_product_with_options_details_page.json index 87871fba7..543aefad5 100644 --- a/tests/Responses/Expected/product/german_product_with_options_details_page.json +++ b/tests/Responses/Expected/product/german_product_with_options_details_page.json @@ -25,6 +25,7 @@ "HAT_SIZE_S": "Size S", "HAT_COLOR_RED": "Farbe Rot" }, + "onHand": 0, "price": { "current": 500, "currency": "GBP" @@ -42,6 +43,7 @@ "HAT_SIZE_L": "Size L", "HAT_COLOR_RED": "Farbe Rot" }, + "onHand": 0, "price": { "current": 999, "currency": "GBP" @@ -59,6 +61,7 @@ "HAT_SIZE_S": "Size S", "HAT_COLOR_BLUE": "Farbe Blau" }, + "onHand": 0, "price": { "current": 1500, "currency": "GBP" @@ -76,6 +79,7 @@ "HAT_SIZE_L": "Size L", "HAT_COLOR_BLUE": "Farbe Blau" }, + "onHand": 0, "price": { "current": 2599, "currency": "GBP" @@ -105,6 +109,7 @@ "name": "Logan Becher", "axis": [], "nameAxis": {}, + "onHand": 12, "price": { "current": 1999, "currency": "GBP" @@ -157,6 +162,7 @@ "name": "Small Logan T-Shirt", "axis": [], "nameAxis": {}, + "onHand": 0, "price": { "current": 1999, "currency": "GBP" @@ -173,6 +179,7 @@ "name": "Large Logan T-Shirt", "axis": [], "nameAxis": {}, + "onHand": 0, "price": { "current": 2999, "currency": "GBP" diff --git a/tests/Responses/Expected/product/german_simple_product_details_page.json b/tests/Responses/Expected/product/german_simple_product_details_page.json index ac909a0a5..82f75f949 100644 --- a/tests/Responses/Expected/product/german_simple_product_details_page.json +++ b/tests/Responses/Expected/product/german_simple_product_details_page.json @@ -18,6 +18,7 @@ "name": "Logan Becher", "axis": [], "nameAxis": {}, + "onHand": 12, "price": { "current": 1999, "currency": "GBP" diff --git a/tests/Responses/Expected/product/limited_product_list_page_by_code_response.json b/tests/Responses/Expected/product/limited_product_list_page_by_code_response.json index 12b319c3f..1604f3ff6 100644 --- a/tests/Responses/Expected/product/limited_product_list_page_by_code_response.json +++ b/tests/Responses/Expected/product/limited_product_list_page_by_code_response.json @@ -30,6 +30,7 @@ "name": "Small Logan T-Shirt", "axis": [], "nameAxis": {}, + "onHand": 0, "price": { "current": 1999, "currency": "GBP" @@ -46,6 +47,7 @@ "name": "Large Logan T-Shirt", "axis": [], "nameAxis": {}, + "onHand": 0, "price": { "current": 2999, "currency": "GBP" diff --git a/tests/Responses/Expected/product/limited_product_list_page_by_slug_response.json b/tests/Responses/Expected/product/limited_product_list_page_by_slug_response.json index 6e163f65d..965863143 100644 --- a/tests/Responses/Expected/product/limited_product_list_page_by_slug_response.json +++ b/tests/Responses/Expected/product/limited_product_list_page_by_slug_response.json @@ -30,6 +30,7 @@ "name": "Small Logan T-Shirt", "axis": [], "nameAxis": {}, + "onHand": 0, "price": { "current": 1999, "currency": "GBP" @@ -46,6 +47,7 @@ "name": "Large Logan T-Shirt", "axis": [], "nameAxis": {}, + "onHand": 0, "price": { "current": 2999, "currency": "GBP" diff --git a/tests/Responses/Expected/product/product_list_latest_2_response.json b/tests/Responses/Expected/product/product_list_latest_2_response.json index c94615557..5500d152f 100644 --- a/tests/Responses/Expected/product/product_list_latest_2_response.json +++ b/tests/Responses/Expected/product/product_list_latest_2_response.json @@ -26,6 +26,7 @@ "HAT_SIZE_S": "Size S", "HAT_COLOR_RED": "Color Red" }, + "onHand": 0, "price": { "current": 500, "currency": "GBP" @@ -43,6 +44,7 @@ "HAT_SIZE_L": "Size L", "HAT_COLOR_RED": "Color Red" }, + "onHand": 0, "price": { "current": 999, "currency": "GBP" @@ -60,6 +62,7 @@ "HAT_SIZE_S": "Size S", "HAT_COLOR_BLUE": "Color Blue" }, + "onHand": 0, "price": { "current": 1500, "currency": "GBP" @@ -77,6 +80,7 @@ "HAT_SIZE_L": "Size L", "HAT_COLOR_BLUE": "Color Blue" }, + "onHand": 0, "price": { "current": 2599, "currency": "GBP" @@ -107,6 +111,7 @@ "name": "Logan Mug", "axis": [], "nameAxis": {}, + "onHand": 12, "price": { "current": 1999, "currency": "GBP" @@ -159,6 +164,7 @@ "name": "Small Logan T-Shirt", "axis": [], "nameAxis": {}, + "onHand": 0, "price": { "current": 1999, "currency": "GBP" @@ -175,6 +181,7 @@ "name": "Large Logan T-Shirt", "axis": [], "nameAxis": {}, + "onHand": 0, "price": { "current": 2999, "currency": "GBP" @@ -238,6 +245,7 @@ "name": "Logan Mug", "axis": [], "nameAxis": {}, + "onHand": 12, "price": { "current": 1999, "currency": "GBP" diff --git a/tests/Responses/Expected/product/product_list_latest_4_response.json b/tests/Responses/Expected/product/product_list_latest_4_response.json index 1dd597fcb..329dc2668 100644 --- a/tests/Responses/Expected/product/product_list_latest_4_response.json +++ b/tests/Responses/Expected/product/product_list_latest_4_response.json @@ -26,6 +26,7 @@ "HAT_SIZE_S": "Size S", "HAT_COLOR_RED": "Color Red" }, + "onHand": 0, "price": { "current": 500, "currency": "GBP" @@ -43,6 +44,7 @@ "HAT_SIZE_L": "Size L", "HAT_COLOR_RED": "Color Red" }, + "onHand": 0, "price": { "current": 999, "currency": "GBP" @@ -60,6 +62,7 @@ "HAT_SIZE_S": "Size S", "HAT_COLOR_BLUE": "Color Blue" }, + "onHand": 0, "price": { "current": 1500, "currency": "GBP" @@ -77,6 +80,7 @@ "HAT_SIZE_L": "Size L", "HAT_COLOR_BLUE": "Color Blue" }, + "onHand": 0, "price": { "current": 2599, "currency": "GBP" @@ -107,6 +111,7 @@ "name": "Logan Mug", "axis": [], "nameAxis": {}, + "onHand": 12, "price": { "current": 1999, "currency": "GBP" @@ -159,6 +164,7 @@ "name": "Small Logan T-Shirt", "axis": [], "nameAxis": {}, + "onHand": 0, "price": { "current": 1999, "currency": "GBP" @@ -175,6 +181,7 @@ "name": "Large Logan T-Shirt", "axis": [], "nameAxis": {}, + "onHand": 0, "price": { "current": 2999, "currency": "GBP" @@ -238,6 +245,7 @@ "name": "Logan Mug", "axis": [], "nameAxis": {}, + "onHand": 12, "price": { "current": 1999, "currency": "GBP" @@ -310,6 +318,7 @@ "name": "Small Logan T-Shirt", "axis": [], "nameAxis": {}, + "onHand": 0, "price": { "current": 1999, "currency": "GBP" @@ -326,6 +335,7 @@ "name": "Large Logan T-Shirt", "axis": [], "nameAxis": {}, + "onHand": 0, "price": { "current": 2999, "currency": "GBP" diff --git a/tests/Responses/Expected/product/product_list_page_by_code_response.json b/tests/Responses/Expected/product/product_list_page_by_code_response.json index a79134e41..9025cc840 100644 --- a/tests/Responses/Expected/product/product_list_page_by_code_response.json +++ b/tests/Responses/Expected/product/product_list_page_by_code_response.json @@ -30,6 +30,7 @@ "name": "Logan Mug", "axis": [], "nameAxis": {}, + "onHand": 12, "price": { "current": 1999, "currency": "GBP" @@ -82,6 +83,7 @@ "name": "Small Logan T-Shirt", "axis": [], "nameAxis": {}, + "onHand": 0, "price": { "current": 1999, "currency": "GBP" @@ -98,6 +100,7 @@ "name": "Large Logan T-Shirt", "axis": [], "nameAxis": {}, + "onHand": 0, "price": { "current": 2999, "currency": "GBP" @@ -158,6 +161,7 @@ "HAT_SIZE_S": "Size S", "HAT_COLOR_RED": "Color Red" }, + "onHand": 0, "price": { "current": 500, "currency": "GBP" @@ -175,6 +179,7 @@ "HAT_SIZE_L": "Size L", "HAT_COLOR_RED": "Color Red" }, + "onHand": 0, "price": { "current": 999, "currency": "GBP" @@ -192,6 +197,7 @@ "HAT_SIZE_S": "Size S", "HAT_COLOR_BLUE": "Color Blue" }, + "onHand": 0, "price": { "current": 1500, "currency": "GBP" @@ -209,6 +215,7 @@ "HAT_SIZE_L": "Size L", "HAT_COLOR_BLUE": "Color Blue" }, + "onHand": 0, "price": { "current": 2599, "currency": "GBP" @@ -239,6 +246,7 @@ "name": "Logan Mug", "axis": [], "nameAxis": {}, + "onHand": 12, "price": { "current": 1999, "currency": "GBP" @@ -291,6 +299,7 @@ "name": "Small Logan T-Shirt", "axis": [], "nameAxis": {}, + "onHand": 0, "price": { "current": 1999, "currency": "GBP" @@ -307,6 +316,7 @@ "name": "Large Logan T-Shirt", "axis": [], "nameAxis": {}, + "onHand": 0, "price": { "current": 2999, "currency": "GBP" diff --git a/tests/Responses/Expected/product/product_list_page_by_slug_response.json b/tests/Responses/Expected/product/product_list_page_by_slug_response.json index 4aac6dd91..8daabb3ce 100644 --- a/tests/Responses/Expected/product/product_list_page_by_slug_response.json +++ b/tests/Responses/Expected/product/product_list_page_by_slug_response.json @@ -30,6 +30,7 @@ "name": "Logan Mug", "axis": [], "nameAxis": {}, + "onHand": 12, "price": { "current": 1999, "currency": "GBP" @@ -82,6 +83,7 @@ "name": "Small Logan T-Shirt", "axis": [], "nameAxis": {}, + "onHand": 0, "price": { "current": 1999, "currency": "GBP" @@ -98,6 +100,7 @@ "name": "Large Logan T-Shirt", "axis": [], "nameAxis": {}, + "onHand": 0, "price": { "current": 2999, "currency": "GBP" @@ -158,6 +161,7 @@ "HAT_SIZE_S": "Size S", "HAT_COLOR_RED": "Color Red" }, + "onHand": 0, "price": { "current": 500, "currency": "GBP" @@ -175,6 +179,7 @@ "HAT_SIZE_L": "Size L", "HAT_COLOR_RED": "Color Red" }, + "onHand": 0, "price": { "current": 999, "currency": "GBP" @@ -192,6 +197,7 @@ "HAT_SIZE_S": "Size S", "HAT_COLOR_BLUE": "Color Blue" }, + "onHand": 0, "price": { "current": 1500, "currency": "GBP" @@ -209,6 +215,7 @@ "HAT_SIZE_L": "Size L", "HAT_COLOR_BLUE": "Color Blue" }, + "onHand": 0, "price": { "current": 2599, "currency": "GBP" @@ -239,6 +246,7 @@ "name": "Logan Mug", "axis": [], "nameAxis": {}, + "onHand": 12, "price": { "current": 1999, "currency": "GBP" @@ -291,6 +299,7 @@ "name": "Small Logan T-Shirt", "axis": [], "nameAxis": {}, + "onHand": 0, "price": { "current": 1999, "currency": "GBP" @@ -307,6 +316,7 @@ "name": "Large Logan T-Shirt", "axis": [], "nameAxis": {}, + "onHand": 0, "price": { "current": 2999, "currency": "GBP" diff --git a/tests/Responses/Expected/product/product_t_shirt_list_page_by_code_response.json b/tests/Responses/Expected/product/product_t_shirt_list_page_by_code_response.json index c83914422..086ed3965 100644 --- a/tests/Responses/Expected/product/product_t_shirt_list_page_by_code_response.json +++ b/tests/Responses/Expected/product/product_t_shirt_list_page_by_code_response.json @@ -30,6 +30,7 @@ "name": "Small Logan T-Shirt", "axis": [], "nameAxis": {}, + "onHand": 0, "price": { "current": 1999, "currency": "GBP" @@ -46,6 +47,7 @@ "name": "Large Logan T-Shirt", "axis": [], "nameAxis": {}, + "onHand": 0, "price": { "current": 2999, "currency": "GBP" diff --git a/tests/Responses/Expected/product/product_t_shirt_list_page_by_slug_response.json b/tests/Responses/Expected/product/product_t_shirt_list_page_by_slug_response.json index 9870ae890..54674dfcd 100644 --- a/tests/Responses/Expected/product/product_t_shirt_list_page_by_slug_response.json +++ b/tests/Responses/Expected/product/product_t_shirt_list_page_by_slug_response.json @@ -30,6 +30,7 @@ "name": "Small Logan T-Shirt", "axis": [], "nameAxis": {}, + "onHand": 0, "price": { "current": 1999, "currency": "GBP" @@ -46,6 +47,7 @@ "name": "Large Logan T-Shirt", "axis": [], "nameAxis": {}, + "onHand": 0, "price": { "current": 2999, "currency": "GBP" diff --git a/tests/Responses/Expected/product/product_with_options_details_page.json b/tests/Responses/Expected/product/product_with_options_details_page.json index 9cf437c67..b0720fcd1 100644 --- a/tests/Responses/Expected/product/product_with_options_details_page.json +++ b/tests/Responses/Expected/product/product_with_options_details_page.json @@ -25,6 +25,7 @@ "HAT_SIZE_S": "Size S", "HAT_COLOR_RED": "Color Red" }, + "onHand": 0, "price": { "current": 500, "currency": "GBP" @@ -42,6 +43,7 @@ "HAT_SIZE_L": "Size L", "HAT_COLOR_RED": "Color Red" }, + "onHand": 0, "price": { "current": 999, "currency": "GBP" @@ -59,6 +61,7 @@ "HAT_SIZE_S": "Size S", "HAT_COLOR_BLUE": "Color Blue" }, + "onHand": 0, "price": { "current": 1500, "currency": "GBP" @@ -76,6 +79,7 @@ "HAT_SIZE_L": "Size L", "HAT_COLOR_BLUE": "Color Blue" }, + "onHand": 0, "price": { "current": 2599, "currency": "GBP" @@ -106,6 +110,7 @@ "name": "Logan Mug", "axis": [], "nameAxis": {}, + "onHand": 12, "price": { "current": 1999, "currency": "GBP" @@ -158,6 +163,7 @@ "name": "Small Logan T-Shirt", "axis": [], "nameAxis": {}, + "onHand": 0, "price": { "current": 1999, "currency": "GBP" @@ -174,6 +180,7 @@ "name": "Large Logan T-Shirt", "axis": [], "nameAxis": {}, + "onHand": 0, "price": { "current": 2999, "currency": "GBP" diff --git a/tests/Responses/Expected/product/product_with_variant_details_page.json b/tests/Responses/Expected/product/product_with_variant_details_page.json index 659b83fb2..fa037b39b 100644 --- a/tests/Responses/Expected/product/product_with_variant_details_page.json +++ b/tests/Responses/Expected/product/product_with_variant_details_page.json @@ -19,6 +19,7 @@ "name": "Small Logan T-Shirt", "axis": [], "nameAxis": {}, + "onHand": 0, "price": { "current": 1999, "currency": "GBP" @@ -35,6 +36,7 @@ "name": "Large Logan T-Shirt", "axis": [], "nameAxis": {}, + "onHand": 0, "price": { "current": 2999, "currency": "GBP" diff --git a/tests/Responses/Expected/product/simple_product_details_page.json b/tests/Responses/Expected/product/simple_product_details_page.json index 528f2ac4b..d4b1f2402 100644 --- a/tests/Responses/Expected/product/simple_product_details_page.json +++ b/tests/Responses/Expected/product/simple_product_details_page.json @@ -19,6 +19,7 @@ "name": "Logan Mug", "axis": [], "nameAxis": {}, + "onHand": 12, "price": { "current": 1999, "currency": "GBP"