Manos Chorianopoulos

update CampaignItemModel

......@@ -441,6 +441,7 @@ public class swiftApi {
public let hasExtraFields: Bool?
public let ccms_offer: String?
public var loyaltyPackageId: String?
public var badge: String?
public init() {
self.index_url = ""
......@@ -456,6 +457,7 @@ public class swiftApi {
self.hasExtraFields = false
self.ccms_offer = "false"
self.loyaltyPackageId = ""
self.badge = ""
}
public init(dictionary: [String: Any]) {
......@@ -482,11 +484,13 @@ public class swiftApi {
self.loyaltyCampaignId = extra_fields_parsed["loyaltyCampaignId"] as? String? ?? ""
self.hasExtraFields = true
self.ccms_offer = extra_fields_parsed["ccms_offer"] as? String? ?? "false"
self.badge = extra_fields_parsed["badge"] as? String? ?? ""
} else {
self.subcategory = ""
self.loyaltyCampaignId = ""
self.hasExtraFields = false
self.ccms_offer = "false"
self.badge = ""
print("bad json")
}
} catch let error as NSError {
......@@ -494,6 +498,7 @@ public class swiftApi {
self.loyaltyCampaignId = ""
self.hasExtraFields = false
self.ccms_offer = "false"
self.badge = ""
print(error)
}
}
......@@ -524,6 +529,15 @@ public class swiftApi {
self.loyaltyPackageId = newValue
}
}
public var _badge: String? {
get { // getter
return self.badge
}
set(newValue) { //setter
self.badge = newValue
}
}
}
public class CampaignDataModel {
......