@@ -98,3 +98,37 @@ public struct ABTest: Codable, JSONEncodable {
9898 try container. encode ( self . variants, forKey: . variants)
9999 }
100100}
101+
102+ extension ABTest : Equatable {
103+ public static func == ( lhs: ABTest , rhs: ABTest ) -> Bool {
104+ lhs. abTestID == rhs. abTestID &&
105+ lhs. clickSignificance == rhs. clickSignificance &&
106+ lhs. conversionSignificance == rhs. conversionSignificance &&
107+ lhs. addToCartSignificance == rhs. addToCartSignificance &&
108+ lhs. purchaseSignificance == rhs. purchaseSignificance &&
109+ lhs. revenueSignificance == rhs. revenueSignificance &&
110+ lhs. updatedAt == rhs. updatedAt &&
111+ lhs. createdAt == rhs. createdAt &&
112+ lhs. endAt == rhs. endAt &&
113+ lhs. name == rhs. name &&
114+ lhs. status == rhs. status &&
115+ lhs. variants == rhs. variants
116+ }
117+ }
118+
119+ extension ABTest : Hashable {
120+ public func hash( into hasher: inout Hasher ) {
121+ hasher. combine ( self . abTestID. hashValue)
122+ hasher. combine ( self . clickSignificance. hashValue)
123+ hasher. combine ( self . conversionSignificance. hashValue)
124+ hasher. combine ( self . addToCartSignificance. hashValue)
125+ hasher. combine ( self . purchaseSignificance. hashValue)
126+ hasher. combine ( self . revenueSignificance. hashValue)
127+ hasher. combine ( self . updatedAt. hashValue)
128+ hasher. combine ( self . createdAt. hashValue)
129+ hasher. combine ( self . endAt. hashValue)
130+ hasher. combine ( self . name. hashValue)
131+ hasher. combine ( self . status. hashValue)
132+ hasher. combine ( self . variants. hashValue)
133+ }
134+ }
0 commit comments