Manos Chorianopoulos

update CampaignItemModel

...@@ -441,6 +441,7 @@ public class swiftApi { ...@@ -441,6 +441,7 @@ public class swiftApi {
441 public let hasExtraFields: Bool? 441 public let hasExtraFields: Bool?
442 public let ccms_offer: String? 442 public let ccms_offer: String?
443 public var loyaltyPackageId: String? 443 public var loyaltyPackageId: String?
444 + public var badge: String?
444 445
445 public init() { 446 public init() {
446 self.index_url = "" 447 self.index_url = ""
...@@ -456,6 +457,7 @@ public class swiftApi { ...@@ -456,6 +457,7 @@ public class swiftApi {
456 self.hasExtraFields = false 457 self.hasExtraFields = false
457 self.ccms_offer = "false" 458 self.ccms_offer = "false"
458 self.loyaltyPackageId = "" 459 self.loyaltyPackageId = ""
460 + self.badge = ""
459 } 461 }
460 462
461 public init(dictionary: [String: Any]) { 463 public init(dictionary: [String: Any]) {
...@@ -482,11 +484,13 @@ public class swiftApi { ...@@ -482,11 +484,13 @@ public class swiftApi {
482 self.loyaltyCampaignId = extra_fields_parsed["loyaltyCampaignId"] as? String? ?? "" 484 self.loyaltyCampaignId = extra_fields_parsed["loyaltyCampaignId"] as? String? ?? ""
483 self.hasExtraFields = true 485 self.hasExtraFields = true
484 self.ccms_offer = extra_fields_parsed["ccms_offer"] as? String? ?? "false" 486 self.ccms_offer = extra_fields_parsed["ccms_offer"] as? String? ?? "false"
487 + self.badge = extra_fields_parsed["badge"] as? String? ?? ""
485 } else { 488 } else {
486 self.subcategory = "" 489 self.subcategory = ""
487 self.loyaltyCampaignId = "" 490 self.loyaltyCampaignId = ""
488 self.hasExtraFields = false 491 self.hasExtraFields = false
489 self.ccms_offer = "false" 492 self.ccms_offer = "false"
493 + self.badge = ""
490 print("bad json") 494 print("bad json")
491 } 495 }
492 } catch let error as NSError { 496 } catch let error as NSError {
...@@ -494,6 +498,7 @@ public class swiftApi { ...@@ -494,6 +498,7 @@ public class swiftApi {
494 self.loyaltyCampaignId = "" 498 self.loyaltyCampaignId = ""
495 self.hasExtraFields = false 499 self.hasExtraFields = false
496 self.ccms_offer = "false" 500 self.ccms_offer = "false"
501 + self.badge = ""
497 print(error) 502 print(error)
498 } 503 }
499 } 504 }
...@@ -524,6 +529,15 @@ public class swiftApi { ...@@ -524,6 +529,15 @@ public class swiftApi {
524 self.loyaltyPackageId = newValue 529 self.loyaltyPackageId = newValue
525 } 530 }
526 } 531 }
532 +
533 + public var _badge: String? {
534 + get { // getter
535 + return self.badge
536 + }
537 + set(newValue) { //setter
538 + self.badge = newValue
539 + }
540 + }
527 } 541 }
528 542
529 public class CampaignDataModel { 543 public class CampaignDataModel {
......