Toggle navigation
Toggle navigation
This project
Loading...
Sign in
open-source
/
warply_sdk_framework
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Graphs
Network
Create a new issue
Commits
Issue Boards
Authored by
Manos Chorianopoulos
2022-07-26 11:05:15 +0300
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
f6c439508ce92585932ada691dc6837f15b2a909
f6c43950
1 parent
0bd0ed93
add setOldCouponList, getOldCouponList functions
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
0 deletions
SwiftWarplyFramework/SwiftWarplyFramework/swiftApi.swift
SwiftWarplyFramework/SwiftWarplyFramework/swiftApi.swift
View file @
f6c4395
...
...
@@ -15,6 +15,7 @@ public struct GlobalVariables {
static
var
userTag
:
String
=
""
static
var
dfyCoupons
:
Array
<
swiftApi
.
ActiveDFYCouponModel
>
=
[]
static
var
couponList
:
Array
<
swiftApi
.
CouponItemModel
>
=
[]
static
var
oldCouponList
:
Array
<
swiftApi
.
CouponItemModel
>
=
[]
static
var
couponSetList
:
Array
<
swiftApi
.
CouponSetItemModel
>
=
[]
static
var
loyaltyBadge
:
swiftApi
.
LoyaltyBadgeModel
=
swiftApi
.
LoyaltyBadgeModel
()
static
var
consumer
:
swiftApi
.
ProfileModel
?
...
...
@@ -397,6 +398,7 @@ public class swiftApi {
// On CouponSets request Success, match coupons with couponsets
let
tempCoupons
=
matchCoupons
()
swiftApi
()
.
setCouponList
(
tempCoupons
)
swiftApi
()
.
setOldCouponList
(
tempCoupons
)
let
activeCoupons
=
tempCoupons
.
filter
({
return
$0
.
status
==
1
})
getCouponsCallback
(
activeCoupons
)
...
...
@@ -2892,6 +2894,19 @@ public class swiftApi {
return
GlobalVariables
.
couponList
}
public
func
setOldCouponList
(
_
coupons
:
Array
<
CouponItemModel
>
)
{
// let filteredCoupons = coupons.filter { CharacterSet.decimalDigits.isSuperset(of: CharacterSet(charactersIn: $0.discount ?? "")) }
let
oldCoupons
=
coupons
.
filter
({
return
$0
.
status
==
0
})
GlobalVariables
.
oldCouponList
=
oldCoupons
}
public
func
getOldCouponList
()
->
Array
<
CouponItemModel
>
{
return
GlobalVariables
.
oldCouponList
}
public
func
setCouponSetList
(
_
couponSets
:
Array
<
CouponSetItemModel
>
)
{
GlobalVariables
.
couponSetList
=
couponSets
...
...
Please
register
or
login
to post a comment