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-06-27 17:34:16 +0300
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
b8bb545d395e4f15da606ff7e8f21efff3c1f5ae
b8bb545d
1 parent
018dc320
add getLoyaltyBadge, update setCouponList
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 @
b8bb545
...
...
@@ -14,6 +14,7 @@ public struct GlobalVariables {
static
var
userTag
:
String
=
""
static
var
dfyCoupons
:
Array
<
swiftApi
.
ActiveDFYCouponModel
>
=
[]
static
var
couponList
:
Array
<
swiftApi
.
CouponItemModel
>
=
[]
static
var
loyaltyBadge
:
swiftApi
.
LoyaltyBadgeModel
=
swiftApi
.
LoyaltyBadgeModel
()
}
public
class
swiftApi
{
...
...
@@ -1748,6 +1749,15 @@ public class swiftApi {
public
func
setCouponList
(
_
coupons
:
Array
<
CouponItemModel
>
)
{
GlobalVariables
.
couponList
=
coupons
let
loyaltyBadge
=
LoyaltyBadgeModel
()
let
totalCouponDiscount
=
coupons
.
reduce
(
0
)
{
$0
+
(
Float
(
$1
.
discount
??
""
)
??
0
)
}
loyaltyBadge
.
_value
=
totalCouponDiscount
loyaltyBadge
.
_couponCount
=
coupons
.
count
GlobalVariables
.
loyaltyBadge
=
loyaltyBadge
}
...
...
@@ -1755,4 +1765,9 @@ public class swiftApi {
return
GlobalVariables
.
couponList
}
public
func
getLoyaltyBadge
()
->
LoyaltyBadgeModel
{
return
GlobalVariables
.
loyaltyBadge
}
}
...
...
Please
register
or
login
to post a comment