woocommerce-ios icon indicating copy to clipboard operation
woocommerce-ios copied to clipboard

[Woo POS] M2: Analytics

Open iamgabrielma opened this issue 7 months ago • 2 comments

Since we've abstracted Analytics to a protocol in preparation for M1, we can inject the abstraction through the entry point and then specialize it as needed for our case:

+ final class POSAnalytics: Analytics {  ... }
+ final class DummyPOSAnalyticsProvider: AnalyticsProvider { ... }

struct PointOfSaleEntryPointView: View { ... 

    init(itemProvider: POSItemProvider,
         hideAppTabBar: @escaping ((Bool) -> Void),
         cardPresentPaymentService: CardPresentPaymentFacade,
         orderService: POSOrderServiceProtocol,
         currencyFormatter: CurrencyFormatter,
+         analyticsService: Analytics) {
        self.hideAppTabBar = hideAppTabBar

        _viewModel = StateObject(wrappedValue: PointOfSaleDashboardViewModel(
            itemProvider: itemProvider,
            cardPresentPaymentService: cardPresentPaymentService,
            orderService: orderService,
            currencyFormatter: currencyFormatter, 
+            analyticsService: analyticsService)
        )
    }

TODO:

Task Issue
Create PointOfSaleAnalytics and PointOfSaleTracksProvider https://github.com/woocommerce/woocommerce-ios/pull/13604/
Cart: item_added_to_cart https://github.com/woocommerce/woocommerce-ios/pull/13604
Order: order_creation_failed https://github.com/woocommerce/woocommerce-ios/issues/13613
Payment success: card_present_collect_payment_success https://github.com/woocommerce/woocommerce-ios/issues/13614
Payment failure: card_present_collect_payment_failed https://github.com/woocommerce/woocommerce-ios/issues/13614

iamgabrielma avatar Jul 09 '24 09:07 iamgabrielma