Manos Chorianopoulos

update CampaignItemModel

......@@ -498,6 +498,7 @@ public class swiftApi {
public var campaign_type: String?
// public var campaign_type_settings: [String: Any]?
public var couponset: String?
public var type: String?
public init() {
self.index_url = ""
......@@ -517,6 +518,7 @@ public class swiftApi {
self.campaign_type = ""
// self.campaign_type_settings = [String: Any]()
self.couponset = ""
self.type = ""
}
public init(dictionary: [String: Any]) {
......@@ -545,12 +547,14 @@ public class swiftApi {
self.hasExtraFields = true
self.ccms_offer = extra_fields_parsed["ccms_offer"] as? String? ?? "false"
self.badge = extra_fields_parsed["badge"] as? String? ?? ""
self.type = extra_fields_parsed["type"] as? String? ?? ""
} else {
self.subcategory = ""
self.loyaltyCampaignId = ""
self.hasExtraFields = false
self.ccms_offer = "false"
self.badge = ""
self.type = ""
print("bad json")
}
} catch let error as NSError {
......@@ -559,6 +563,7 @@ public class swiftApi {
self.hasExtraFields = false
self.ccms_offer = "false"
self.badge = ""
self.type = ""
print(error)
}
......@@ -657,6 +662,15 @@ public class swiftApi {
self.couponset = newValue
}
}
public var _type: String? {
get { // getter
return self.type
}
set(newValue) { //setter
self.type = newValue
}
}
}
public class CampaignDataModel {
......