Skip to content

Commit c8677ed

Browse files
committed
Use coupon code in POSCoupon
1 parent d5563c2 commit c8677ed

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed
Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
11
public struct POSCoupon: Equatable, Hashable {
22
public let id: UUID
3-
public let couponID: Int64
3+
public let code: String
4+
5+
public init(id: UUID, code: String) {
6+
self.id = id
7+
self.code = code
8+
}
49
}

Yosemite/Yosemite/PointOfSale/PointOfSaleItemService.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ public final class PointOfSaleItemService: PointOfSaleItemServiceProtocol {
125125

126126
private func mapCouponsToPOSItems(coupons: [Coupon]) -> [POSItem] {
127127
coupons.compactMap { coupon in
128-
.coupon(POSCoupon(id: UUID(), couponID: coupon.couponID))
128+
.coupon(POSCoupon(id: UUID(), couponID: coupon.code))
129129
}
130130
}
131131

0 commit comments

Comments
 (0)