Manos Chorianopoulos

add openTelco function

...@@ -96,6 +96,7 @@ extension GiftsViewController: UITableViewDelegate, UITableViewDataSource{ ...@@ -96,6 +96,7 @@ extension GiftsViewController: UITableViewDelegate, UITableViewDataSource{
96 vc.ccms = item 96 vc.ccms = item
97 vc.campaign = campaigns[indexPath.row] 97 vc.campaign = campaigns[indexPath.row]
98 self.navigationController?.pushViewController(vc, animated: true) 98 self.navigationController?.pushViewController(vc, animated: true)
99 + break;
99 } 100 }
100 } 101 }
101 } 102 }
......
...@@ -398,7 +398,7 @@ public class swiftApi { ...@@ -398,7 +398,7 @@ public class swiftApi {
398 let tempCoupons = matchCoupons() 398 let tempCoupons = matchCoupons()
399 swiftApi().setCouponList(tempCoupons) 399 swiftApi().setCouponList(tempCoupons)
400 400
401 - let activeCoupons = coupons.filter({ return $0.status == 1 }) 401 + let activeCoupons = tempCoupons.filter({ return $0.status == 1 })
402 getCouponsCallback(activeCoupons) 402 getCouponsCallback(activeCoupons)
403 } 403 }
404 404
...@@ -2310,6 +2310,32 @@ public class swiftApi { ...@@ -2310,6 +2310,32 @@ public class swiftApi {
2310 } 2310 }
2311 } 2311 }
2312 } 2312 }
2313 +
2314 +
2315 + public func openTelco(_ controller: UIViewController) -> Void {
2316 + for campaign in GlobalVariables.campaigns {
2317 + if (campaign._type != nil && campaign._type == "telco") {
2318 + let ccmsCampaigns = swiftApi().getCCMSLoyaltyCampaigns()
2319 + let loyaltyCampaignIdExists = ccmsCampaigns.contains { $0._loyaltyCampaignId == campaign.session_uuid }
2320 +
2321 + if (loyaltyCampaignIdExists == true) {
2322 + for item in ccmsCampaigns {
2323 + if (item._loyaltyCampaignId == campaign.session_uuid) {
2324 + let storyboard = UIStoryboard(name: "Main", bundle: Bundle(for: MyEmptyClass.self))
2325 + let vc = storyboard.instantiateViewController(withIdentifier: "TelcoViewController") as! SwiftWarplyFramework.TelcoViewController
2326 + vc.ccms = item
2327 + vc.campaign = campaign
2328 + controller.navigationController?.pushViewController(vc, animated: true)
2329 + break;
2330 + }
2331 + }
2332 + break;
2333 + }
2334 +
2335 + }
2336 + }
2337 + }
2338 +
2313 2339
2314 public func setCampaignList(_ campaigns: Array<CampaignItemModel>) -> Void { 2340 public func setCampaignList(_ campaigns: Array<CampaignItemModel>) -> Void {
2315 // let userTag = self.getUserTag() 2341 // let userTag = self.getUserTag()
......