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-28 16:56:08 +0300
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
8dd91be1395f838a2af885f521e59e1ffcd6adf1
8dd91be1
1 parent
c3874962
merge campaigns at setCCMSLoyaltyCampaigns
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
0 deletions
SwiftWarplyFramework/SwiftWarplyFramework/swiftApi.swift
SwiftWarplyFramework/SwiftWarplyFramework/swiftApi.swift
View file @
8dd91be
...
...
@@ -68,6 +68,16 @@ public class swiftApi {
public
func
setCCMSLoyaltyCampaigns
(
campaigns
:
Array
<
LoyaltyContextualOfferModel
>
)
{
let
ccmsCampaign
:
Array
<
LoyaltyContextualOfferModel
>
=
campaigns
let
mergedGFYCampaigns
=
GlobalVariables
.
campaigns
.
filter
{
let
tempCampaign
=
$0
let
isGFY
=
tempCampaign
.
offer_category
==
"gifts_for_you"
let
hasExtraFields
=
tempCampaign
.
hasExtraFields
??
false
let
loyaltyCampaignIdExists
=
ccmsCampaign
.
contains
{
$0
.
_loyaltyCampaignId
==
tempCampaign
.
loyaltyCampaignId
}
return
isGFY
&&
(
!
hasExtraFields
||
loyaltyCampaignIdExists
)
}
GlobalVariables
.
campaigns
=
GlobalVariables
.
campaigns
.
filter
{
$0
.
offer_category
!=
"gifts_for_you"
}
+
mergedGFYCampaigns
}
public
func
getActiveDFYCoupons
()
->
Array
<
ActiveDFYCouponModel
>
{
...
...
Please
register
or
login
to post a comment