Manos Chorianopoulos

update CampaignItemModel

...@@ -415,6 +415,7 @@ public class swiftApi { ...@@ -415,6 +415,7 @@ public class swiftApi {
415 public let message: String? 415 public let message: String?
416 public let loyaltyCampaignId: String? 416 public let loyaltyCampaignId: String?
417 public let hasExtraFields: Bool? 417 public let hasExtraFields: Bool?
418 + public let ccms_offer: Bool?
418 419
419 init(dictionary: [String: Any]) { 420 init(dictionary: [String: Any]) {
420 self.index_url = dictionary["index_url"] as? String? ?? "" 421 self.index_url = dictionary["index_url"] as? String? ?? ""
...@@ -438,16 +439,19 @@ public class swiftApi { ...@@ -438,16 +439,19 @@ public class swiftApi {
438 self.subcategory = extra_fields_parsed["subcategory"] as? String? ?? "" 439 self.subcategory = extra_fields_parsed["subcategory"] as? String? ?? ""
439 self.loyaltyCampaignId = extra_fields_parsed["loyaltyCampaignId"] as? String? ?? "" 440 self.loyaltyCampaignId = extra_fields_parsed["loyaltyCampaignId"] as? String? ?? ""
440 self.hasExtraFields = true 441 self.hasExtraFields = true
442 + self.ccms_offer = extra_fields_parsed["ccms_offer"] as? Bool? ?? false
441 } else { 443 } else {
442 self.subcategory = "" 444 self.subcategory = ""
443 self.loyaltyCampaignId = "" 445 self.loyaltyCampaignId = ""
444 self.hasExtraFields = false 446 self.hasExtraFields = false
447 + self.ccms_offer = false
445 print("bad json") 448 print("bad json")
446 } 449 }
447 } catch let error as NSError { 450 } catch let error as NSError {
448 self.subcategory = "" 451 self.subcategory = ""
449 self.loyaltyCampaignId = "" 452 self.loyaltyCampaignId = ""
450 self.hasExtraFields = false 453 self.hasExtraFields = false
454 + self.ccms_offer = false
451 print(error) 455 print(error)
452 } 456 }
453 457
...@@ -1482,14 +1486,12 @@ public class swiftApi { ...@@ -1482,14 +1486,12 @@ public class swiftApi {
1482 + "&dataValue=" + (campaign._dataValue) 1486 + "&dataValue=" + (campaign._dataValue)
1483 + "&provStepValueMins=" + (campaign._provStepValueMins) 1487 + "&provStepValueMins=" + (campaign._provStepValueMins)
1484 + "&UACIOfferTrackingCode=" + (campaign._uaciOfferTrackingCode) 1488 + "&UACIOfferTrackingCode=" + (campaign._uaciOfferTrackingCode)
1485 - + "&MSISDN="
1486 + "&OFFERCODE1=" + (campaign._offerCode1) 1489 + "&OFFERCODE1=" + (campaign._offerCode1)
1487 + "&SCORE=" + (campaign._score) 1490 + "&SCORE=" + (campaign._score)
1488 + "&ZONE=" + (campaign._zone) 1491 + "&ZONE=" + (campaign._zone)
1489 + "&WAVE=" + (campaign._wave) 1492 + "&WAVE=" + (campaign._wave)
1490 + "&VALIDITY=" + (campaign._validity) 1493 + "&VALIDITY=" + (campaign._validity)
1491 + "&TREATMENT_CODE=" + (campaign._treatmentCode) 1494 + "&TREATMENT_CODE=" + (campaign._treatmentCode)
1492 - + "&GUID="
1493 + "&OfferAudienceLevel=" + (campaign._offerAudienceLevel); 1495 + "&OfferAudienceLevel=" + (campaign._offerAudienceLevel);
1494 1496
1495 return finalUrl 1497 return finalUrl
...@@ -1527,14 +1529,12 @@ public class swiftApi { ...@@ -1527,14 +1529,12 @@ public class swiftApi {
1527 + "&dataValue=" + (ccmsCampaign._dataValue) 1529 + "&dataValue=" + (ccmsCampaign._dataValue)
1528 + "&provStepValueMins=" + (ccmsCampaign._provStepValueMins) 1530 + "&provStepValueMins=" + (ccmsCampaign._provStepValueMins)
1529 + "&UACIOfferTrackingCode=" + (ccmsCampaign._uaciOfferTrackingCode) 1531 + "&UACIOfferTrackingCode=" + (ccmsCampaign._uaciOfferTrackingCode)
1530 - + "&MSISDN="
1531 + "&OFFERCODE1=" + (ccmsCampaign._offerCode1) 1532 + "&OFFERCODE1=" + (ccmsCampaign._offerCode1)
1532 + "&SCORE=" + (ccmsCampaign._score) 1533 + "&SCORE=" + (ccmsCampaign._score)
1533 + "&ZONE=" + (ccmsCampaign._zone) 1534 + "&ZONE=" + (ccmsCampaign._zone)
1534 + "&WAVE=" + (ccmsCampaign._wave) 1535 + "&WAVE=" + (ccmsCampaign._wave)
1535 + "&VALIDITY=" + (ccmsCampaign._validity) 1536 + "&VALIDITY=" + (ccmsCampaign._validity)
1536 + "&TREATMENT_CODE=" + (ccmsCampaign._treatmentCode) 1537 + "&TREATMENT_CODE=" + (ccmsCampaign._treatmentCode)
1537 - + "&GUID="
1538 + "&OfferAudienceLevel=" + (ccmsCampaign._offerAudienceLevel); 1538 + "&OfferAudienceLevel=" + (ccmsCampaign._offerAudienceLevel);
1539 1539
1540 return finalUrl 1540 return finalUrl
......