Manos Chorianopoulos

fix CouponItemModel parsing part 1

......@@ -775,7 +775,17 @@ public class swiftApi {
self.short_description = dictionary["short_description"] as? String? ?? ""
self.terms = dictionary["terms"] as? String? ?? ""
if let couponSetData = dictionary["couponset_data"] as? [String: Any]? ?? ["":""] {
// TODO: DELETE
// if let couponSetData = dictionary["couponset_data"] as? [String: Any]? ?? ["":""] {
//
// let tempCouponset = CouponSetItemModel(dictionary: couponSetData)
//
// self.couponset_data = tempCouponset
// } else {
// self.couponset_data = nil
// }
if let couponSetData = dictionary["couponset_data"] as? [String: Any] {
let tempCouponset = CouponSetItemModel(dictionary: couponSetData)
......@@ -784,6 +794,15 @@ public class swiftApi {
self.couponset_data = nil
}
if let couponSetDetails = dictionary["couponset_details"] as? [String: Any] {
let tempCouponset = CouponSetItemModel(dictionary: couponSetDetails)
self.couponset_data = tempCouponset
} else {
self.couponset_data = nil
}
let expirationString = dictionary["expiration"] as? String? ?? ""
// Example expirationString: Optional(2022-12-05 01:55)
......