magento2 icon indicating copy to clipboard operation
magento2 copied to clipboard

magento/magento2#37803: Customer order filters graphql

Open serbynskyi opened this issue 1 year ago • 27 comments

Description (*)

Fixed Issue

  1. Fixes magento/magento2#37803

Manual testing scenarios (*)

1.Create a new Module CustomerOrder. 2.Create a schema.graphqls in Teeela/CustomerOrder/etc/ folder to extend the CustomerOrderFilterInput. Put following codes in this file:

input CustomerOrdersFilterInput @doc(description: "Identifies the filter to use for filtering orders.") { number: FilterStringTypeInput @doc(description: "Filters by order number.") created_at: FilterRangeTypeInput @doc(description: "Filters by created at.") status: FilterEqualTypeInput @doc(description: "Filters by status.") }

input FilterRangeTypeInput @doc(description: "Defines a filter that matches a range of values, such as prices or dates.") { from: String @doc(description: "The beginning of the range") to: String @doc(description: "The end of the range") }

input FilterEqualTypeInput @doc(description: "Defines a filter that matches the input exactly.") { in: [String] @doc(description: "An array of values to filter on") eq: String @doc(description: "A string to filter on") } 3.Use the following payload and {{your URL}}/graphql to query the customer token.

mutation { generateCustomerToken(email: "{{your email address}}", password: "{{your password}}") { token } } 4.Put above token in Postman Headers Authorization with Bearer {{your token}}. 5.Use following payload to query the above customer's sales orders.

