Skip to content

Commit 6d61330

Browse files
ashishkumarpundeerashishkumarpundeer
authored andcommitted
AC1096 ShippingCartAddress needs a uid
1 parent e0d650c commit 6d61330

File tree

3 files changed

+15
-3
lines changed

3 files changed

+15
-3
lines changed

app/code/Magento/QuoteGraphQl/Model/Cart/ExtractQuoteAddressData.php

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99

1010
use Magento\Framework\Api\ExtensibleDataObjectConverter;
1111
use Magento\Quote\Api\Data\AddressInterface;
12+
use Magento\Framework\GraphQl\Query\Uid;
1213
use Magento\Quote\Model\Quote\Address as QuoteAddress;
1314

1415
/**
@@ -24,9 +25,17 @@ class ExtractQuoteAddressData
2425
/**
2526
* @param ExtensibleDataObjectConverter $dataObjectConverter
2627
*/
27-
public function __construct(ExtensibleDataObjectConverter $dataObjectConverter)
28+
29+
/** @var Uid */
30+
private $uidEncoder;
31+
32+
public function __construct(
33+
ExtensibleDataObjectConverter $dataObjectConverter,
34+
Uid $uidEncoder
35+
)
2836
{
2937
$this->dataObjectConverter = $dataObjectConverter;
38+
$this->uidEncoder = $uidEncoder;
3039
}
3140

3241
/**
@@ -52,6 +61,7 @@ public function execute(QuoteAddress $address): array
5261
'label' => $address->getRegion(),
5362
'region_id'=> $address->getRegionId()
5463
],
64+
'uid'=>$this->uidEncoder->encode((string) $address->getAddressId()) ,
5565
'street' => $address->getStreet(),
5666
'items_weight' => $address->getWeight(),
5767
'customer_notes' => $address->getCustomerNotes()

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -221,6 +221,7 @@ type Cart @doc(description: "Contains the contents and other details about a gue
221221
}
222222

223223
interface CartAddressInterface @typeResolver(class: "\\Magento\\QuoteGraphQl\\Model\\Resolver\\CartAddressTypeResolver") {
224+
uid: String! @doc(description: "The unique id of the customer address.")
224225
firstname: String! @doc(description: "The first name of the customer or guest.")
225226
lastname: String! @doc(description: "The last name of the customer or guest.")
226227
company: String @doc(description: "The company specified for the billing or shipping address.")

dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Customer/GetSpecifiedShippingAddressTest.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -160,18 +160,19 @@ private function getQuery(string $maskedQuoteId): string
160160
{
161161
cart(cart_id: "$maskedQuoteId") {
162162
shipping_addresses {
163+
uid
163164
firstname
164165
lastname
165166
company
166167
street
167168
city
168-
region
169+
region
169170
{
170171
code
171172
label
172173
}
173174
postcode
174-
country
175+
country
175176
{
176177
code
177178
label

0 commit comments

Comments
 (0)