@@ -95,7 +95,8 @@ public extension PersistedProduct {
9595 /// Returns a request for POS-supported products (simple and variable, non-downloadable) for a given site, ordered by name
9696 static func posProductsRequest( siteID: Int64 ) -> QueryInterfaceRequest < PersistedProduct > {
9797 return PersistedProduct
98- . basePOSProductsRequest ( siteID: siteID)
98+ . filter ( Columns . siteID == siteID)
99+ . filter ( [ ProductType . simple. rawValue, ProductType . variable. rawValue] . contains ( Columns . productTypeKey) )
99100 . filter ( Columns . downloadable == false )
100101 . order ( Columns . name. collating ( . localizedCaseInsensitiveCompare) )
101102 }
@@ -106,17 +107,9 @@ public extension PersistedProduct {
106107 /// - globalUniqueID: The global unique ID (barcode) to search for
107108 /// - Returns: A query request that matches products with the given global unique ID
108109 static func posProductByGlobalUniqueID( siteID: Int64 , globalUniqueID: String ) -> QueryInterfaceRequest < PersistedProduct > {
109- return PersistedProduct
110- . basePOSProductsRequest ( siteID: siteID)
111- . filter ( Columns . globalUniqueID == globalUniqueID)
112- }
113- }
114-
115- private extension PersistedProduct {
116- static func basePOSProductsRequest( siteID: Int64 ) -> QueryInterfaceRequest < PersistedProduct > {
117110 return PersistedProduct
118111 . filter ( Columns . siteID == siteID)
119- . filter ( [ ProductType . simple . rawValue , ProductType . variable . rawValue ] . contains ( Columns . productTypeKey ) )
112+ . filter ( Columns . globalUniqueID == globalUniqueID )
120113 }
121114}
122115
0 commit comments