Skip to content

Commit 0e16d10

Browse files
committed
Generate fake for Booking
1 parent 6705358 commit 0e16d10

File tree

7 files changed

+195
-182
lines changed

7 files changed

+195
-182
lines changed

Modules/Sources/Fakes/Networking.generated.swift

Lines changed: 28 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -317,6 +317,31 @@ extension Networking.BlazeTargetTopic {
317317
)
318318
}
319319
}
320+
extension Networking.Booking {
321+
/// Returns a "ready to use" type filled with fake values.
322+
///
323+
public static func fake() -> Networking.Booking {
324+
.init(
325+
siteID: .fake(),
326+
bookingID: .fake(),
327+
allDay: .fake(),
328+
cost: .fake(),
329+
customerID: .fake(),
330+
dateCreated: .fake(),
331+
dateModified: .fake(),
332+
endDate: .fake(),
333+
googleCalendarEventID: .fake(),
334+
orderID: .fake(),
335+
orderItemID: .fake(),
336+
parentID: .fake(),
337+
productID: .fake(),
338+
resourceID: .fake(),
339+
startDate: .fake(),
340+
statusKey: .fake(),
341+
localTimezone: .fake()
342+
)
343+
}
344+
}
320345
extension Networking.CompositeComponentOptionType {
321346
/// Returns a "ready to use" type filled with fake values.
322347
///
@@ -1775,9 +1800,9 @@ extension Networking.Site {
17751800
wasEcommerceTrial: .fake(),
17761801
hasSSOEnabled: .fake(),
17771802
applicationPasswordAvailable: .fake(),
1778-
isGarden: false,
1779-
gardenName: nil,
1780-
gardenPartner: nil
1803+
isGarden: .fake(),
1804+
gardenName: .fake(),
1805+
gardenPartner: .fake()
17811806
)
17821807
}
17831808
}

WooCommerce/Classes/Analytics/WooAnalyticsEvent+ProductForm.swift

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,14 @@ extension WooAnalyticsEvent {
55
static let source = "source"
66
}
77

8+
/// Source of the share product action. The raw value is the event property value.
9+
enum ShareProductSource: String {
10+
/// From product form in the navigation bar.
11+
case productForm = "product_form"
12+
/// From product form > more menu in the navigation bar.
13+
case moreMenu = "more_menu"
14+
}
15+
816
/// Tracked when the user taps on the button to share a product.
917
static func productDetailShareButtonTapped(source: ShareProductSource) -> WooAnalyticsEvent {
1018
WooAnalyticsEvent(statName: .productDetailShareButtonTapped,
@@ -24,13 +32,3 @@ extension WooAnalyticsEvent {
2432
}
2533
}
2634
}
27-
28-
extension WooAnalyticsEvent.ProductForm {
29-
/// Source of the share product action. The raw value is the event property value.
30-
enum ShareProductSource: String {
31-
/// From product form in the navigation bar.
32-
case productForm = "product_form"
33-
/// From product form > more menu in the navigation bar.
34-
case moreMenu = "more_menu"
35-
}
36-
}

WooCommerce/Classes/Analytics/WooAnalyticsEvent+ProductFormAI.swift

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,14 @@ extension WooAnalyticsEvent {
77
static let language = "language"
88
}
99

10+
/// Trigger of the product description AI flow. The raw value is the event property value.
11+
enum ProductDescriptionAISource: String {
12+
/// From product description Aztec editor.
13+
case aztecEditor = "aztec_editor"
14+
/// From the product form below the description row.
15+
case productForm = "product_form"
16+
}
17+
1018
/// Tracked when the user taps on the button to start the product description AI flow.
1119
static func productDescriptionAIButtonTapped(source: ProductDescriptionAISource) -> WooAnalyticsEvent {
1220
WooAnalyticsEvent(statName: .productDescriptionAIButtonTapped,
@@ -61,16 +69,6 @@ extension WooAnalyticsEvent {
6169
}
6270
}
6371

64-
extension WooAnalyticsEvent.ProductFormAI {
65-
/// Trigger of the product description AI flow. The raw value is the event property value.
66-
enum ProductDescriptionAISource: String {
67-
/// From product description Aztec editor.
68-
case aztecEditor = "aztec_editor"
69-
/// From the product form below the description row.
70-
case productForm = "product_form"
71-
}
72-
}
73-
7472
private extension WooAnalyticsEvent.ProductFormAI {
7573
enum Constants {
7674
static let productDescriptionSource = "product_description"

WooCommerce/Classes/Analytics/WooAnalyticsEvent+ProductListFilter.swift

Lines changed: 16 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,22 @@ extension WooAnalyticsEvent {
77
static let type = "type"
88
}
99

10+
/// Trigger of the product list filter. The raw value is the event property value.
11+
enum Source: String {
12+
/// From the products tab.
13+
case productsTab = "products_tab"
14+
/// From order form > add products.
15+
case orderForm = "order_form"
16+
/// From coupon form > products.
17+
case couponForm = "coupon_form"
18+
/// From coupon form > usage restrictions > exclude products.
19+
case couponRestrictions = "coupon_restrictions"
20+
/// From Blaze campaign creation flow
21+
case blaze = "blaze"
22+
/// From orders > filter.
23+
case orderFilter = "order_filter"
24+
}
25+
1026
/// Tracked when the user taps on the button to filter products.
1127
/// - Parameter source: Source of the product list filter.
1228
static func productListViewFilterOptionsTapped(source: Source) -> WooAnalyticsEvent {
@@ -28,21 +44,3 @@ extension WooAnalyticsEvent {
2844
}
2945
}
3046
}
31-
32-
extension WooAnalyticsEvent.ProductListFilter {
33-
/// Trigger of the product list filter. The raw value is the event property value.
34-
enum Source: String {
35-
/// From the products tab.
36-
case productsTab = "products_tab"
37-
/// From order form > add products.
38-
case orderForm = "order_form"
39-
/// From coupon form > products.
40-
case couponForm = "coupon_form"
41-
/// From coupon form > usage restrictions > exclude products.
42-
case couponRestrictions = "coupon_restrictions"
43-
/// From Blaze campaign creation flow
44-
case blaze = "blaze"
45-
/// From orders > filter.
46-
case orderFilter = "order_filter"
47-
}
48-
}

WooCommerce/Classes/Analytics/WooAnalyticsEvent+StoreCreation.swift

Lines changed: 37 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,43 @@ extension WooAnalyticsEvent {
2121
static let initialDomain = "initial_domain"
2222
}
2323

24+
enum StorePickerSource: String {
25+
/// From switching stores.
26+
case switchStores = "switching_stores"
27+
/// From the login flow.
28+
case login
29+
/// The store creation flow is originally initiated from login prologue and dismissed,
30+
/// which lands on the store picker.
31+
case loginPrologue = "prologue"
32+
/// Other sources like from any error screens during the login flow.
33+
case other
34+
}
35+
36+
enum Source: String {
37+
case loginPrologue = "prologue"
38+
case storePicker = "store_picker"
39+
case loginEmailError = "login_email_error"
40+
}
41+
42+
/// The implementation of store creation flow - native (M2) or web (M1).
43+
enum Flow: String {
44+
case native = "native"
45+
case web = "web"
46+
}
47+
48+
/// Steps of the native store creation flow.
49+
enum Step: String {
50+
case profilerCategoryQuestion = "store_profiler_industries"
51+
case profilerSellingStatusQuestion = "store_profiler_commerce_journey"
52+
case profilerSellingPlatformsQuestion = "store_profiler_ecommerce_platforms"
53+
case profilerCountryQuestion = "store_profiler_country"
54+
case domainPicker = "domain_picker"
55+
case storeSummary = "store_summary"
56+
case planPurchase = "plan_purchase"
57+
case webCheckout = "web_checkout"
58+
case storeInstallation = "store_installation"
59+
}
60+
2461
static func siteCreationFlowStarted(source: Source) -> WooAnalyticsEvent {
2562
WooAnalyticsEvent(statName: .siteCreationFlowStarted,
2663
properties: [Key.source: source.rawValue])
@@ -163,45 +200,6 @@ extension WooAnalyticsEvent {
163200
}
164201
}
165202

166-
extension WooAnalyticsEvent.StoreCreation {
167-
enum StorePickerSource: String {
168-
/// From switching stores.
169-
case switchStores = "switching_stores"
170-
/// From the login flow.
171-
case login
172-
/// The store creation flow is originally initiated from login prologue and dismissed,
173-
/// which lands on the store picker.
174-
case loginPrologue = "prologue"
175-
/// Other sources like from any error screens during the login flow.
176-
case other
177-
}
178-
179-
enum Source: String {
180-
case loginPrologue = "prologue"
181-
case storePicker = "store_picker"
182-
case loginEmailError = "login_email_error"
183-
}
184-
185-
/// The implementation of store creation flow - native (M2) or web (M1).
186-
enum Flow: String {
187-
case native = "native"
188-
case web = "web"
189-
}
190-
191-
/// Steps of the native store creation flow.
192-
enum Step: String {
193-
case profilerCategoryQuestion = "store_profiler_industries"
194-
case profilerSellingStatusQuestion = "store_profiler_commerce_journey"
195-
case profilerSellingPlatformsQuestion = "store_profiler_ecommerce_platforms"
196-
case profilerCountryQuestion = "store_profiler_country"
197-
case domainPicker = "domain_picker"
198-
case storeSummary = "store_summary"
199-
case planPurchase = "plan_purchase"
200-
case webCheckout = "web_checkout"
201-
case storeInstallation = "store_installation"
202-
}
203-
}
204-
205203
private extension CreateAccountError {
206204
var analyticsValue: String {
207205
switch self {

WooCommerce/Classes/Analytics/WooAnalyticsEvent+StoreOnboarding.swift

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,11 @@ extension WooAnalyticsEvent {
1010
static let hide = "hide"
1111
}
1212

13+
enum Source: String {
14+
case onboardingList = "onboarding_list"
15+
case settings
16+
}
17+
1318
static func storeOnboardingShown() -> WooAnalyticsEvent {
1419
WooAnalyticsEvent(statName: .storeOnboardingShown, properties: [:])
1520
}
@@ -37,13 +42,6 @@ extension WooAnalyticsEvent {
3742
}
3843
}
3944

40-
extension WooAnalyticsEvent.StoreOnboarding {
41-
enum Source: String {
42-
case onboardingList = "onboarding_list"
43-
case settings
44-
}
45-
}
46-
4745
private extension StoreOnboardingTask.TaskType {
4846
var analyticsValue: String {
4947
switch self {

0 commit comments

Comments
 (0)