Manos Chorianopoulos

add getCCMSLoyaltyCampaigns

......@@ -16,6 +16,7 @@ public struct GlobalVariables {
static var couponList: Array<swiftApi.CouponItemModel> = []
static var loyaltyBadge: swiftApi.LoyaltyBadgeModel = swiftApi.LoyaltyBadgeModel()
static var consumer: swiftApi.ProfileModel?
static var ccmsCampaigns: Array<swiftApi.LoyaltyContextualOfferModel> = []
}
public class swiftApi {
......@@ -79,6 +80,10 @@ public class swiftApi {
GlobalVariables.campaigns = GlobalVariables.campaigns.filter { $0.offer_category != "gifts_for_you" } + mergedGFYCampaigns
}
public func getCCMSLoyaltyCampaigns() -> Array<LoyaltyContextualOfferModel> {
return GlobalVariables.ccmsCampaigns
}
public func getActiveDFYCoupons() -> Array<ActiveDFYCouponModel> {
return GlobalVariables.dfyCoupons
......@@ -1352,7 +1357,7 @@ public class swiftApi {
for item in GlobalVariables.campaigns {
if (item.loyaltyCampaignId == campaign._loyaltyCampaignId) {
print("CCMS_PRESSED" + " " + campaign._id + " " + campaign._offerName)
let instanceOfMyApi = MyApi()
let campaignInfo = instanceOfMyApi.provideInfoForCampaign()
let finalUrl = (item.index_url ?? "")
......