Skip to content

Commit 589e78f

Browse files
committed
Add coupon management switch state to GeneralAppSettings
1 parent 4a80ce3 commit 589e78f

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

Storage/Storage/Model/Copiable/Models+Copiable.generated.swift

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ extension GeneralAppSettings {
1313
isStripeInPersonPaymentsSwitchEnabled: CopiableProp<Bool> = .copy,
1414
isCanadaInPersonPaymentsSwitchEnabled: CopiableProp<Bool> = .copy,
1515
isProductSKUInputScannerSwitchEnabled: CopiableProp<Bool> = .copy,
16+
isCouponManagementSwitchEnabled: CopiableProp<Bool> = .copy,
1617
knownCardReaders: CopiableProp<[String]> = .copy,
1718
lastEligibilityErrorInfo: NullableCopiableProp<EligibilityErrorInfo> = .copy,
1819
lastJetpackBenefitsBannerDismissedTime: NullableCopiableProp<Date> = .copy
@@ -24,6 +25,7 @@ extension GeneralAppSettings {
2425
let isStripeInPersonPaymentsSwitchEnabled = isStripeInPersonPaymentsSwitchEnabled ?? self.isStripeInPersonPaymentsSwitchEnabled
2526
let isCanadaInPersonPaymentsSwitchEnabled = isCanadaInPersonPaymentsSwitchEnabled ?? self.isCanadaInPersonPaymentsSwitchEnabled
2627
let isProductSKUInputScannerSwitchEnabled = isProductSKUInputScannerSwitchEnabled ?? self.isProductSKUInputScannerSwitchEnabled
28+
let isCouponManagementSwitchEnabled = isCouponManagementSwitchEnabled ?? self.isCouponManagementSwitchEnabled
2729
let knownCardReaders = knownCardReaders ?? self.knownCardReaders
2830
let lastEligibilityErrorInfo = lastEligibilityErrorInfo ?? self.lastEligibilityErrorInfo
2931
let lastJetpackBenefitsBannerDismissedTime = lastJetpackBenefitsBannerDismissedTime ?? self.lastJetpackBenefitsBannerDismissedTime
@@ -36,6 +38,7 @@ extension GeneralAppSettings {
3638
isStripeInPersonPaymentsSwitchEnabled: isStripeInPersonPaymentsSwitchEnabled,
3739
isCanadaInPersonPaymentsSwitchEnabled: isCanadaInPersonPaymentsSwitchEnabled,
3840
isProductSKUInputScannerSwitchEnabled: isProductSKUInputScannerSwitchEnabled,
41+
isCouponManagementSwitchEnabled: isCouponManagementSwitchEnabled,
3942
knownCardReaders: knownCardReaders,
4043
lastEligibilityErrorInfo: lastEligibilityErrorInfo,
4144
lastJetpackBenefitsBannerDismissedTime: lastJetpackBenefitsBannerDismissedTime

Storage/Storage/Model/GeneralAppSettings.swift

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,10 @@ public struct GeneralAppSettings: Codable, Equatable, GeneratedCopiable {
4040
///
4141
public let isProductSKUInputScannerSwitchEnabled: Bool
4242

43+
/// The state for the Coupon Management feature switch.
44+
///
45+
public let isCouponManagementSwitchEnabled: Bool
46+
4347
/// A list (possibly empty) of known card reader IDs - i.e. IDs of card readers that should be reconnected to automatically
4448
/// e.g. ["CHB204909005931"]
4549
///
@@ -59,6 +63,7 @@ public struct GeneralAppSettings: Codable, Equatable, GeneratedCopiable {
5963
isStripeInPersonPaymentsSwitchEnabled: Bool,
6064
isCanadaInPersonPaymentsSwitchEnabled: Bool,
6165
isProductSKUInputScannerSwitchEnabled: Bool,
66+
isCouponManagementSwitchEnabled: Bool,
6267
knownCardReaders: [String],
6368
lastEligibilityErrorInfo: EligibilityErrorInfo? = nil,
6469
lastJetpackBenefitsBannerDismissedTime: Date? = nil) {
@@ -69,6 +74,7 @@ public struct GeneralAppSettings: Codable, Equatable, GeneratedCopiable {
6974
self.isStripeInPersonPaymentsSwitchEnabled = isStripeInPersonPaymentsSwitchEnabled
7075
self.isCanadaInPersonPaymentsSwitchEnabled = isCanadaInPersonPaymentsSwitchEnabled
7176
self.isProductSKUInputScannerSwitchEnabled = isProductSKUInputScannerSwitchEnabled
77+
self.isCouponManagementSwitchEnabled = isCouponManagementSwitchEnabled
7278
self.knownCardReaders = knownCardReaders
7379
self.lastEligibilityErrorInfo = lastEligibilityErrorInfo
7480
self.lastJetpackBenefitsBannerDismissedTime = lastJetpackBenefitsBannerDismissedTime
@@ -99,6 +105,7 @@ public struct GeneralAppSettings: Codable, Equatable, GeneratedCopiable {
99105
isStripeInPersonPaymentsSwitchEnabled: isStripeInPersonPaymentsSwitchEnabled,
100106
isCanadaInPersonPaymentsSwitchEnabled: isCanadaInPersonPaymentsSwitchEnabled,
101107
isProductSKUInputScannerSwitchEnabled: isProductSKUInputScannerSwitchEnabled,
108+
isCouponManagementSwitchEnabled: isCouponManagementSwitchEnabled,
102109
knownCardReaders: knownCardReaders,
103110
lastEligibilityErrorInfo: lastEligibilityErrorInfo
104111
)
@@ -119,6 +126,7 @@ extension GeneralAppSettings {
119126
self.isStripeInPersonPaymentsSwitchEnabled = try container.decodeIfPresent(Bool.self, forKey: .isStripeInPersonPaymentsSwitchEnabled) ?? false
120127
self.isCanadaInPersonPaymentsSwitchEnabled = try container.decodeIfPresent(Bool.self, forKey: .isCanadaInPersonPaymentsSwitchEnabled) ?? false
121128
self.isProductSKUInputScannerSwitchEnabled = try container.decodeIfPresent(Bool.self, forKey: .isProductSKUInputScannerSwitchEnabled) ?? false
129+
self.isCouponManagementSwitchEnabled = try container.decodeIfPresent(Bool.self, forKey: .isCouponManagementSwitchEnabled) ?? false
122130
self.knownCardReaders = try container.decodeIfPresent([String].self, forKey: .knownCardReaders) ?? []
123131
self.lastEligibilityErrorInfo = try container.decodeIfPresent(EligibilityErrorInfo.self, forKey: .lastEligibilityErrorInfo)
124132
self.lastJetpackBenefitsBannerDismissedTime = try container.decodeIfPresent(Date.self, forKey: .lastJetpackBenefitsBannerDismissedTime)

0 commit comments

Comments
 (0)