Skip to content

Commit 7658d75

Browse files
committed
Merge remote-tracking branch 'origin/develop' into issue/22-woo-epilogue
2 parents 0aaca65 + d877b7f commit 7658d75

File tree

76 files changed

+2833
-3344
lines changed

Some content is hidden

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

76 files changed

+2833
-3344
lines changed

Networking/Networking.xcodeproj/project.pbxproj

Lines changed: 37 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,14 @@
99
/* Begin PBXBuildFile section */
1010
21DB5B99C4107CF69C0A57EC /* Pods_NetworkingTests.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 69314EDE650855CAF927057E /* Pods_NetworkingTests.framework */; };
1111
6647C0161DAC6AB6570C53A7 /* Pods_Networking.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F3F25DC15EC1D7C631169CB5 /* Pods_Networking.framework */; };
12+
741B950120EBC8A700DD6E2D /* OrderCouponLine.swift in Sources */ = {isa = PBXBuildFile; fileRef = 741B950020EBC8A700DD6E2D /* OrderCouponLine.swift */; };
13+
74C8F06420EEB44800B6EDC9 /* OrderNote.swift in Sources */ = {isa = PBXBuildFile; fileRef = 74C8F06320EEB44800B6EDC9 /* OrderNote.swift */; };
14+
74C8F06620EEB76400B6EDC9 /* order-notes.json in Resources */ = {isa = PBXBuildFile; fileRef = 74C8F06520EEB76400B6EDC9 /* order-notes.json */; };
15+
74C8F06820EEB7BD00B6EDC9 /* OrderNotesMapper.swift in Sources */ = {isa = PBXBuildFile; fileRef = 74C8F06720EEB7BC00B6EDC9 /* OrderNotesMapper.swift */; };
16+
74C8F06A20EEBC8C00B6EDC9 /* OrderMapperTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 74C8F06920EEBC8C00B6EDC9 /* OrderMapperTests.swift */; };
17+
74C8F06C20EEBD5D00B6EDC9 /* broken-order.json in Resources */ = {isa = PBXBuildFile; fileRef = 74C8F06B20EEBD5D00B6EDC9 /* broken-order.json */; };
18+
74C8F06E20EEC1E800B6EDC9 /* OrderNotesMapperTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 74C8F06D20EEC1E700B6EDC9 /* OrderNotesMapperTests.swift */; };
19+
74C8F07020EEC3A800B6EDC9 /* broken-notes.json in Resources */ = {isa = PBXBuildFile; fileRef = 74C8F06F20EEC3A800B6EDC9 /* broken-notes.json */; };
1220
B505F6CD20BEE37E00BB1B69 /* AccountMapper.swift in Sources */ = {isa = PBXBuildFile; fileRef = B505F6CC20BEE37E00BB1B69 /* AccountMapper.swift */; };
1321
B505F6CF20BEE38B00BB1B69 /* Account.swift in Sources */ = {isa = PBXBuildFile; fileRef = B505F6CE20BEE38B00BB1B69 /* Account.swift */; };
1422
B505F6D120BEE39600BB1B69 /* AccountRemote.swift in Sources */ = {isa = PBXBuildFile; fileRef = B505F6D020BEE39600BB1B69 /* AccountRemote.swift */; };
@@ -48,7 +56,7 @@
4856
B5C6FCCF20A3592900A4F8E4 /* OrderItem.swift in Sources */ = {isa = PBXBuildFile; fileRef = B5C6FCCE20A3592900A4F8E4 /* OrderItem.swift */; };
4957
B5C6FCD420A373BB00A4F8E4 /* OrderMapper.swift in Sources */ = {isa = PBXBuildFile; fileRef = B5C6FCD320A373BA00A4F8E4 /* OrderMapper.swift */; };
5058
B5C6FCD620A3768900A4F8E4 /* order.json in Resources */ = {isa = PBXBuildFile; fileRef = B5C6FCD520A3768900A4F8E4 /* order.json */; };
51-
CE20179320E3EFA7005B4C18 /* broken-order.json in Resources */ = {isa = PBXBuildFile; fileRef = CE20179220E3EFA7005B4C18 /* broken-order.json */; };
59+
CE20179320E3EFA7005B4C18 /* broken-orders.json in Resources */ = {isa = PBXBuildFile; fileRef = CE20179220E3EFA7005B4C18 /* broken-orders.json */; };
5260
/* End PBXBuildFile section */
5361

