-
Notifications
You must be signed in to change notification settings - Fork 111
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
Rename PointOfSaleProductService
to PointOfSaleItemService
with basic unit tests on variations
#14793
Rename PointOfSaleProductService
to PointOfSaleItemService
with basic unit tests on variations
#14793
Conversation
📲 You can test the changes from this Pull Request in WooCommerce iOS by scanning the QR code below to install the corresponding build.
|
…est cases for `providePointOfSaleVariationItems`.
f62e655
to
346e6c1
Compare
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! 🚢
LGTM, but threw up some future questions for our overall approach. It makes sense if we have a single service for fetching both types of items. I think this is forced on us by the reliance on server pagination. However, setting pagination aside, different item types that make up the In future, if we have custom grids or add in other types of items (e.g. shipping, discounts, coupons, customers), we'd probably want to have other services to provide each of these. Unless we have a single endpoint for all POS items (perhaps this would be a good idea) we may not want to combine them all at the service level. Pagination will definitely be a sticking point for this! |
Yea good question, was the original plan to have different services like |
Part of #14702
Description
As we're adding variation items fetching to
PointOfSaleItemServiceProtocol
, it starts to look odd with the namePointOfSaleProductService
that seems to be product-specific. This PR simply renamesPointOfSaleProductService
toPointOfSaleItemService
across different files and references. Two test cases were also added forprovidePointOfSaleVariationItems
function that didn't fit in #14786 that introduced it.Renaming and Refactoring:
WooCommerce/Classes/ViewRelated/Hub Menu/HubMenuViewModel.swift
: Updated the instantiation of thePointOfSaleItemService
to reflect the new name.Yosemite/Yosemite/PointOfSale/PointOfSaleItemService.swift
: Renamed the classPointOfSaleProductService
toPointOfSaleItemService
and updated internal references accordingly. [1] [2]Yosemite/YosemiteTests/PointOfSale/PointOfSaleItemServiceTests.swift
: Updated the test class name and references fromPointOfSaleProductServiceTests
toPointOfSaleItemServiceTests
, and added new test cases for variations. [1] [2] [3] [4] [5]Steps to reproduce
A confidence test to ensure the products & variations are loaded properly in the item selector would be helpful.
Testing information
Screenshots
RELEASE-NOTES.txt
if necessary.Reviewer (or Author, in the case of optional code reviews):
Please make sure these conditions are met before approving the PR, or request changes if the PR needs improvement: