Skip to content

Commit a153e87

Browse files
authored
Merge branch 'trunk' into woomob-1112-woo-poslocal-catalog-implement-product-search
2 parents 769a65e + dc27720 commit a153e87

File tree

100 files changed

+3941
-284
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

100 files changed

+3941
-284
lines changed

.periphery.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,7 @@ index_exclude:
5858
- Pods/*
5959
- vendor/**
6060
- BuildTools/.build/**
61-
- "**/Tests/*"
62-
- "**/Test*/*"
61+
- "**/*Test*/*"
6362
- "docs/*"
6463
- "fastlane/*"
6564
- "config/*"

Modules/Sources/Networking/Model/Bookings/BookingCustomerInfo.swift

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,10 @@ import Foundation
22

33
public struct BookingCustomerInfo: Hashable {
44
public let billingAddress: Address
5+
public let note: String?
56

6-
public init(billingAddress: Address) {
7+
public init(billingAddress: Address, note: String? = nil) {
78
self.billingAddress = billingAddress
9+
self.note = note
810
}
911
}

Modules/Sources/Networking/Model/Bookings/BookingOrderInfo.swift

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,10 @@ public struct BookingOrderInfo: Hashable {
2222
guard let billingAddress = order.billingAddress else {
2323
return nil
2424
}
25-
return BookingCustomerInfo(billingAddress: billingAddress)
25+
return BookingCustomerInfo(
26+
billingAddress: billingAddress,
27+
note: order.customerNote
28+
)
2629
}()
2730
self.productInfo = BookingProductInfo(name: order.items.first(where: { $0.productID == booking.productID })?.name ?? "")
2831
self.paymentInfo = BookingPaymentInfo(

Modules/Sources/Networking/Model/Stats/TopEarnerStatsItem.swift

Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,3 +73,91 @@ extension TopEarnerStatsItem: Identifiable {
7373
productID
7474
}
7575
}
76+
77+
// MARK: - Helper to init Product
78+
//
79+
public extension Product {
80+
init(siteID: Int64,
81+
productID: Int64,
82+
name: String,
83+
images: [ProductImage]) {
84+
self.init(siteID: siteID,
85+
productID: productID,
86+
name: name,
87+
slug: "",
88+
permalink: "",
89+
date: Date(),
90+
dateCreated: Date(),
91+
dateModified: nil,
92+
dateOnSaleStart: nil,
93+
dateOnSaleEnd: nil,
94+
productTypeKey: ProductType.simple.rawValue,
95+
statusKey: ProductStatus.draft.rawValue,
96+
featured: false,
97+
catalogVisibilityKey: ProductCatalogVisibility.visible.rawValue,
98+
fullDescription: "",
99+
shortDescription: "",
100+
sku: "",
101+
globalUniqueID: "",
102+
price: "",
103+
regularPrice: "",
104+
salePrice: "",
105+
onSale: false,
106+
purchasable: false,
107+
totalSales: 0,
108+
virtual: false,
109+
downloadable: false,
110+
downloads: [],
111+
downloadLimit: -1,
112+
downloadExpiry: -1,
113+
buttonText: "",
114+
externalURL: "",
115+
taxStatusKey: ProductTaxStatus.taxable.rawValue,
116+
taxClass: "",
117+
manageStock: false,
118+
stockQuantity: nil,
119+
stockStatusKey: ProductStockStatus.inStock.rawValue,
120+
backordersKey: ProductBackordersSetting.notAllowed.rawValue,
121+
backordersAllowed: false,
122+
backordered: false,
123+
soldIndividually: false,
124+
weight: "",
125+
dimensions: ProductDimensions(length: "", width: "", height: ""),
126+
shippingRequired: true,
127+
shippingTaxable: true,
128+
shippingClass: "",
129+
shippingClassID: 0,
130+
productShippingClass: nil,
131+
reviewsAllowed: true,
132+
averageRating: "",
133+
ratingCount: 0,
134+
relatedIDs: [],
135+
upsellIDs: [],
136+
crossSellIDs: [],
137+
parentID: 0,
138+
purchaseNote: "",
139+
categories: [],
140+
tags: [],
141+
images: images,
142+
attributes: [],
143+
defaultAttributes: [],
144+
variations: [],
145+
groupedProducts: [],
146+
menuOrder: 0,
147+
addOns: [],
148+
isSampleItem: false,
149+
bundleStockStatus: nil,
150+
bundleStockQuantity: nil,
151+
bundleMinSize: nil,
152+
bundleMaxSize: nil,
153+
bundledItems: [],
154+
password: nil,
155+
compositeComponents: [],
156+
subscription: nil,
157+
minAllowedQuantity: nil,
158+
maxAllowedQuantity: nil,
159+
groupOfQuantity: nil,
160+
combineVariationQuantities: nil,
161+
customFields: [])
162+
}
163+
}

Modules/Sources/Storage/Model/Booking/BookingCustomerInfo+CoreDataProperties.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ extension BookingCustomerInfo {
1313
@NSManaged public var billingPhone: String?
1414
@NSManaged public var billingPostcode: String?
1515
@NSManaged public var billingState: String?
16+
@NSManaged public var note: String?
1617
@NSManaged public var orderInfo: BookingOrderInfo?
1718

1819
}

Modules/Sources/Storage/Resources/WooCommerce.xcdatamodeld/.xccurrentversion

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,6 @@
33
<plist version="1.0">
44
<dict>
55
<key>_XCCurrentVersionName</key>
6-
<string>Model 130.xcdatamodel</string>
6+
<string>Model 131.xcdatamodel</string>
77
</dict>
88
</plist>

0 commit comments

Comments
 (0)