Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion Modules/Sources/Fakes/Networking.generated.swift
Original file line number Diff line number Diff line change
Expand Up @@ -343,7 +343,8 @@ extension Networking.Booking {
attendanceStatusKey: .fake(),
localTimezone: .fake(),
currency: .fake(),
orderInfo: .fake()
orderInfo: .fake(),
note: .fake()
)
}
}
Expand Down
10 changes: 8 additions & 2 deletions Modules/Sources/Networking/Model/Bookings/Booking.swift
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ public struct Booking: Codable, GeneratedCopiable, Hashable, GeneratedFakeable {
public let localTimezone: String
public let currency: String
public let orderInfo: BookingOrderInfo?
public let note: String

public var bookingStatus: BookingStatus {
return BookingStatus(rawValue: statusKey) ?? .unknown
Expand Down Expand Up @@ -54,7 +55,8 @@ public struct Booking: Codable, GeneratedCopiable, Hashable, GeneratedFakeable {
attendanceStatusKey: String,
localTimezone: String,
currency: String,
orderInfo: BookingOrderInfo?) {
orderInfo: BookingOrderInfo?,
note: String) {
self.siteID = siteID
self.bookingID = bookingID
self.allDay = allDay
Expand All @@ -75,6 +77,7 @@ public struct Booking: Codable, GeneratedCopiable, Hashable, GeneratedFakeable {
self.localTimezone = localTimezone
self.currency = currency
self.orderInfo = orderInfo
self.note = note
}

/// The public initializer for Booking.
Expand Down Expand Up @@ -129,6 +132,7 @@ public struct Booking: Codable, GeneratedCopiable, Hashable, GeneratedFakeable {
let localTimezone = try container.decode(String.self, forKey: .localTimezone)
let currency = try container.decode(String.self, forKey: .currency)
let orderInfo: BookingOrderInfo? = nil // to be prefilled when synced
let note = try container.decode(String.self, forKey: .note)

self.init(siteID: siteID,
bookingID: bookingID,
Expand All @@ -149,7 +153,8 @@ public struct Booking: Codable, GeneratedCopiable, Hashable, GeneratedFakeable {
attendanceStatusKey: attendanceStatusKey,
localTimezone: localTimezone,
currency: currency,
orderInfo: orderInfo)
orderInfo: orderInfo,
note: note)
}

public func encode(to encoder: Encoder) throws {
Expand Down Expand Up @@ -203,6 +208,7 @@ private extension Booking {
case attendanceStatusKey = "attendance_status"
case localTimezone = "local_timezone"
case currency
case note
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -450,7 +450,8 @@ extension Networking.Booking {
attendanceStatusKey: CopiableProp<String> = .copy,
localTimezone: CopiableProp<String> = .copy,
currency: CopiableProp<String> = .copy,
orderInfo: NullableCopiableProp<BookingOrderInfo> = .copy
orderInfo: NullableCopiableProp<BookingOrderInfo> = .copy,
note: CopiableProp<String> = .copy
) -> Networking.Booking {
let siteID = siteID ?? self.siteID
let bookingID = bookingID ?? self.bookingID
Expand All @@ -472,6 +473,7 @@ extension Networking.Booking {
let localTimezone = localTimezone ?? self.localTimezone
let currency = currency ?? self.currency
let orderInfo = orderInfo ?? self.orderInfo
let note = note ?? self.note

return Networking.Booking(
siteID: siteID,
Expand All @@ -493,7 +495,8 @@ extension Networking.Booking {
attendanceStatusKey: attendanceStatusKey,
localTimezone: localTimezone,
currency: currency,
orderInfo: orderInfo
orderInfo: orderInfo,
note: note
)
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,5 @@ extension Booking {
@NSManaged public var localTimezone: String?
@NSManaged public var currency: String?
@NSManaged public var orderInfo: BookingOrderInfo?
@NSManaged public var note: String?
}
4 changes: 4 additions & 0 deletions Modules/Sources/Storage/Model/MIGRATIONS.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

This file documents changes in the WCiOS Storage data model. Please explain any changes to the data model as well as any custom migrations.

## Model 130 (Release 23.7)
- @adborbas 2025-11-06
- Added `note` attribute to `Booking` entity.

## Model 129 (Release X.X.X.X)
- @rafaelkayumov 2025-10-17
- Added `attendanceStatusKey` attribute to `Booking` entity.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
<plist version="1.0">
<dict>
<key>_XCCurrentVersionName</key>
<string>Model 129.xcdatamodel</string>
<string>Model 130.xcdatamodel</string>
</dict>
</plist>
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<model type="com.apple.IDECoreDataModeler.DataModel" documentVersion="1.0" lastSavedToolsVersion="24299" systemVersion="24G90" minimumToolsVersion="Automatic" sourceLanguage="Swift" userDefinedModelVersionIdentifier="">
<model type="com.apple.IDECoreDataModeler.DataModel" documentVersion="1.0" lastSavedToolsVersion="24299" systemVersion="25A362" minimumToolsVersion="Automatic" sourceLanguage="Swift" userDefinedModelVersionIdentifier="">
<entity name="Account" representedClassName="Account" syncable="YES">
<attribute name="displayName" optional="YES" attributeType="String"/>
<attribute name="email" optional="YES" attributeType="String"/>
Expand Down
Loading