Manos Chorianopoulos

add ActiveDFYCouponModel, set get ActiveDFYCoupons

...@@ -12,6 +12,7 @@ public struct GlobalVariables { ...@@ -12,6 +12,7 @@ public struct GlobalVariables {
12 static var campaigns: Array<swiftApi.CampaignItemModel> = [] 12 static var campaigns: Array<swiftApi.CampaignItemModel> = []
13 static var customerState: swiftApi.CustomerStateModel? 13 static var customerState: swiftApi.CustomerStateModel?
14 static var userTag: String = "" 14 static var userTag: String = ""
15 + static var dfyCoupons: Array<swiftApi.ActiveDFYCouponModel> = []
15 } 16 }
16 17
17 public class swiftApi { 18 public class swiftApi {
...@@ -50,8 +51,8 @@ public class swiftApi { ...@@ -50,8 +51,8 @@ public class swiftApi {
50 } 51 }
51 } 52 }
52 53
53 - public func setActiveDFYCoupons(campaignIds: Array<String>) { 54 + public func setActiveDFYCoupons(dfyCoupons: Array<ActiveDFYCouponModel>) {
54 - activeDFYCoupons.init(campaignIds: campaignIds) 55 + GlobalVariables.dfyCoupons = dfyCoupons
55 } 56 }
56 57
57 public class CCMSLoyaltyCampaigns { 58 public class CCMSLoyaltyCampaigns {
...@@ -66,9 +67,8 @@ public class swiftApi { ...@@ -66,9 +67,8 @@ public class swiftApi {
66 let ccmsCampaign: Array<LoyaltyContextualOfferModel> = campaigns 67 let ccmsCampaign: Array<LoyaltyContextualOfferModel> = campaigns
67 } 68 }
68 69
69 - public func getActiveDFYCoupons() -> Array<String>{ 70 + public func getActiveDFYCoupons() -> Array<ActiveDFYCouponModel> {
70 - let array: Array<String> = [] 71 + return GlobalVariables.dfyCoupons
71 - return array
72 } 72 }
73 73
74 74
...@@ -1670,5 +1670,47 @@ public class swiftApi { ...@@ -1670,5 +1670,47 @@ public class swiftApi {
1670 } 1670 }
1671 } 1671 }
1672 } 1672 }
1673 +
1674 +
1675 + public class ActiveDFYCouponModel {
1676 + private var value: String
1677 + private var date: String
1678 + private var code: String
1679 +
1680 +
1681 + public init() {
1682 + self.value = ""
1683 + self.date = ""
1684 + self.code = ""
1685 +
1686 + }
1687 +
1688 + public var _value: String {
1689 + get { // getter
1690 + return self.value
1691 + }
1692 + set(newValue) { //setter
1693 + self.value = newValue
1694 + }
1695 + }
1696 +
1697 + public var _date: String {
1698 + get { // getter
1699 + return self.date
1700 + }
1701 + set(newValue) { //setter
1702 + self.date = newValue
1703 + }
1704 + }
1705 +
1706 + public var _code: String {
1707 + get { // getter
1708 + return self.code
1709 + }
1710 + set(newValue) { //setter
1711 + self.code = newValue
1712 + }
1713 + }
1714 + }
1673 1715
1674 } 1716 }
......