Skip to content

Commit 1c3e72a

Browse files
committed
MC-20508: Api-functional tests for Product prices including FPT
- add some docs to schema - fix static and revert Model tax
1 parent 04da245 commit 1c3e72a

File tree

4 files changed

+10
-24
lines changed

4 files changed

+10
-24
lines changed

app/code/Magento/CatalogGraphQl/etc/schema.graphqls

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ type PriceAdjustment @doc(description: "PriceAdjustment is deprecated. Taxes wil
2727
description: PriceAdjustmentDescriptionEnum @deprecated(reason: "PriceAdjustment is deprecated.") @doc(description: "Indicates whether the entity described by the code attribute is included or excluded from the adjustment.")
2828
}
2929

30-
enum PriceAdjustmentCodesEnum @doc(description: "PriceAdjustmentCodesEnum is deprecated. This enumeration contains values defined in modules other than the Catalog module.") {
30+
enum PriceAdjustmentCodesEnum @doc(description: "PriceAdjustment.code is deprecated. This enumeration contains values defined in modules other than the Catalog module.") {
3131
}
3232

3333
enum PriceAdjustmentDescriptionEnum @doc(description: "PriceAdjustmentDescriptionEnum is deprecated. This enumeration states whether a price adjustment is included or excluded.") {

app/code/Magento/TaxGraphQl/etc/schema.graphqls

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@
22
# See COPYING.txt for license details.
33

44
enum PriceAdjustmentCodesEnum {
5-
TAX
5+
TAX @deprecated(reason: "PriceAdjustmentCodesEnum is deprecated. Tax is included or excluded in price. Tax is not shown separtely in Catalog")
66
}

app/code/Magento/Weee/Model/Tax.php

Lines changed: 4 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,6 @@
1313
use Magento\Catalog\Model\Product\Type;
1414

1515
/**
16-
* Weee tax model
17-
*
1816
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
1917
* @api
2018
* @since 100.0.2
@@ -143,8 +141,6 @@ protected function _construct()
143141
}
144142

145143
/**
146-
* Get the weee amount
147-
*
148144
* @param Product $product
149145
* @param null|false|\Magento\Framework\DataObject $shipping
150146
* @param null|false|\Magento\Framework\DataObject $billing
@@ -174,8 +170,6 @@ public function getWeeeAmount(
174170
}
175171

176172
/**
177-
* Get the weee amount excluding tax
178-
*
179173
* @param Product $product
180174
* @param null|false|\Magento\Framework\DataObject $shipping
181175
* @param null|false|\Magento\Framework\DataObject $billing
@@ -206,8 +200,6 @@ public function getWeeeAmountExclTax(
206200
}
207201

208202
/**
209-
* Get the weee attribute codes
210-
*
211203
* @param bool $forceEnabled
212204
* @return array
213205
*/
@@ -219,8 +211,8 @@ public function getWeeeAttributeCodes($forceEnabled = false)
219211
/**
220212
* Retrieve Wee tax attribute codes
221213
*
222-
* @param null|string|bool|int|Store $store
223-
* @param bool $forceEnabled
214+
* @param null|string|bool|int|Store $store
215+
* @param bool $forceEnabled
224216
* @return array
225217
*/
226218
public function getWeeeTaxAttributeCodes($store = null, $forceEnabled = false)
@@ -236,8 +228,6 @@ public function getWeeeTaxAttributeCodes($store = null, $forceEnabled = false)
236228
}
237229

238230
/**
239-
* Retrieve the relevant wee tax attributes assigned to a product by location
240-
*
241231
* @param Product $product
242232
* @param null|false|\Magento\Quote\Model\Quote\Address $shipping
243233
* @param null|false|\Magento\Quote\Model\Quote\Address $billing
@@ -248,7 +238,6 @@ public function getWeeeTaxAttributeCodes($store = null, $forceEnabled = false)
248238
* @SuppressWarnings(PHPMD.CyclomaticComplexity)
249239
* @SuppressWarnings(PHPMD.NPathComplexity)
250240
* @SuppressWarnings(PHPMD.ExcessiveMethodLength)
251-
* phpcs:disable Generic.Metrics.NestingLevel
252241
*/
253242
public function getProductWeeeAttributes(
254243
$product,
@@ -279,7 +268,7 @@ public function getProductWeeeAttributes(
279268
return $result;
280269
}
281270

282-
/** @var Calculation $calculator */
271+
/** @var \Magento\Tax\Model\Calculation $calculator */
283272
$calculator = $this->_calculationFactory->create();
284273

285274
$customerId = $this->_customerSession->getCustomerId();
@@ -328,7 +317,7 @@ public function getProductWeeeAttributes(
328317
$amount = $value;
329318
$amountExclTax = $value;
330319
if ($calculateTax && $this->weeeConfig->isTaxable($store)) {
331-
/** @var Calculation $calculator */
320+
/** @var \Magento\Tax\Model\Calculation $calculator */
332321
$defaultPercent = $calculator->getRate(
333322
$defaultRateRequest->setProductClassId($product->getTaxClassId())
334323
);
@@ -381,13 +370,10 @@ public function getProductWeeeAttributes(
381370
$result[] = $one;
382371
}
383372
}
384-
385373
return $result;
386374
}
387375

388376
/**
389-
* Is there a weee attribute available for the location provided
390-
*
391377
* @param int $countryId
392378
* @param int $regionId
393379
* @param int $websiteId

app/code/Magento/WeeeGraphQl/etc/schema.graphqls

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
# Copyright © Magento, Inc. All rights reserved.
22
# See COPYING.txt for license details.
33

4-
enum PriceAdjustmentCodesEnum @doc(description: "PriceAdjustmentCodesEnum is deprecated, use ProductPrice.") {
5-
WEEE @deprecated(reason: "WEEE is deprecated, use fixed_product_taxes.label")
6-
WEEE_TAX @deprecated(reason: "WEEE_TAX is deprecated, use fixed_product_taxes. Tax is included or excluded in the amount")
4+
enum PriceAdjustmentCodesEnum {
5+
WEEE @deprecated(reason: "WEEE code is deprecated, use fixed_product_taxes.label")
6+
WEEE_TAX @deprecated(reason: "Use fixed_product_taxes. PriceAdjustmentCodesEnum is deprecated. Tax is included or excluded in price. Tax is not shown separtely in Catalog")
77
}
88

99
type ProductPrice {
10-
fixed_product_taxes: [FixedProductTax] @doc(description: "The multiple FPTs that can be applied to a product price.") @resolver(class: "Magento\\WeeeGraphQl\\Model\\Resolver\\FixedProductTax")
10+
fixed_product_taxes: [FixedProductTax] @doc(description: "The multiple FPTs that can be applied to a product price.") @resolver(class: "Magento\\WeeeGraphQl\\Model\\Resolver\\FixedProductTax")
1111
}
1212

1313
type FixedProductTax @doc(description: "A single FPT that can be applied to a product price.") {

0 commit comments

Comments
 (0)