-
Notifications
You must be signed in to change notification settings - Fork 121
[POS Orders] Hook createdVia from networking to business layer
#15847
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] Hook createdVia from networking to business layer
#15847
Conversation
|
|
createdVia to NetworkingCore Order modelcreatedVia from networking to business layer
staskus
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.
Tested on a few stores, made orders on IPP, web, and POS. The badge shows up when we would expect. 🚀
| let paymentMethodTitle = try container.decode(String.self, forKey: .paymentMethodTitle) | ||
|
|
||
| // "payment_url" is only available on stores stores with version >= 6.4 | ||
| // "payment_url" is only available on stores with version >= 6.4 |
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.
👁️
| var salesChannel: String? { | ||
| guard let createdVia = order.createdVia else { | ||
| return nil | ||
| } | ||
|
|
||
| switch createdVia { | ||
| case "pos-rest-api": | ||
| return "POS" | ||
| default: | ||
| 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.
nit: the sales channel implementation detail could live in Yosemite, like an extension of Order, so that the app layer doesn't have to know about this "created_via" property and the sales channel can be reused for other order use cases.
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 makes sense 🤔 , I'll go ahead and merge this one for now, then take a spin to your suggestion in #15848

Closes WOOMOB-701
Only 1 review is needed.
Description
This PR hooks the usage of
created_viathrough Networking - Yosemite - Storage to finally display the appropriate value in the UI, for this we:NetworkingCore.Ordermodel and generate copy/fakesOrder+ReadOnlyConvertibleto account for this propertycreated_viaas field when we fetch all orders from the APIpos-rest-apiTesting information
.pointOfSaleOrdersi1flag totrue