5462
/* Begin PBXContainerItemProxy section */
@@ -63,6 +71,14 @@
6371

6472
/* Begin PBXFileReference section */
6573
69314EDE650855CAF927057E /* Pods_NetworkingTests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_NetworkingTests.framework; sourceTree = BUILT_PRODUCTS_DIR; };
74+
741B950020EBC8A700DD6E2D /* OrderCouponLine.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = OrderCouponLine.swift; sourceTree = "<group>"; };
75+
74C8F06320EEB44800B6EDC9 /* OrderNote.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = OrderNote.swift; sourceTree = "<group>"; };
76+
74C8F06520EEB76400B6EDC9 /* order-notes.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = "order-notes.json"; sourceTree = "<group>"; };
77+
74C8F06720EEB7BC00B6EDC9 /* OrderNotesMapper.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = OrderNotesMapper.swift; sourceTree = "<group>"; };
78+
74C8F06920EEBC8C00B6EDC9 /* OrderMapperTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = OrderMapperTests.swift; sourceTree = "<group>"; };
79+
74C8F06B20EEBD5D00B6EDC9 /* broken-order.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = "broken-order.json"; sourceTree = "<group>"; };
80+
74C8F06D20EEC1E700B6EDC9 /* OrderNotesMapperTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = OrderNotesMapperTests.swift; sourceTree = "<group>"; };
81+
74C8F06F20EEC3A800B6EDC9 /* broken-notes.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = "broken-notes.json"; sourceTree = "<group>"; };
6682
753D6504FF01F09F6A33B73E /* Pods-Networking.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Networking.debug.xcconfig"; path = "../Pods/Target Support Files/Pods-Networking/Pods-Networking.debug.xcconfig"; sourceTree = "<group>"; };
6783
B505F6CC20BEE37E00BB1B69 /* AccountMapper.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AccountMapper.swift; sourceTree = "<group>"; };
6884
B505F6CE20BEE38B00BB1B69 /* Account.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Account.swift; sourceTree = "<group>"; };
@@ -108,7 +124,7 @@
108124
B5C6FCD520A3768900A4F8E4 /* order.json */ = {isa = PBXFileReference; lastKnownFileType = text.json; path = order.json; sourceTree = "<group>"; };
109125
BD9439D9B8F2C1ED2EADAA51 /* Pods-NetworkingTests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-NetworkingTests.debug.xcconfig"; path = "../Pods/Target Support Files/Pods-NetworkingTests/Pods-NetworkingTests.debug.xcconfig"; sourceTree = "<group>"; };
110126
C8F9A8CC6F90A8C9B5EF2EE2 /* Pods-Networking.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Networking.release.xcconfig"; path = "../Pods/Target Support Files/Pods-Networking/Pods-Networking.release.xcconfig"; sourceTree = "<group>"; };
111-
CE20179220E3EFA7005B4C18 /* broken-order.json */ = {isa = PBXFileReference; lastKnownFileType = text.json; path = "broken-order.json"; sourceTree = "<group>"; };
127+
CE20179220E3EFA7005B4C18 /* broken-orders.json */ = {isa = PBXFileReference; lastKnownFileType = text.json; path = "broken-orders.json"; sourceTree = "<group>"; };
112128
F3F25DC15EC1D7C631169CB5 /* Pods_Networking.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Networking.framework; sourceTree = BUILT_PRODUCTS_DIR; };
113129
F6CEE1CA2AD376C0C28AE9F6 /* Pods-NetworkingTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-NetworkingTests.release.xcconfig"; path = "../Pods/Target Support Files/Pods-NetworkingTests/Pods-NetworkingTests.release.xcconfig"; sourceTree = "<group>"; };
114130
/* End PBXFileReference section */
@@ -221,7 +237,6 @@
221237
B557DA0520975507005962F4 /* Remote */,
222238
B557DA1020975F60005962F4 /* Settings */,
223239
B505F6EB20BEFD9100BB1B69 /* Tools */,
224-
CE60505720D9A99C00A74DD6 /* Utilities */,
225240
B557D9E6209753AA005962F4 /* Networking.h */,
226241
B557D9E7209753AA005962F4 /* Info.plist */,
227242
);
@@ -279,8 +294,10 @@
279294
B505F6CE20BEE38B00BB1B69 /* Account.swift */,
280295
B5BB1D0F20A237FB00112D92 /* Address.swift */,
281296
B557DA1C20979E7D005962F4 /* Order.swift */,
282-
B5BB1D1120A255EC00112D92 /* OrderStatus.swift */,
297+
741B950020EBC8A700DD6E2D /* OrderCouponLine.swift */,
283298
B5C6FCCE20A3592900A4F8E4 /* OrderItem.swift */,
299+
74C8F06320EEB44800B6EDC9 /* OrderNote.swift */,
300+
B5BB1D1120A255EC00112D92 /* OrderStatus.swift */,
284301
);
285302
path = Model;
286303
sourceTree = "<group>";
@@ -291,7 +308,10 @@
291308
B505F6D420BEE4E600BB1B69 /* me.json */,
292309
B559EBA920A0B5CD00836CD4 /* orders-load-all.json */,
293310
B5C6FCD520A3768900A4F8E4 /* order.json */,
294-
CE20179220E3EFA7005B4C18 /* broken-order.json */,
311+
CE20179220E3EFA7005B4C18 /* broken-orders.json */,
312+
74C8F06B20EEBD5D00B6EDC9 /* broken-order.json */,
313+
74C8F06520EEB76400B6EDC9 /* order-notes.json */,
314+
74C8F06F20EEC3A800B6EDC9 /* broken-notes.json */,
295315
);
296316
path = Responses;
297317
sourceTree = "<group>";
@@ -303,6 +323,7 @@
303323
B505F6CC20BEE37E00BB1B69 /* AccountMapper.swift */,
304324
B5C6FCD320A373BA00A4F8E4 /* OrderMapper.swift */,
305325
B567AF2A20A0FA4200AB6C62 /* OrderListMapper.swift */,
326+
74C8F06720EEB7BC00B6EDC9 /* OrderNotesMapper.swift */,
306327
);
307328
path = Mapper;
308329
sourceTree = "<group>";
@@ -328,6 +349,8 @@
328349
children = (
329350
B505F6D220BEE3A500BB1B69 /* AccountMapperTests.swift */,
330351
B5C6FCCC20A34B8300A4F8E4 /* OrderListMapperTests.swift */,
352+
74C8F06920EEBC8C00B6EDC9 /* OrderMapperTests.swift */,
353+
74C8F06D20EEC1E700B6EDC9 /* OrderNotesMapperTests.swift */,
331354
);
332355
path = Mapper;
333356
sourceTree = "<group>";
@@ -343,13 +366,6 @@
343366
name = Pods;
344367
sourceTree = "<group>";
345368
};
346-
CE60505720D9A99C00A74DD6 /* Utilities */ = {
347-
isa = PBXGroup;
348-
children = (
349-
);
350-
path = Utilities;
351-
sourceTree = "<group>";
352-
};
353369
/* End PBXGroup section */
354370

