Skip to content

Commit d97472a

Browse files
committed
Add BookingResource entity
1 parent d3b1844 commit d97472a

File tree

7 files changed

+61
-20
lines changed

7 files changed

+61
-20
lines changed

Modules/Sources/Fakes/Networking.generated.swift

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -349,9 +349,10 @@ extension Networking.BookingResource {
349349
///
350350
public static func fake() -> Networking.BookingResource {
351351
.init(
352-
id: .fake(),
352+
siteID: .fake(),
353+
bookingID: .fake(),
353354
name: .fake(),
354-
qty: .fake(),
355+
quantity: .fake(),
355356
role: .fake(),
356357
email: .fake(),
357358
phoneNumber: .fake(),

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

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@ import Foundation
33

44
public struct BookingResource: Hashable, Decodable, GeneratedFakeable, GeneratedCopiable {
55
public let siteID: Int64
6-
public let id: Int64
6+
public let bookingID: Int64
77
public let name: String
8-
public let qty: Int64
8+
public let quantity: Int64
99
public let role: String
1010
public let email: String?
1111
public let phoneNumber: String?
@@ -14,19 +14,19 @@ public struct BookingResource: Hashable, Decodable, GeneratedFakeable, Generated
1414
public let description: String?
1515

1616
public init(siteID: Int64,
17-
id: Int64,
17+
bookingID: Int64,
1818
name: String,
19-
qty: Int64,
19+
quantity: Int64,
2020
role: String,
2121
email: String?,
2222
phoneNumber: String?,
2323
imageID: Int64,
2424
imageURL: String?,
2525
description: String?) {
2626
self.siteID = siteID
27-
self.id = id
27+
self.bookingID = bookingID
2828
self.name = name
29-
self.qty = qty
29+
self.quantity = quantity
3030
self.role = role
3131
self.email = email
3232
self.phoneNumber = phoneNumber
@@ -42,9 +42,9 @@ public struct BookingResource: Hashable, Decodable, GeneratedFakeable, Generated
4242

4343
let container = try decoder.container(keyedBy: CodingKeys.self)
4444

45-
let id = try container.decode(Int64.self, forKey: .id)
45+
let bookingID = try container.decode(Int64.self, forKey: .bookingID)
4646
let name = try container.decode(String.self, forKey: .name)
47-
let qty = try container.decode(Int64.self, forKey: .qty)
47+
let quantity = try container.decode(Int64.self, forKey: .quantity)
4848
let role = try container.decode(String.self, forKey: .role)
4949
let email = try container.decodeIfPresent(String.self, forKey: .email)
5050
let phoneNumber = try container.decodeIfPresent(String.self, forKey: .phoneNumber)
@@ -53,9 +53,9 @@ public struct BookingResource: Hashable, Decodable, GeneratedFakeable, Generated
5353
let description = try container.decodeIfPresent(String.self, forKey: .description)
5454

5555
self.init(siteID: siteID,
56-
id: id,
56+
bookingID: bookingID,
5757
name: name,
58-
qty: qty,
58+
quantity: quantity,
5959
role: role,
6060
email: email,
6161
phoneNumber: phoneNumber,
@@ -67,9 +67,9 @@ public struct BookingResource: Hashable, Decodable, GeneratedFakeable, Generated
6767

6868
private extension BookingResource {
6969
enum CodingKeys: String, CodingKey {
70-
case id
70+
case bookingID = "id"
7171
case name
72-
case qty
72+
case quantity = "qty"
7373
case role
7474
case email
7575
case phoneNumber = "phone_number"

Modules/Sources/Networking/Model/Copiable/Models+Copiable.generated.swift

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -496,19 +496,21 @@ extension Networking.Booking {
496496

497497
extension Networking.BookingResource {
498498
public func copy(
499-
id: CopiableProp<Int64> = .copy,
499+
siteID: CopiableProp<Int64> = .copy,
500+
bookingID: CopiableProp<Int64> = .copy,
500501
name: CopiableProp<String> = .copy,
501-
qty: CopiableProp<Int64> = .copy,
502+
quantity: CopiableProp<Int64> = .copy,
502503
role: CopiableProp<String> = .copy,
503504
email: NullableCopiableProp<String> = .copy,
504505
phoneNumber: NullableCopiableProp<String> = .copy,
505506
imageID: CopiableProp<Int64> = .copy,
506507
imageURL: NullableCopiableProp<String> = .copy,
507508
description: NullableCopiableProp<String> = .copy
508509
) -> Networking.BookingResource {
509-
let id = id ?? self.id
510+
let siteID = siteID ?? self.siteID
511+
let bookingID = bookingID ?? self.bookingID
510512
let name = name ?? self.name
511-
let qty = qty ?? self.qty
513+
let quantity = quantity ?? self.quantity
512514
let role = role ?? self.role
513515
let email = email ?? self.email
514516
let phoneNumber = phoneNumber ?? self.phoneNumber
@@ -517,9 +519,10 @@ extension Networking.BookingResource {
517519
let description = description ?? self.description
518520

519521
return Networking.BookingResource(
520-
id: id,
522+
siteID: siteID,
523+
bookingID: bookingID,
521524
name: name,
522-
qty: qty,
525+
quantity: quantity,
523526
role: role,
524527
email: email,
525528
phoneNumber: phoneNumber,
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
import Foundation
2+
import CoreData
3+
4+
@objc(BookingResource)
5+
public class BookingResource: NSManagedObject {
6+
7+
}
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import Foundation
2+
import CoreData
3+
4+
extension BookingResource {
5+
@NSManaged public var siteID: Int64
6+
@NSManaged public var bookingID: Int64
7+
@NSManaged public var name: String?
8+
@NSManaged public var quantity: Int64
9+
@NSManaged public var role: String?
10+
@NSManaged public var email: String?
11+
@NSManaged public var phoneNumber: String?
12+
@NSManaged public var imageID: Int64
13+
@NSManaged public var imageURL: String?
14+
@NSManaged public var descriptionText: String?
15+
16+
}

Modules/Sources/Storage/Model/MIGRATIONS.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ This file documents changes in the WCiOS Storage data model. Please explain any
99
- Added `BookingProductInfo` entity.
1010
- Added `BookingPaymentInfo` entity.
1111
- Added `orderInfo` relationship to `Booking` entity.
12+
- @itsmeichigo 2025-10-16
13+
- Added `BookingResource` entity.
1214

1315
## Model 127 (Release 23.4.0.0)
1416
- @itsmeichigo 2025-09-23

Modules/Sources/Storage/Resources/WooCommerce.xcdatamodeld/Model 128.xcdatamodel/contents

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,18 @@
117117
<attribute name="name" attributeType="String" defaultValueString=""/>
118118
<relationship name="orderInfo" optional="YES" maxCount="1" deletionRule="Nullify" destinationEntity="BookingOrderInfo" inverseName="productInfo" inverseEntity="BookingOrderInfo"/>
119119
</entity>
120+
<entity name="BookingResource" representedClassName="BookingResource" syncable="YES">
121+
<attribute name="bookingID" attributeType="Integer 64" defaultValueString="0" usesScalarValueType="YES"/>
122+
<attribute name="descriptionText" optional="YES" attributeType="String"/>
123+
<attribute name="email" optional="YES" attributeType="String"/>
124+
<attribute name="imageID" attributeType="Integer 64" defaultValueString="0" usesScalarValueType="YES"/>
125+
<attribute name="imageURL" optional="YES" attributeType="String"/>
126+
<attribute name="name" attributeType="String" defaultValueString=""/>
127+
<attribute name="phoneNumber" optional="YES" attributeType="String"/>
128+
<attribute name="quantity" attributeType="Integer 64" defaultValueString="0" usesScalarValueType="YES"/>
129+
<attribute name="role" attributeType="String" defaultValueString=""/>
130+
<attribute name="siteID" attributeType="Integer 64" defaultValueString="0" usesScalarValueType="YES"/>
131+
</entity>
120132
<entity name="Country" representedClassName="Country" syncable="YES">
121133
<attribute name="code" attributeType="String"/>
122134
<attribute name="name" attributeType="String"/>

0 commit comments

Comments
 (0)