Skip to content

Commit e7f9351

Browse files
authored
Merge branch 'trunk' into woomob-1248-ipados-26woo-pos-adjust-layout-for-smaller-window-heights
2 parents 3dd3043 + 5cff5f0 commit e7f9351

File tree

456 files changed

+15606
-2828
lines changed

Some content is hidden

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

456 files changed

+15606
-2828
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
<!--
22
Contains editorialized release notes. Raw release notes should go into `RELEASE-NOTES.txt`.
33
-->
4+
## 23.3
5+
Enjoy a smoother store management experience with clearer shipping labels for physical items, friendlier product code error messages, more reliable custom fields, and better app performance for users authenticated with WordPress.com. All designed to streamline your daily workflow.
6+
47
## 23.2
58
This update smooths your WooCommerce experience with improved cash payments, easier access to POS settings, and accurate HAZMAT details on shipping labels. Plus, we fixed a Blaze flow issue so campaigns behave as expected. Faster, clearer, and more reliable — just how you need it!
69

Modules/Package.swift

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,10 @@ let package = Package(
179179
),
180180
.target(
181181
name: "WooFoundation",
182-
dependencies: ["WooFoundationCore"]
182+
dependencies: [
183+
"WooFoundationCore",
184+
.product(name: "Kingfisher", package: "Kingfisher")
185+
]
183186
),
184187
.target(
185188
name: "WooFoundationCore",

Modules/Sources/Experiments/DefaultFeatureFlagService.swift

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -84,8 +84,6 @@ public struct DefaultFeatureFlagService: FeatureFlagService {
8484
return false
8585
case .inventoryProductLabelsInPOS:
8686
return false
87-
case .pointOfSaleReceipts:
88-
return true
8987
case .productImageOptimizedHandling:
9088
return true
9189
case .pointOfSaleAsATabi2:
@@ -100,10 +98,10 @@ public struct DefaultFeatureFlagService: FeatureFlagService {
10098
return true
10199
case .pointOfSaleHistoricalOrdersi1:
102100
return buildConfig == .localDeveloper || buildConfig == .alpha
103-
case .applicationPasswordExperiment:
104-
return buildConfig == .localDeveloper || buildConfig == .alpha
105101
case .pointOfSaleLocalCatalogi1:
106102
return buildConfig == .localDeveloper || buildConfig == .alpha
103+
case .ciabBookings:
104+
return buildConfig == .localDeveloper || buildConfig == .alpha
107105
default:
108106
return true
109107
}

Modules/Sources/Experiments/FeatureFlag.swift

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -179,10 +179,6 @@ public enum FeatureFlag: Int {
179179
///
180180
case inventoryProductLabelsInPOS
181181

182-
/// Enables sending POS specific email receipts for eligible stores
183-
///
184-
case pointOfSaleReceipts
185-
186182
/// Enables displaying POS as a tab in the tab bar for stores in eligible countries
187183
///
188184
case pointOfSaleAsATabi2
@@ -207,12 +203,12 @@ public enum FeatureFlag: Int {
207203
///
208204
case pointOfSaleHistoricalOrdersi1
209205

210-
/// Enables switching Jetpack requests to use application password
211-
///
212-
case applicationPasswordExperiment
213-
214206
/// Enables Local Catalog i1 in Point of Sale.
215207
/// It syncs products and variations to local storage and display them in POS for quick access.
216208
///
217209
case pointOfSaleLocalCatalogi1
210+
211+
/// Enables a new Bookings tab for CIAB sites
212+
///
213+
case ciabBookings
218214
}

Modules/Sources/Fakes/Networking.generated.swift

Lines changed: 29 additions & 1 deletion
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
///
@@ -1774,7 +1799,10 @@ extension Networking.Site {
17741799
isAdmin: .fake(),
17751800
wasEcommerceTrial: .fake(),
17761801
hasSSOEnabled: .fake(),
1777-
applicationPasswordAvailable: .fake()
1802+
applicationPasswordAvailable: .fake(),
1803+
isGarden: .fake(),
1804+
gardenName: .fake(),
1805+
gardenPartner: .fake()
17781806
)
17791807
}
17801808
}
Lines changed: 185 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,185 @@
1+
import Codegen
2+
import Foundation
3+
4+
/// Represents a Booking Entity.
5+
///
6+
public struct Booking: Codable, GeneratedCopiable, Equatable, GeneratedFakeable {
7+
public let siteID: Int64
8+
public let bookingID: Int64
9+
public let allDay: Bool
10+
public let cost: String
11+
public let customerID: Int64
12+
public let dateCreated: Date
13+
public let dateModified: Date
14+
public let endDate: Date
15+
public let googleCalendarEventID: String?
16+
public let orderID: Int64
17+
public let orderItemID: Int64
18+
public let parentID: Int64
19+
public let productID: Int64
20+
public let resourceID: Int64
21+
public let startDate: Date
22+
public let statusKey: String
23+
public let localTimezone: String
24+
25+
// periphery: ignore - to be used later
26+
public var bookingStatus: BookingStatus {
27+
return BookingStatus(rawValue: statusKey) ?? .unknown
28+
}
29+
30+
/// Booking struct initializer.
31+
///
32+
public init(siteID: Int64,
33+
bookingID: Int64,
34+
allDay: Bool,
35+
cost: String,
36+
customerID: Int64,
37+
dateCreated: Date,
38+
dateModified: Date,
39+
endDate: Date,
40+
googleCalendarEventID: String?,
41+
orderID: Int64,
42+
orderItemID: Int64,
43+
parentID: Int64,
44+
productID: Int64,
45+
resourceID: Int64,
46+
startDate: Date,
47+
statusKey: String,
48+
localTimezone: String) {
49+
self.siteID = siteID
50+
self.bookingID = bookingID
51+
self.allDay = allDay
52+
self.cost = cost
53+
self.customerID = customerID
54+
self.dateCreated = dateCreated
55+
self.dateModified = dateModified
56+
self.endDate = endDate
57+
self.googleCalendarEventID = googleCalendarEventID
58+
self.orderID = orderID
59+
self.orderItemID = orderItemID
60+
self.parentID = parentID
61+
self.productID = productID
62+
self.resourceID = resourceID
63+
self.startDate = startDate
64+
self.statusKey = statusKey
65+
self.localTimezone = localTimezone
66+
}
67+
68+
/// The public initializer for Booking.
69+
///
70+
public init(from decoder: Decoder) throws {
71+
guard let siteID = decoder.userInfo[.siteID] as? Int64 else {
72+
throw BookingDecodingError.missingSiteID
73+
}
74+
75+
let container = try decoder.container(keyedBy: CodingKeys.self)
76+
77+
let bookingID = try container.decode(Int64.self, forKey: .bookingID)
78+
let allDay = try container.decode(Bool.self, forKey: .allDay)
79+
80+
// Cost may come as string or number
81+
let cost = container.failsafeDecodeIfPresent(targetType: String.self,
82+
forKey: .cost,
83+
alternativeTypes: [.decimal(transform: { NSDecimalNumber(decimal: $0).stringValue })]) ?? ""
84+
85+
let customerID = try container.decode(Int64.self, forKey: .customerID)
86+
let dateCreated = Date(timeIntervalSince1970: try container.decode(Double.self, forKey: .dateCreated))
87+
let dateModified = Date(timeIntervalSince1970: try container.decode(Double.self, forKey: .dateModified))
88+
let endDate = Date(timeIntervalSince1970: try container.decode(Double.self, forKey: .endDate))
89+
let googleCalendarEventID = try container.decodeIfPresent(String.self, forKey: .googleCalendarEventID)
90+
let orderID = try container.decode(Int64.self, forKey: .orderID)
91+
let orderItemID = try container.decode(Int64.self, forKey: .orderItemID)
92+
let parentID = try container.decode(Int64.self, forKey: .parentID)
93+
let productID = try container.decode(Int64.self, forKey: .productID)
94+
let resourceID = try container.decode(Int64.self, forKey: .resourceID)
95+
let startDate = Date(timeIntervalSince1970: try container.decode(Double.self, forKey: .startDate))
96+
let statusKey = try container.decode(String.self, forKey: .statusKey)
97+
let localTimezone = try container.decode(String.self, forKey: .localTimezone)
98+
99+
self.init(siteID: siteID,
100+
bookingID: bookingID,
101+
allDay: allDay,
102+
cost: cost,
103+
customerID: customerID,
104+
dateCreated: dateCreated,
105+
dateModified: dateModified,
106+
endDate: endDate,
107+
googleCalendarEventID: googleCalendarEventID,
108+
orderID: orderID,
109+
orderItemID: orderItemID,
110+
parentID: parentID,
111+
productID: productID,
112+
resourceID: resourceID,
113+
startDate: startDate,
114+
statusKey: statusKey,
115+
localTimezone: localTimezone)
116+
}
117+
118+
public func encode(to encoder: Encoder) throws {
119+
var container = encoder.container(keyedBy: CodingKeys.self)
120+
121+
try container.encode(bookingID, forKey: .bookingID)
122+
try container.encode(allDay, forKey: .allDay)
123+
try container.encode(cost, forKey: .cost)
124+
try container.encode(customerID, forKey: .customerID)
125+
try container.encode(dateCreated, forKey: .dateCreated)
126+
try container.encode(dateModified, forKey: .dateModified)
127+
try container.encode(endDate, forKey: .endDate)
128+
try container.encode(googleCalendarEventID, forKey: .googleCalendarEventID)
129+
try container.encode(orderID, forKey: .orderID)
130+
try container.encode(orderItemID, forKey: .orderItemID)
131+
try container.encode(parentID, forKey: .parentID)
132+
try container.encode(productID, forKey: .productID)
133+
try container.encode(resourceID, forKey: .resourceID)
134+
try container.encode(startDate, forKey: .startDate)
135+
try container.encode(statusKey, forKey: .statusKey)
136+
try container.encode(localTimezone, forKey: .localTimezone)
137+
}
138+
}
139+
140+
/// Defines all of the Booking CodingKeys
141+
///
142+
private extension Booking {
143+
144+
enum CodingKeys: String, CodingKey {
145+
case bookingID = "id"
146+
case allDay = "all_day"
147+
case cost
148+
case customerID = "customer_id"
149+
case dateCreated = "date_created"
150+
case dateModified = "date_modified"
151+
case endDate = "end"
152+
case googleCalendarEventID = "google_calendar_event_id"
153+
case orderID = "order_id"
154+
case orderItemID = "order_item_id"
155+
case parentID = "parent_id"
156+
case personCounts = "person_counts"
157+
case productID = "product_id"
158+
case resourceID = "resource_id"
159+
case startDate = "start"
160+
case statusKey = "status"
161+
case localTimezone = "local_timezone"
162+
}
163+
}
164+
165+
// MARK: - Decoding Errors
166+
//
167+
enum BookingDecodingError: Error {
168+
case missingSiteID
169+
}
170+
171+
// MARK: - Supporting Types
172+
//
173+
174+
// periphery: ignore
175+
/// Represents a Booking Status.
176+
public enum BookingStatus: String, CaseIterable {
177+
case complete
178+
case paid
179+
case unpaid
180+
case cancelled
181+
case pendingConfirmation = "pending-confirmation"
182+
case confirmed
183+
case inCart = "in-cart"
184+
case unknown
185+
}

0 commit comments

Comments
 (0)