Skip to content
This repository has been archived by the owner on Dec 19, 2019. It is now read-only.

Commit

Permalink
ENGCOM-5930: #878 - Deprecated the column increment_id #951
Browse files Browse the repository at this point in the history
  • Loading branch information
lenaorobei authored Sep 23, 2019
2 parents 1b41eb0 + bcc5890 commit 452b2e3
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 14 deletions.
1 change: 1 addition & 0 deletions app/code/Magento/SalesGraphQl/Model/Resolver/Orders.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ public function resolve(
$items[] = [
'id' => $order->getId(),
'increment_id' => $order->getIncrementId(),
'order_number' => $order->getIncrementId(),
'created_at' => $order->getCreatedAt(),
'grand_total' => $order->getGrandTotal(),
'status' => $order->getStatus(),
Expand Down
3 changes: 2 additions & 1 deletion app/code/Magento/SalesGraphQl/etc/schema.graphqls
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ type Query {

type CustomerOrder @doc(description: "Order mapping fields") {
id: Int
increment_id: String
increment_id: String @deprecated(reason: "Use the order_number instaed.")
order_number: String! @doc(description: "The order number")
created_at: String
grand_total: Float
status: String
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,7 @@ public function testOrdersQuery()
query {
customerOrders {
items {
id
increment_id
created_at
order_number
grand_total
status
}
Expand All @@ -54,27 +52,27 @@ public function testOrdersQuery()

$expectedData = [
[
'increment_id' => '100000002',
'order_number' => '100000002',
'status' => 'processing',
'grand_total' => 120.00
],
[
'increment_id' => '100000003',
'order_number' => '100000003',
'status' => 'processing',
'grand_total' => 130.00
],
[
'increment_id' => '100000004',
'order_number' => '100000004',
'status' => 'closed',
'grand_total' => 140.00
],
[
'increment_id' => '100000005',
'order_number' => '100000005',
'status' => 'complete',
'grand_total' => 150.00
],
[
'increment_id' => '100000006',
'order_number' => '100000006',
'status' => 'complete',
'grand_total' => 160.00
]
Expand All @@ -84,19 +82,19 @@ public function testOrdersQuery()

foreach ($expectedData as $key => $data) {
$this->assertEquals(
$data['increment_id'],
$actualData[$key]['increment_id'],
"increment_id is different than the expected for order - " . $data['increment_id']
$data['order_number'],
$actualData[$key]['order_number'],
"order_number is different than the expected for order - " . $data['order_number']
);
$this->assertEquals(
$data['grand_total'],
$actualData[$key]['grand_total'],
"grand_total is different than the expected for order - " . $data['increment_id']
"grand_total is different than the expected for order - " . $data['order_number']
);
$this->assertEquals(
$data['status'],
$actualData[$key]['status'],
"status is different than the expected for order - " . $data['increment_id']
"status is different than the expected for order - " . $data['order_number']
);
}
}
Expand Down

0 comments on commit 452b2e3

Please sign in to comment.