Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@willopez
Copy link
Member

@willopez willopez commented Sep 20, 2019

Adds various filters to the main orders query

Summary

Adds API support to enable users to filter orders by: search keywords (fuzzy search), status, payment status, fulfillment status, date range.

Testing

  1. Create a sample set of orders with varying created dates (edit in DB if necessary)
  2. Use sample query below to test all the supported filters
  3. Verify orders are filtered correctly

sample query all supported filters

{
  orders(
    shopIds: ["cmVhY3Rpb24vc2hvcDpKOEJocTN1VHRkZ3daeDNyeg=="]
    filters: { 
      searchField: "myname"
      status: processing
      paymentStatus:completed
      fulfillmentStatus: completed
      createdAt:{
        gte: "2019-09-16T00:00:00.000Z",
        lte: "2019-09-16T23:59:59.999Z"
      }
    }
  ) {
    nodes {
      _id
      createdAt
      email
      fulfillmentGroups {
      	status
      }
      payments {
        status
        billingAddress {
          fullName
        }
      }
      email
      status
    }
  }
}

@willopez willopez marked this pull request as ready for review September 23, 2019 23:33
Signed-off-by: Will Lopez <[email protected]>
@willopez willopez requested a review from mikemurray September 23, 2019 23:49
Copy link
Member

@mikemurray mikemurray left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can't get the status filter to work. Added a comment that should fix that bug. Otherwise, the other filters seem to work fine.

@willopez
Copy link
Member Author

@mikemurray Status filter fixed

@mikemurray mikemurray merged commit 9bd5279 into develop Sep 24, 2019
@mikemurray mikemurray deleted the willopez-orders-api-enhancements branch September 24, 2019 22:51
@kieckhafer kieckhafer mentioned this pull request Sep 25, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants