Manos Chorianopoulos

add ActiveDFYCouponModel, set get ActiveDFYCoupons

......@@ -12,6 +12,7 @@ public struct GlobalVariables {
static var campaigns: Array<swiftApi.CampaignItemModel> = []
static var customerState: swiftApi.CustomerStateModel?
static var userTag: String = ""
static var dfyCoupons: Array<swiftApi.ActiveDFYCouponModel> = []
}
public class swiftApi {
......@@ -50,8 +51,8 @@ public class swiftApi {
}
}
public func setActiveDFYCoupons(campaignIds: Array<String>) {
activeDFYCoupons.init(campaignIds: campaignIds)
public func setActiveDFYCoupons(dfyCoupons: Array<ActiveDFYCouponModel>) {
GlobalVariables.dfyCoupons = dfyCoupons
}
public class CCMSLoyaltyCampaigns {
......@@ -66,9 +67,8 @@ public class swiftApi {
let ccmsCampaign: Array<LoyaltyContextualOfferModel> = campaigns
}
public func getActiveDFYCoupons() -> Array<String>{
let array: Array<String> = []
return array
public func getActiveDFYCoupons() -> Array<ActiveDFYCouponModel> {
return GlobalVariables.dfyCoupons
}
......@@ -1671,4 +1671,46 @@ public class swiftApi {
}
}
public class ActiveDFYCouponModel {
private var value: String
private var date: String
private var code: String
public init() {
self.value = ""
self.date = ""
self.code = ""
}
public var _value: String {
get { // getter
return self.value
}
set(newValue) { //setter
self.value = newValue
}
}
public var _date: String {
get { // getter
return self.date
}
set(newValue) { //setter
self.date = newValue
}
}
public var _code: String {
get { // getter
return self.code
}
set(newValue) { //setter
self.code = newValue
}
}
}
}
......