@@ -50,6 +50,20 @@ public final class StatsStoreV4: Store {
5050 quantity: quantity,
5151 forceRefresh: forceRefresh,
5252 onCompletion: onCompletion)
53+ case . retrieveCustomStats( let siteID,
54+ let unit,
55+ let earliestDateToInclude,
56+ let latestDateToInclude,
57+ let quantity,
58+ let forceRefresh,
59+ let onCompletion) :
60+ retrieveCustomStats ( siteID: siteID,
61+ unit: unit,
62+ earliestDateToInclude: earliestDateToInclude,
63+ latestDateToInclude: latestDateToInclude,
64+ quantity: quantity,
65+ forceRefresh: forceRefresh,
66+ onCompletion: onCompletion)
5367 case . retrieveSiteVisitStats( let siteID,
5468 let siteTimezone,
5569 let timeRange,
@@ -120,6 +134,24 @@ private extension StatsStoreV4 {
120134 }
121135 }
122136
137+ /// Retrieves the order stats for the provided siteID, and time range, without saving them to the Storage layer.
138+ ///
139+ func retrieveCustomStats( siteID: Int64 ,
140+ unit: StatsGranularityV4 ,
141+ earliestDateToInclude: Date ,
142+ latestDateToInclude: Date ,
143+ quantity: Int ,
144+ forceRefresh: Bool ,
145+ onCompletion: @escaping ( Result < OrderStatsV4 , Error > ) -> Void ) {
146+ orderStatsRemote. loadOrderStats ( for: siteID,
147+ unit: unit,
148+ earliestDateToInclude: earliestDateToInclude,
149+ latestDateToInclude: latestDateToInclude,
150+ quantity: quantity,
151+ forceRefresh: forceRefresh,
152+ completion: onCompletion)
153+ }
154+
123155 /// Retrieves the site visit stats associated with the provided Site ID (if any!).
124156 ///
125157 func retrieveSiteVisitStats( siteID: Int64 ,
0 commit comments