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

#878 - Deprecated the column increment_id #951

Merged
merged 2 commits into from
Sep 25, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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