355371
/* Begin PBXHeadersBuildPhase section */
@@ -452,10 +468,13 @@
452468
isa = PBXResourcesBuildPhase;
453469
buildActionMask = 2147483647;
454470
files = (
471+
74C8F06620EEB76400B6EDC9 /* order-notes.json in Resources */,
472+
74C8F06C20EEBD5D00B6EDC9 /* broken-order.json in Resources */,
455473
B505F6D520BEE4E700BB1B69 /* me.json in Resources */,
456474
B5C6FCD620A3768900A4F8E4 /* order.json in Resources */,
457475
B559EBAA20A0B5CD00836CD4 /* orders-load-all.json in Resources */,
458-
CE20179320E3EFA7005B4C18 /* broken-order.json in Resources */,
476+
CE20179320E3EFA7005B4C18 /* broken-orders.json in Resources */,
477+
74C8F07020EEC3A800B6EDC9 /* broken-notes.json in Resources */,
459478
);
460479
runOnlyForDeploymentPostprocessing = 0;
461480
};
@@ -526,6 +545,8 @@
526545
buildActionMask = 2147483647;
527546
files = (
528547
B557DA1A20979D66005962F4 /* Settings.swift in Sources */,
548+
741B950120EBC8A700DD6E2D /* OrderCouponLine.swift in Sources */,
549+
74C8F06420EEB44800B6EDC9 /* OrderNote.swift in Sources */,
529550
B5BB1D0C20A2050300112D92 /* DateFormatter+Woo.swift in Sources */,
530551
B567AF2520A0CCA300AB6C62 /* AuthenticatedRequest.swift in Sources */,
531552
B505F6EA20BEFC3700BB1B69 /* MockupNetwork.swift in Sources */,
@@ -541,6 +562,7 @@
541562
B5C6FCCF20A3592900A4F8E4 /* OrderItem.swift in Sources */,
542563
B505F6EC20BEFDC200BB1B69 /* Loader.swift in Sources */,
543564
B5BB1D1220A255EC00112D92 /* OrderStatus.swift in Sources */,
565+
74C8F06820EEB7BD00B6EDC9 /* OrderNotesMapper.swift in Sources */,
544566
B5BB1D1020A237FB00112D92 /* Address.swift in Sources */,
545567
B557DA0420975500005962F4 /* OrdersRemote.swift in Sources */,
546568
B5C6FCD420A373BB00A4F8E4 /* OrderMapper.swift in Sources */,
@@ -558,10 +580,12 @@
558580
files = (
559581
B505F6D320BEE3A500BB1B69 /* AccountMapperTests.swift in Sources */,
560582
B5C6FCC820A32E4800A4F8E4 /* DateFormatterWooTests.swift in Sources */,
583+
74C8F06A20EEBC8C00B6EDC9 /* OrderMapperTests.swift in Sources */,
561584
B567AF3120A0FB8F00AB6C62 /* JetpackRequestTests.swift in Sources */,
562585
B505F6D720BEE58800BB1B69 /* AccountRemoteTests.swift in Sources */,
563586
B518662A20A09C6F00037A38 /* OrdersRemoteTests.swift in Sources */,
564587
B5969E1520A47F99005E9DF1 /* RemoteTests.swift in Sources */,
588+
74C8F06E20EEC1E800B6EDC9 /* OrderNotesMapperTests.swift in Sources */,
565589
B567AF2F20A0FB8F00AB6C62 /* AuthenticatedRequestTests.swift in Sources */,
566590
B5C6FCCD20A34B8300A4F8E4 /* OrderListMapperTests.swift in Sources */,
567591
B518663520A0A2E800037A38 /* Constants.swift in Sources */,
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
import Foundation
2+
3+
4+
/// Mapper: OrderNotes
5+
///
6+
class OrderNotesMapper: Mapper {
7+
8+
/// (Attempts) to convert a dictionary into [OrderNote].
9+
///
10+
func map(response: Data) throws -> [OrderNote] {
11+
let decoder = JSONDecoder()
12+
decoder.dateDecodingStrategy = .formatted(DateFormatter.Defaults.dateTimeFormatter)
13+
14+
return try decoder.decode(OrderNotesEnvelope.self, from: response).orderNotes
15+
}
16+
}
17+
18+
19+
/// OrderNote Disposable Entity:
20+
/// `Load Order Notes` endpoint returns all of its notes within the `data` key. This entity
21+
/// allows us to do parse all the things with JSONDecoder.
22+
///
23+
private struct OrderNotesEnvelope: Decodable {
24+
let orderNotes: [OrderNote]
25+
26+
private enum CodingKeys: String, CodingKey {
27+
case orderNotes = "data"
28+
}
29+
}

Networking/Networking/Model/Address.swift

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ public struct Address: Decodable {
1313
public let state: String
1414
public let postcode: String
1515
public let country: String
16+
public let phone: String?
17+
public let email: String?
1618
}
1719

1820

@@ -30,6 +32,8 @@ private extension Address {
3032
case state = "state"
3133
case postcode = "postcode"
3234
case country = "country"
35+
case phone = "phone"
36+
case email = "email"
3337
}
3438
}
3539

@@ -46,7 +50,9 @@ extension Address: Comparable {
4650
lhs.city == rhs.city &&
4751
lhs.state == rhs.state &&
4852
lhs.postcode == rhs.postcode &&
49-
lhs.country == rhs.country
53+
lhs.country == rhs.country &&
54+
lhs.phone == rhs.phone &&
55+
lhs.email == rhs.email
5056
}
5157

5258
public static func < (lhs: Address, rhs: Address) -> Bool {

Networking/Networking/Model/Order.swift

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,17 @@ public struct Order: Decodable {
2323
public let shippingTax: String
2424
public let total: String
2525
public let totalTax: String
26+
public let paymentMethodTitle: String
2627

2728
public let items: [OrderItem]
2829
public let billingAddress: Address
2930
public let shippingAddress: Address
31+
public let coupons: [OrderCouponLine]
3032

3133
/// Order struct initializer.
3234
///
33-
init(orderID: Int, parentID: Int, customerID: Int, number: String, status: OrderStatus, currency: String, customerNote: String?, dateCreated: Date, dateModified: Date, datePaid: Date?, discountTotal: String, discountTax: String, shippingTotal: String, shippingTax: String, total: String, totalTax: String, items: [OrderItem], billingAddress: Address, shippingAddress: Address) {
35+
init(orderID: Int, parentID: Int, customerID: Int, number: String, status: OrderStatus, currency: String, customerNote: String?, dateCreated: Date, dateModified: Date, datePaid: Date?, discountTotal: String, discountTax: String, shippingTotal: String, shippingTax: String, total: String, totalTax: String, paymentMethodTitle: String, items: [OrderItem], billingAddress: Address, shippingAddress: Address, coupons: [OrderCouponLine]) {
36+
3437
self.orderID = orderID
3538
self.parentID = parentID
3639
self.customerID = customerID
@@ -50,10 +53,12 @@ public struct Order: Decodable {
5053
self.shippingTax = shippingTax
5154
self.total = total
5255
self.totalTax = totalTax
56+
self.paymentMethodTitle = paymentMethodTitle
5357

5458
self.items = items
5559
self.billingAddress = billingAddress
5660
self.shippingAddress = shippingAddress
61+
self.coupons = coupons
5762
}
5863

5964

@@ -80,12 +85,14 @@ public struct Order: Decodable {
8085
let shippingTotal = try container.decode(String.self, forKey: .shippingTotal)
8186
let total = try container.decode(String.self, forKey: .total)
8287
let totalTax = try container.decode(String.self, forKey: .totalTax)
88+
let paymentMethodTitle = try container.decode(String.self, forKey: .paymentMethodTitle)
8389

8490
let items = try container.decode([OrderItem].self, forKey: .items)
8591
let shippingAddress = try container.decode(Address.self, forKey: .shippingAddress)
8692
let billingAddress = try container.decode(Address.self, forKey: .billingAddress)
93+
let coupons = try container.decode([OrderCouponLine].self, forKey: .couponLines)
8794

88-
self.init(orderID: orderID, parentID: parentID, customerID: customerID, number: number, status: status, currency: currency, customerNote: customerNote, dateCreated: dateCreated, dateModified: dateModified, datePaid: datePaid, discountTotal: discountTotal, discountTax: discountTax, shippingTotal: shippingTotal, shippingTax: shippingTax, total: total, totalTax: totalTax, items: items, billingAddress: billingAddress, shippingAddress: shippingAddress) // initialize the struct
95+
self.init(orderID: orderID, parentID: parentID, customerID: customerID, number: number, status: status, currency: currency, customerNote: customerNote, dateCreated: dateCreated, dateModified: dateModified, datePaid: datePaid, discountTotal: discountTotal, discountTax: discountTax, shippingTotal: shippingTotal, shippingTax: shippingTax, total: total, totalTax: totalTax, paymentMethodTitle: paymentMethodTitle, items: items, billingAddress: billingAddress, shippingAddress: shippingAddress, coupons: coupons) // initialize the struct
8996
}
9097
}
9198

@@ -114,10 +121,12 @@ private extension Order {
114121
case shippingTax = "shipping_tax"
115122
case total = "total"
116123
case totalTax = "total_tax"
124+
case paymentMethodTitle = "payment_method_title"
117125

118126
case items = "line_items"
119127
case shippingAddress = "shipping"
120128
case billingAddress = "billing"
129+
case couponLines = "coupon_lines"
121130
}
122131
}
123132

@@ -140,8 +149,10 @@ extension Order: Comparable {
140149
lhs.shippingTax == rhs.shippingTax &&
141150
lhs.total == rhs.total &&
142151
lhs.totalTax == rhs.totalTax &&
152+
lhs.paymentMethodTitle == rhs.paymentMethodTitle &&
143153
lhs.billingAddress == rhs.billingAddress &&
144154
lhs.shippingAddress == rhs.shippingAddress &&
155+
lhs.coupons == rhs.coupons &&
145156
lhs.items.count == rhs.items.count &&
146157
lhs.items.sorted() == rhs.items.sorted()
147158
}
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
import Foundation
2+
3+
4+
/// Represents a CouponLine Entity within an Order.
5+
///
6+
public struct OrderCouponLine: Decodable {
7+
public let couponID: Int
8+
public let code: String
9+
public let discount: String
10+
public let discountTax: String
11+
}
12+
13+
14+
/// Defines all of the CouponLine's CodingKeys.
15+
///
16+
private extension OrderCouponLine {
17+
18+
enum CodingKeys: String, CodingKey {
19+
case couponID = "id"
20+
case code = "code"
21+
case discount = "discount"
22+
case discountTax = "discount_tax"
23+
}
24+
}
25+
26+
27+
// MARK: - Comparable Conformance
28+
//
29+
extension OrderCouponLine: Comparable {
30+
public static func == (lhs: OrderCouponLine, rhs: OrderCouponLine) -> Bool {
31+
return lhs.couponID == rhs.couponID &&
32+
lhs.code == rhs.code &&
33+
lhs.discount == rhs.discount &&
34+
lhs.discountTax == rhs.discountTax
35+
}
36+
37+
public static func < (lhs: OrderCouponLine, rhs: OrderCouponLine) -> Bool {
38+
return lhs.couponID < rhs.couponID ||
39+
(lhs.couponID == rhs.couponID && lhs.code < rhs.code) ||
40+
(lhs.couponID == rhs.couponID && lhs.code == rhs.code && lhs.discount < rhs.discount)
41+
}
42+
}

0 commit comments

Comments
 (0)