@@ -391,6 +391,87 @@ extension OrderItemRefund {
391391 }
392392}
393393
394+ extension OrderStatsV4 {
395+ public func copy(
396+ siteID: CopiableProp < Int64 > = . copy,
397+ granularity: CopiableProp < StatsGranularityV4 > = . copy,
398+ totals: CopiableProp < OrderStatsV4Totals > = . copy,
399+ intervals: CopiableProp < [ OrderStatsV4Interval ] > = . copy
400+ ) -> OrderStatsV4 {
401+ let siteID = siteID ?? self . siteID
402+ let granularity = granularity ?? self . granularity
403+ let totals = totals ?? self . totals
404+ let intervals = intervals ?? self . intervals
405+
406+ return OrderStatsV4 (
407+ siteID: siteID,
408+ granularity: granularity,
409+ totals: totals,
410+ intervals: intervals
411+ )
412+ }
413+ }
414+
415+ extension OrderStatsV4Interval {
416+ public func copy(
417+ interval: CopiableProp < String > = . copy,
418+ dateStart: CopiableProp < String > = . copy,
419+ dateEnd: CopiableProp < String > = . copy,
420+ subtotals: CopiableProp < OrderStatsV4Totals > = . copy
421+ ) -> OrderStatsV4Interval {
422+ let interval = interval ?? self . interval
423+ let dateStart = dateStart ?? self . dateStart
424+ let dateEnd = dateEnd ?? self . dateEnd
425+ let subtotals = subtotals ?? self . subtotals
426+
427+ return OrderStatsV4Interval (
428+ interval: interval,
429+ dateStart: dateStart,
430+ dateEnd: dateEnd,
431+ subtotals: subtotals
432+ )
433+ }
434+ }
435+
436+ extension OrderStatsV4Totals {
437+ public func copy(
438+ totalOrders: CopiableProp < Int > = . copy,
439+ totalItemsSold: CopiableProp < Int > = . copy,
440+ grossRevenue: CopiableProp < Decimal > = . copy,
441+ couponDiscount: CopiableProp < Decimal > = . copy,
442+ totalCoupons: CopiableProp < Int > = . copy,
443+ refunds: CopiableProp < Decimal > = . copy,
444+ taxes: CopiableProp < Decimal > = . copy,
445+ shipping: CopiableProp < Decimal > = . copy,
446+ netRevenue: CopiableProp < Decimal > = . copy,
447+ totalProducts: NullableCopiableProp < Int > = . copy
448+ ) -> OrderStatsV4Totals {
449+ let totalOrders = totalOrders ?? self . totalOrders
450+ let totalItemsSold = totalItemsSold ?? self . totalItemsSold
451+ let grossRevenue = grossRevenue ?? self . grossRevenue
452+ let couponDiscount = couponDiscount ?? self . couponDiscount
453+ let totalCoupons = totalCoupons ?? self . totalCoupons
454+ let refunds = refunds ?? self . refunds
455+ let taxes = taxes ?? self . taxes
456+ let shipping = shipping ?? self . shipping
457+ let netRevenue = netRevenue ?? self . netRevenue
458+ let totalProducts = totalProducts ?? self . totalProducts
459+
460+ return OrderStatsV4Totals (
461+ totalOrders: totalOrders,
462+ totalItemsSold: totalItemsSold,
463+ grossRevenue: grossRevenue,
464+ couponDiscount: couponDiscount,
465+ totalCoupons: totalCoupons,
466+ refunds: refunds,
467+ taxes: taxes,
468+ shipping: shipping,
469+ netRevenue: netRevenue,
470+ totalProducts: totalProducts
471+ )
472+ }
473+ }
474+
394475extension PaymentGatewayAccount {
395476 public func copy(
396477 siteID: CopiableProp < Int64 > = . copy,
@@ -1387,6 +1468,42 @@ extension SiteSetting {
13871468 }
13881469}
13891470
1471+ extension SiteVisitStats {
1472+ public func copy(
1473+ siteID: CopiableProp < Int64 > = . copy,
1474+ date: CopiableProp < String > = . copy,
1475+ granularity: CopiableProp < StatGranularity > = . copy,
1476+ items: NullableCopiableProp < [ SiteVisitStatsItem ] > = . copy
1477+ ) -> SiteVisitStats {
1478+ let siteID = siteID ?? self . siteID
1479+ let date = date ?? self . date
1480+ let granularity = granularity ?? self . granularity
1481+ let items = items ?? self . items
1482+
1483+ return SiteVisitStats (
1484+ siteID: siteID,
1485+ date: date,
1486+ granularity: granularity,
1487+ items: items
1488+ )
1489+ }
1490+ }
1491+
1492+ extension SiteVisitStatsItem {
1493+ public func copy(
1494+ period: CopiableProp < String > = . copy,
1495+ visitors: CopiableProp < Int > = . copy
1496+ ) -> SiteVisitStatsItem {
1497+ let period = period ?? self . period
1498+ let visitors = visitors ?? self . visitors
1499+
1500+ return SiteVisitStatsItem (
1501+ period: period,
1502+ visitors: visitors
1503+ )
1504+ }
1505+ }
1506+
13901507extension SystemPlugin {
13911508 public func copy(
13921509 siteID: CopiableProp < Int64 > = . copy,
0 commit comments