Skip to content

Commit

Permalink
minor #512 Revert "Add onHand to product response" (lchrusciel, mamazu)
Browse files Browse the repository at this point in the history
This PR was merged into the 1.0-dev branch.

Discussion
----------

Reverts #503

Commits
-------

6ac03a5 Revert "Add onHand to product response"
2f96763 Fixing the spec tests
  • Loading branch information
mamazu authored Sep 21, 2019
2 parents c62c3f1 + 2f96763 commit cfd1d42
Show file tree
Hide file tree
Showing 46 changed files with 0 additions and 124 deletions.
3 changes: 0 additions & 3 deletions doc/swagger.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1321,9 +1321,6 @@ definitions:
type: "object"
additionalProperties:
type: "string"
onHand:
type: "integer"
example: 12
price:
$ref: "#/definitions/Price"
originalPrice:
Expand Down
3 changes: 0 additions & 3 deletions spec/Factory/Product/ProductVariantViewFactorySpec.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@ 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([
Expand Down Expand Up @@ -87,7 +86,6 @@ 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',
Expand Down Expand Up @@ -152,7 +150,6 @@ function it_builds_product_variant_view_with_original_price(
$variantView->price = new PriceView();
$variantView->originalPrice = new PriceView();
$variantView->axis = ['HAT_SIZE_S', 'HAT_COLOR_RED'];
$variantView->onHand = 0;
$variantView->nameAxis = [
'HAT_SIZE_S' => 'Size S',
'HAT_COLOR_RED' => 'Color Red',
Expand Down
1 change: 0 additions & 1 deletion src/Factory/Product/ProductVariantViewFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ 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()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,6 @@ Sylius\ShopApiPlugin\View\Product\ProductVariantView:
nameAxis:
expose: true
type: array<string, string>
onHand:
expose: true
type: int
price:
expose: true
type: Sylius\ShopApiPlugin\View\PriceView
Expand Down
3 changes: 0 additions & 3 deletions src/View/Product/ProductVariantView.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,6 @@ class ProductVariantView
/** @var array */
public $nameAxis = [];

/** @var int */
public $onHand;

/** @var PriceView */
public $price;

Expand Down
1 change: 0 additions & 1 deletion tests/DataFixtures/ORM/shop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,6 @@ 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"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@
"name": "Logan Mug",
"axis": [],
"nameAxis": {},
"onHand": 12,
"price": {
"current": 1999,
"currency": "GBP"
Expand Down Expand Up @@ -86,7 +85,6 @@
"name": "Small Logan T-Shirt",
"axis": [],
"nameAxis": {},
"onHand": 0,
"price": {
"current": 1999,
"currency": "GBP"
Expand Down Expand Up @@ -147,7 +145,6 @@
"HAT_SIZE_S": "Size S",
"HAT_COLOR_RED": "Color Red"
},
"onHand": 0,
"price": {
"current": 500,
"currency": "GBP"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@
"name": "Logan Mug",
"axis": [],
"nameAxis": {},
"onHand": 12,
"price": {
"current": 1999,
"currency": "GBP"
Expand Down Expand Up @@ -86,7 +85,6 @@
"name": "Small Logan T-Shirt",
"axis": [],
"nameAxis": {},
"onHand": 0,
"price": {
"current": 1999,
"currency": "GBP"
Expand Down Expand Up @@ -147,7 +145,6 @@
"HAT_SIZE_S": "Size S",
"HAT_COLOR_RED": "Color Red"
},
"onHand": 0,
"price": {
"current": 500,
"currency": "GBP"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@
"HAT_SIZE_S": "Size S",
"HAT_COLOR_RED": "Color Red"
},
"onHand": 0,
"price": {
"current": 500,
"currency": "GBP"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@
"HAT_SIZE_S": "Size S",
"HAT_COLOR_RED": "Color Red"
},
"onHand": 0,
"price": {
"current": 500,
"currency": "GBP"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@
"name": "Small Logan T-Shirt",
"axis": [],
"nameAxis": {},
"onHand": 0,
"price": {
"current": 1999,
"currency": "GBP"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@
"name": "Small Logan T-Shirt",
"axis": [],
"nameAxis": {},
"onHand": 0,
"price": {
"current": 1999,
"currency": "GBP"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@
"name": "Logan Mug",
"axis": [],
"nameAxis": {},
"onHand": 12,
"price": {
"current": 1999,
"currency": "GBP"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@
"name": "Logan Mug",
"axis": [],
"nameAxis": {},
"onHand": 12,
"price": {
"current": 1999,
"currency": "GBP"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@
"name": "Logan Mug",
"axis": [],
"nameAxis": {},
"onHand": 12,
"price": {
"current": 1999,
"currency": "GBP"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@
"name": "Logan Mug",
"axis": [],
"nameAxis": {},
"onHand": 12,
"price": {
"current": 1999,
"currency": "GBP"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@
"name": "Small Logan T-Shirt",
"axis": [],
"nameAxis": {},
"onHand": 0,
"price": {
"current": 1999,
"currency": "GBP"
Expand Down Expand Up @@ -90,7 +89,6 @@
"HAT_SIZE_S": "Size S",
"HAT_COLOR_RED": "Color Red"
},
"onHand": 0,
"price": {
"current": 500,
"currency": "GBP"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@
"name": "Logan Mug",
"axis": [],
"nameAxis": {},
"onHand": 12,
"price": {
"current": 1999,
"currency": "GBP"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@
"HAT_SIZE_S": "Size S",
"HAT_COLOR_RED": "Farbe Rot"
},
"onHand": 0,
"price": {
"current": 590,
"currency": "EUR"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
"name": "Logan Becher",
"axis": [],
"nameAxis": {},
"onHand": 12,
"price": {
"current": 2099,
"currency": "EUR"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@
"name": "Logan Mug",
"axis": [],
"nameAxis": {},
"onHand": 12,
"price": {
"current": 1999,
"currency": "GBP"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@
"name": "Logan Mug",
"axis": [],
"nameAxis": {},
"onHand": 12,
"price": {
"current": 1999,
"currency": "GBP"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@
"name": "Logan Mug",
"axis": [],
"nameAxis": {},
"onHand": 12,
"price": {
"current": 1999,
"currency": "GBP"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@
"name": "Logan Mug",
"axis": [],
"nameAxis": {},
"onHand": 12,
"price": {
"current": 1999,
"currency": "GBP"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@
"name": "Logan Mug",
"axis": [],
"nameAxis": {},
"onHand": 12,
"price": {
"current": 1999,
"currency": "GBP"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@
"name": "Logan Mug",
"axis": [],
"nameAxis": {},
"onHand": 12,
"price": {
"current": 1999,
"currency": "GBP"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@
"name": "Logan Mug",
"axis": [],
"nameAxis": {},
"onHand": 12,
"price": {
"current": 1999,
"currency": "GBP"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@
"name": "Logan Mug",
"axis": [],
"nameAxis": {},
"onHand": 12,
"price": {
"current": 1999,
"currency": "GBP"
Expand Down
1 change: 0 additions & 1 deletion tests/Responses/Expected/order/order_details_response.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@
"name": "Logan Mug",
"axis": [],
"nameAxis": {},
"onHand": 12,
"price": {
"current": 1999,
"currency": "GBP"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@
"name": "Logan Mug",
"axis": [],
"nameAxis": {},
"onHand": 12,
"price": {
"current": 1999,
"currency": "GBP"
Expand Down
1 change: 0 additions & 1 deletion tests/Responses/Expected/order/orders_list_response.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@
"name": "Logan Mug",
"axis": [],
"nameAxis": {},
"onHand": 12,
"price": {
"current": 1999,
"currency": "GBP"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@
"name": "Logan Becher",
"axis": [],
"nameAxis": {},
"onHand": 12,
"price": {
"current": 1999,
"currency": "GBP"
Expand Down Expand Up @@ -92,7 +91,6 @@
"HAT_SIZE_S": "Size S",
"HAT_COLOR_RED": "Farbe Rot"
},
"onHand": 0,
"price": {
"current": 500,
"currency": "GBP"
Expand All @@ -110,7 +108,6 @@
"HAT_SIZE_L": "Size L",
"HAT_COLOR_RED": "Farbe Rot"
},
"onHand": 0,
"price": {
"current": 999,
"currency": "GBP"
Expand All @@ -128,7 +125,6 @@
"HAT_SIZE_S": "Size S",
"HAT_COLOR_BLUE": "Farbe Blau"
},
"onHand": 0,
"price": {
"current": 1500,
"currency": "GBP"
Expand All @@ -146,7 +142,6 @@
"HAT_SIZE_L": "Size L",
"HAT_COLOR_BLUE": "Farbe Blau"
},
"onHand": 0,
"price": {
"current": 2599,
"currency": "GBP"
Expand Down Expand Up @@ -176,7 +171,6 @@
"name": "Logan Becher",
"axis": [],
"nameAxis": {},
"onHand": 12,
"price": {
"current": 1999,
"currency": "GBP"
Expand Down Expand Up @@ -233,7 +227,6 @@
"name": "Small Logan T-Shirt",
"axis": [],
"nameAxis": {},
"onHand": 0,
"price": {
"current": 1999,
"currency": "GBP"
Expand All @@ -250,7 +243,6 @@
"name": "Large Logan T-Shirt",
"axis": [],
"nameAxis": {},
"onHand": 0,
"price": {
"current": 2999,
"currency": "GBP"
Expand Down
Loading

0 comments on commit cfd1d42

Please sign in to comment.