-
Notifications
You must be signed in to change notification settings - Fork 121
REST API: Migrate orders endpoint #8554
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
You can test the changes from this Pull Request by:
|
Generated by 🚫 dangerJS |
jaclync
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
there are some failures from related entities like refunds, products, and countries, I'm sure they will be handled separately.
| return mapOrders(from: "orders-load-all") | ||
| } | ||
|
|
||
| /// Returns the OrderListMapper output upon receiving `orders-load-all-without-data` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
super nit:
| /// Returns the OrderListMapper output upon receiving `orders-load-all-without-data` | |
| /// Returns the [Order] output upon receiving `orders-load-all-without-data` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated in 7848519.
| return mapOrder(from: "order") | ||
| } | ||
|
|
||
| /// Returns the OrderMapper output upon receiving `order-without-data` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
super nit:
| /// Returns the OrderMapper output upon receiving `order-without-data` | |
| /// Returns the Order output upon receiving `order-without-data` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated in 4d36b6c.
| return mapNotes(from: "order-notes") | ||
| } | ||
|
|
||
| /// Returns the OrderNotesMapper output upon receiving `order-notes-without-data` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
super nit:
| /// Returns the OrderNotesMapper output upon receiving `order-notes-without-data` | |
| /// Returns the [OrderNote] output upon receiving `order-notes-without-data` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated in f0f2944.
| let statuses = try? mapper.map(response: data) | ||
|
|
||
| // Then | ||
| XCTAssertNotNil(mapper) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
any reasons asserting on the mapper? the mapper initialization doesn't seem nullable 🤔
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is redundant indeed 😅 Removed in 6dad597.
| } | ||
|
|
||
| // When | ||
| let statuses = try? mapper.map(response: data) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: can probably make the result non-nil by using try XCTUnwrap
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also updated in 6dad597.
| private extension ReportOrderTotalsMapperTests { | ||
| /// Returns the CustomerMapper output upon receiving `filename` (Data Encoded) | ||
| /// | ||
| func mapStatus(from filename: String) throws -> [OrderStatus] { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: is this meant to be used?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is also redundant - removed in 2f9d67d 👍
Closes #8550
Description
This PR updates all mappers related to orders endpoints:
ReportOrderTotalsMapper,OrderListMapper,OrderMapper,OrderNoteMapperto parse contents without the data envelope.All endpoints with paths
/orders,/notesand/reports/orders/totalsare enabled for REST API requests.Testing instructions
applicationPasswordAuthenticationForSiteCredentialLoginand build the app.Please feel free to test again by logging in with a WPCom account. All order-related features should work too.
Screenshots
N/A
RELEASE-NOTES.txtif necessary.