-
Notifications
You must be signed in to change notification settings - Fork 121
[POS Orders] Handle filtering for POS orders #15886
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
[POS Orders] Handle filtering for POS orders #15886
Conversation
|
|
joshheald
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.
Works as expected... consider if we need some tests, but otherwise this can be merged.
Various questions inline, mostly prompted by the PR but out of its scope...
Also – there's a discrepency between salesChannel in the app, and created_via from the API... which is totally fine, this is a better description. Just be as sure as you can that we're safe for any future changes – I could see us adding sales_channel or some other channel in the API, and needing to move to that. After all, couldn't you theoretically create a POS order via the store-api, rather than the rest-api in future?
I think it'll be fine, but just have a think 😊
| customer: CustomerFilter(customer: Customer.fake().copy(customerID: 1)), | ||
| salesChannel: nil, | ||
| numberOfActiveFilters: 4) | ||
| salesChannel: .any, |
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.
In practice, any is kind of like a nil filter, right? Should we use POS here instead?
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.
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.
Not for this PR, but a product question; should we add the badge or an option to filter to the LastOrdersDashboardCard? Status is the only filter shown and supported right now, but given badge display and how close the two badges are in the list UI, it may be expected.
For people using the card, I can see clear benefits – e.g. if you use the most recent orders card to check whether you have any unfulfilled orders, POS orders are only ever in the way of you seeing that, because they're always fulfilled. 3 finished POS orders at the top of the list may make you think everything's processed, but be hiding a pending order further down the list.
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.
That's a very good point, I didn't though about these possibilities until was forced to update the fetching method for other views. I'll check with Sam and raise this for the next milestones.
| case .pointOfSale: | ||
| let predicate = NSPredicate(format: "createdVia == %@", "pos-rest-api") | ||
| return predicate | ||
| case .any: | ||
| return nil |
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.
Using it, I immediately felt that there should be a web option.
Other options I've seen in the backend are checkout and rest-api – presumably there are more. checkout came from both the block and classic checkouts, but I did see store_api for a draft order – it got changed to checkout when the order was paid for though.
I don't know how much you've discussed it... even though the fix is out of scope of this PR, it feels wrong from a user perspective right now. Selecting "not POS" would be fine but isn't possible right now, as far as I can see.
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.
|
Thanks for the review!
Yes, I think we could map and centralize these directly in Networking to some sort of |


Closes WOOMOB-711
Description
This PR adds the sales channel filter to the order list with 2 options:
Point of Sale, andAny. The sales channel filter should work like any other filters in the app, examples:Screen.Recording.2025-07-09.at.14.00.20.mov
Changes
OrdersRemotewhen fetching all orders, as well asOrderActionto pass thecreated_viaproperty onsynchronizeOrdersandfetchFilteredOrders. I've discovered too late that core data query is not enough for filtering, while the correct filter was being passed locally, we need to perform a network request when filtering, which should have the&created_via=pos-rest-apiparam along it.Testing information
Filters, observe theSales channelfilter is now functional.Clear allshould clear all filtersRELEASE-NOTES.txtif necessary.