query { customer { orders(filter: { created_at: { from: "2023-07-22" } status:{ in:["Processing"]} }) { items { number
created_at } } }


Result:
orders from 2023-07-22 and status Processing

### Contribution checklist (*)
 - [ ] Pull request has a meaningful description of its purpose
 - [ ] All commits are accompanied by meaningful commit messages
 - [ ] All new or changed code is covered with unit/integration tests (if applicable)
 - [ ] README.md files for modified modules are updated and included in the pull request if any [README.md predefined sections](https://github.com/magento/devdocs/wiki/Magento-module-README.md) require an update
 - [ ] All automated tests passed successfully (all builds are green)

serbynskyi avatar Oct 13 '23 15:10 serbynskyi

Hi @serbynskyi. Thank you for your contribution! Here are some useful tips on how you can test your changes using Magento test environment.

Add the comment under your pull request to deploy test or vanilla Magento instance:
  • @magento give me test instance - deploy test instance based on PR changes
  • @magento give me 2.4-develop instance - deploy vanilla Magento instance

:exclamation: Automated tests can be triggered manually with an appropriate comment:

  • @magento run all tests - run or re-run all required tests against the PR changes
  • @magento run <test-build(s)> - run or re-run specific test build(s) For example: @magento run Unit Tests

<test-build(s)> is a comma-separated list of build names.

Allowed build names are:
  1. Database Compare
  2. Functional Tests CE
  3. Functional Tests EE
  4. Functional Tests B2B
  5. Integration Tests
  6. Magento Health Index
  7. Sample Data Tests CE
  8. Sample Data Tests EE
  9. Sample Data Tests B2B
  10. Static Tests
  11. Unit Tests
  12. WebAPI Tests
  13. Semantic Version Checker

You can find more information about the builds here :information_source: Run only required test builds during development. Run all test builds before sending your pull request for review.


For more details, review the Code Contributions documentation. Join Magento Community Engineering Slack and ask your questions in #github channel.

m2-assistant[bot] avatar Oct 13 '23 15:10 m2-assistant[bot]

@magento run all tests

shikhamis11 avatar Oct 15 '23 02:10 shikhamis11

The requested builds are added to the queue. You should be able to see them here within a few minutes. Please message the #magento-devops slack channel if they don't show in a reasonable amount of time and a representative will look into any issues.

@serbynskyi thank you for your Pull request. Can you also cover your changes with the web API function test?

shikhamis11 avatar Oct 15 '23 03:10 shikhamis11

Hey! take a look at this one: https://github.com/magento/magento2/pull/36949 @serbynskyi

venchiarutti avatar Oct 19 '23 14:10 venchiarutti

@magento run all tests

engcom-Hotel avatar Nov 20 '23 05:11 engcom-Hotel

The requested builds are added to the queue. You should be able to see them here within a few minutes. Please message the #magento-devops slack channel if they don't show in a reasonable amount of time and a representative will look into any issues.

@magento run WebAPI Tests, Static Tests, Integration Tests, Functional Tests EE, Functional Tests CE, Functional Tests B2B

engcom-Hotel avatar Nov 20 '23 09:11 engcom-Hotel

The requested builds are added to the queue. You should be able to see them here within a few minutes. Please message the #magento-devops slack channel if they don't show in a reasonable amount of time and a representative will look into any issues.

@magento run Functional Tests CE

engcom-Hotel avatar Nov 20 '23 11:11 engcom-Hotel

The requested builds are added to the queue. You should be able to see them here within a few minutes. Please message the #magento-devops slack channel if they don't show in a reasonable amount of time and a representative will look into any issues.

Working on web API test coverage.

engcom-Charlie avatar Dec 13 '23 13:12 engcom-Charlie

@magento run Static Tests

engcom-Charlie avatar Dec 13 '23 13:12 engcom-Charlie

The requested builds are added to the queue. You should be able to see them here within a few minutes. Please message the #magento-devops slack channel if they don't show in a reasonable amount of time and a representative will look into any issues.

@magento run WebAPI Tests

engcom-Charlie avatar Dec 13 '23 13:12 engcom-Charlie

The requested builds are added to the queue. You should be able to see them here within a few minutes. Please message the #magento-devops slack channel if they don't show in a reasonable amount of time and a representative will look into any issues.

@magento run Static Tests

engcom-Charlie avatar Dec 13 '23 17:12 engcom-Charlie

The requested builds are added to the queue. You should be able to see them here within a few minutes. Please message the #magento-devops slack channel if they don't show in a reasonable amount of time and a representative will look into any issues.

@magento run Static Tests, WebAPI Tests

engcom-Charlie avatar Dec 14 '23 11:12 engcom-Charlie

The requested builds are added to the queue. You should be able to see them here within a few minutes. Please message the #magento-devops slack channel if they don't show in a reasonable amount of time and a representative will look into any issues.

@magento run all tests

engcom-Charlie avatar Dec 15 '23 05:12 engcom-Charlie

The requested builds are added to the queue. You should be able to see them here within a few minutes. Please message the #magento-devops slack channel if they don't show in a reasonable amount of time and a representative will look into any issues.

@magento run WebAPI Tests

engcom-Charlie avatar Dec 15 '23 07:12 engcom-Charlie

The requested builds are added to the queue. You should be able to see them here within a few minutes. Please message the #magento-devops slack channel if they don't show in a reasonable amount of time and a representative will look into any issues.

@magento run Functional Tests B2B, Functional Tests CE, Functional Tests EE, Integration Tests, WebAPI Tests

engcom-Charlie avatar Dec 15 '23 10:12 engcom-Charlie

The requested builds are added to the queue. You should be able to see them here within a few minutes. Please message the #magento-devops slack channel if they don't show in a reasonable amount of time and a representative will look into any issues.

In discussion with Product Owner on this feature, till then moving it to On Hold.

engcom-Charlie avatar Dec 20 '23 13:12 engcom-Charlie

@magento run all tests

engcom-Charlie avatar Jan 11 '24 14:01 engcom-Charlie

The requested builds are added to the queue. You should be able to see them here within a few minutes. Please message the #magento-devops slack channel if they don't show in a reasonable amount of time and a representative will look into any issues.

@engcom-Hotel, the test coverage for customer order filter is present in Sales/CustomerOrders/CustomerOrdersTest.php Can you please have a look and do the needful. Moving it to Review.

Thank you!

engcom-Charlie avatar Jan 16 '24 13:01 engcom-Charlie