Manos Chorianopoulos

update CampaignItemModel

......@@ -415,6 +415,7 @@ public class swiftApi {
public let message: String?
public let loyaltyCampaignId: String?
public let hasExtraFields: Bool?
public let ccms_offer: Bool?
init(dictionary: [String: Any]) {
self.index_url = dictionary["index_url"] as? String? ?? ""
......@@ -438,16 +439,19 @@ public class swiftApi {
self.subcategory = extra_fields_parsed["subcategory"] as? String? ?? ""
self.loyaltyCampaignId = extra_fields_parsed["loyaltyCampaignId"] as? String? ?? ""
self.hasExtraFields = true
self.ccms_offer = extra_fields_parsed["ccms_offer"] as? Bool? ?? false
} else {
self.subcategory = ""
self.loyaltyCampaignId = ""
self.hasExtraFields = false
self.ccms_offer = false
print("bad json")
}
} catch let error as NSError {
self.subcategory = ""
self.loyaltyCampaignId = ""
self.hasExtraFields = false
self.ccms_offer = false
print(error)
}
......@@ -1482,14 +1486,12 @@ public class swiftApi {
+ "&dataValue=" + (campaign._dataValue)
+ "&provStepValueMins=" + (campaign._provStepValueMins)
+ "&UACIOfferTrackingCode=" + (campaign._uaciOfferTrackingCode)
+ "&MSISDN="
+ "&OFFERCODE1=" + (campaign._offerCode1)
+ "&SCORE=" + (campaign._score)
+ "&ZONE=" + (campaign._zone)
+ "&WAVE=" + (campaign._wave)
+ "&VALIDITY=" + (campaign._validity)
+ "&TREATMENT_CODE=" + (campaign._treatmentCode)
+ "&GUID="
+ "&OfferAudienceLevel=" + (campaign._offerAudienceLevel);
return finalUrl
......@@ -1527,14 +1529,12 @@ public class swiftApi {
+ "&dataValue=" + (ccmsCampaign._dataValue)
+ "&provStepValueMins=" + (ccmsCampaign._provStepValueMins)
+ "&UACIOfferTrackingCode=" + (ccmsCampaign._uaciOfferTrackingCode)
+ "&MSISDN="
+ "&OFFERCODE1=" + (ccmsCampaign._offerCode1)
+ "&SCORE=" + (ccmsCampaign._score)
+ "&ZONE=" + (ccmsCampaign._zone)
+ "&WAVE=" + (ccmsCampaign._wave)
+ "&VALIDITY=" + (ccmsCampaign._validity)
+ "&TREATMENT_CODE=" + (ccmsCampaign._treatmentCode)
+ "&GUID="
+ "&OfferAudienceLevel=" + (ccmsCampaign._offerAudienceLevel);
return finalUrl
......