Skip to content

Commit be83e05

Browse files
committed
MC-20638: MyAccount :: Order Details :: Shipping Details by Order Number
1 parent d1ccd92 commit be83e05

File tree

10 files changed

+36
-132
lines changed

10 files changed

+36
-132
lines changed

app/code/Magento/BundleGraphQl/Model/Order/Shipment/BundleShipmentItemFormatter.php

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,17 +10,34 @@
1010
use Magento\Catalog\Model\Product\Type\AbstractType;
1111
use Magento\Sales\Api\Data\ShipmentInterface;
1212
use Magento\Sales\Api\Data\ShipmentItemInterface;
13+
use Magento\SalesGraphQl\Model\Shipment\Item\ShipmentItemFormatter;
1314
use Magento\SalesGraphQl\Model\Shipment\Item\FormatterInterface;
1415

16+
/**
17+
* Format Bundle shipment items for GraphQl output
18+
*/
1519
class BundleShipmentItemFormatter implements FormatterInterface
1620
{
21+
/**
22+
* @var ShipmentItemFormatter
23+
*/
1724
private $itemFormatter;
1825

19-
public function __construct(FormatterInterface $itemFormatter)
26+
/**
27+
* @param ShipmentItemFormatter $itemFormatter
28+
*/
29+
public function __construct(ShipmentItemFormatter $itemFormatter)
2030
{
2131
$this->itemFormatter = $itemFormatter;
2232
}
2333

34+
/**
35+
* Format bundle product shipment item
36+
*
37+
* @param ShipmentInterface $shipment
38+
* @param ShipmentItemInterface $item
39+
* @return array|null
40+
*/
2441
public function formatShipmentItem(ShipmentInterface $shipment, ShipmentItemInterface $item): ?array
2542
{
2643
$orderItem = $item->getOrderItem();

app/code/Magento/BundleGraphQl/Model/Resolver/Order/Item/BundleOptions.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ public function resolve(Field $field, $context, ResolveInfo $info, array $value
6161
return $this->getBundleOptions($item, $value);
6262
}
6363
if ($value['model'] instanceof InvoiceItemInterface || $value['model'] instanceof ShipmentItemInterface) {
64-
/** @var InvoiceItemInterface $item */
64+
/** @var InvoiceItemInterface|ShipmentItemInterface $item */
6565
$item = $value['model'];
6666
// Have to pass down order and item to map to avoid refetching all data
6767
return $this->getBundleOptions($item->getOrderItem(), $value);

app/code/Magento/SalesGraphQl/Model/InvoiceItemTypeResolver.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,9 @@ class InvoiceItemTypeResolver implements TypeResolverInterface
2020
*/
2121
private $productTypeMap;
2222

23+
/**
24+
* @param array $productTypeMap
25+
*/
2326
public function __construct($productTypeMap = [])
2427
{
2528
$this->productTypeMap = $productTypeMap;
@@ -31,9 +34,7 @@ public function __construct($productTypeMap = [])
3134
public function resolveType(array $data): string
3235
{
3336
if (!isset($data['product_type'])) {
34-
throw new GraphQlInputException(
35-
__('Missing key %1 in sales item data', ['product_type'])
36-
);
37+
throw new GraphQlInputException(__('Missing key %1 in sales item data', ['product_type']));
3738
}
3839
if (isset($this->productTypeMap[$data['product_type']])) {
3940
return $this->productTypeMap[$data['product_type']];

app/code/Magento/SalesGraphQl/Model/OrderItemTypeResolver.php

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,16 @@
1515
*/
1616
class OrderItemTypeResolver implements TypeResolverInterface
1717
{
18+
/**
19+
* @var array
20+
*/
1821
private $productTypeMap;
1922

20-
public function __construct(array $productTypeMap = []){
23+
/**
24+
* @param array $productTypeMap
25+
*/
26+
public function __construct(array $productTypeMap = [])
27+
{
2128
$this->productTypeMap = $productTypeMap;
2229
}
2330

app/code/Magento/SalesGraphQl/Model/Resolver/Shipment/ShipmentItems.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
use Magento\Framework\GraphQl\Config\Element\Field;
1212
use Magento\Framework\GraphQl\Query\ResolverInterface;
1313
use Magento\Framework\GraphQl\Schema\Type\ResolveInfo;
14-
use Magento\Sales\Api\Data\OrderInterface;
1514
use Magento\Sales\Api\Data\ShipmentInterface;
1615
use Magento\SalesGraphQl\Model\Shipment\ItemProvider;
1716

app/code/Magento/SalesGraphQl/Model/Resolver/Shipments.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
use Magento\Framework\GraphQl\Schema\Type\ResolveInfo;
1414
use Magento\Sales\Api\Data\ShipmentInterface;
1515
use Magento\Sales\Model\Order;
16-
use Magento\Sales\Model\Order\Shipment;
1716

1817
/**
1918
* Resolve shipment information for order

app/code/Magento/SalesGraphQl/Model/Shipment/Item/ShipmentItemFormatter.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@
1010
use Magento\Sales\Api\Data\ShipmentInterface;
1111
use Magento\Sales\Api\Data\ShipmentItemInterface;
1212

13+
/**
14+
* Format shipment item for GraphQl output
15+
*/
1316
class ShipmentItemFormatter implements FormatterInterface
1417
{
1518
/**

app/code/Magento/SalesGraphQl/Model/Shipment/ItemProvider.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,8 @@ public function getItemData(ShipmentInterface $shipment): array
4949
}
5050

5151
/**
52+
* Format individual shipment item
53+
*
5254
* @param ShipmentInterface $shipment
5355
* @param ShipmentItemInterface $shipmentItem
5456
* @return array|null

dev/tests/integration/testsuite/Magento/Sales/_files/order_with_bundle_and_shipment.php

Lines changed: 0 additions & 114 deletions
This file was deleted.

dev/tests/integration/testsuite/Magento/Sales/_files/order_with_bundle_and_shipment_rollback.php

Lines changed: 0 additions & 10 deletions
This file was deleted.

0 commit comments

Comments
 (0)