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-29 16:22:27 +0300
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
100283c7d0e85d75fb8b4f34f3bab99285fa20b4
100283c7
1 parent
a6d747ac
add campaigns logs
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
0 deletions
SwiftWarplyFramework/SwiftWarplyFramework/swiftApi.swift
SwiftWarplyFramework/SwiftWarplyFramework/swiftApi.swift
View file @
100283c
...
...
@@ -82,7 +82,24 @@ public class swiftApi {
return
isGFY
&&
(
!
isCcmsOffer
||
(
isCcmsOffer
&&
loyaltyCampaignIdExists
))
}
let
matchedCampaigns
=
GlobalVariables
.
campaigns
.
filter
{
let
tempCampaign
=
$0
let
isGFY
=
tempCampaign
.
offer_category
==
"gifts_for_you"
let
hasExtraFields
=
(
tempCampaign
.
hasExtraFields
!=
nil
)
&&
(
tempCampaign
.
hasExtraFields
==
true
)
let
isCcmsOffer
=
(
tempCampaign
.
ccms_offer
!=
nil
)
&&
(
tempCampaign
.
ccms_offer
!=
""
)
&&
(
tempCampaign
.
ccms_offer
==
"true"
)
let
loyaltyCampaignIdExists
=
ccmsCampaign
.
contains
{
$0
.
_loyaltyCampaignId
==
tempCampaign
.
session_uuid
}
return
isGFY
&&
isCcmsOffer
&&
loyaltyCampaignIdExists
}
print
(
"Got L:{"
+
String
(
GlobalVariables
.
campaigns
.
count
)
+
"} LOYALTY campaigns"
)
print
(
"Got C:{"
+
String
(
campaigns
.
count
)
+
"} CCMS campaigns"
)
print
(
"Matched M:{"
+
String
(
matchedCampaigns
.
count
)
+
"} CCMS campaigns"
)
print
(
"====================================="
)
GlobalVariables
.
campaigns
=
GlobalVariables
.
campaigns
.
filter
{
$0
.
offer_category
!=
"gifts_for_you"
}
+
mergedGFYCampaigns
print
(
"TOTAL: Campaigns Sum="
+
String
(
GlobalVariables
.
campaigns
.
count
)
+
" campaigns to display"
)
}
public
func
getCCMSLoyaltyCampaigns
()
->
Array
<
LoyaltyContextualOfferModel
>
{
...
...
Please
register
or
login
to post a comment