Panagiotis Triantafyllou

feedback fixes

......@@ -36,7 +36,7 @@ public class SplashActivity extends BaseActivity {
public void onWarplyReady() {
if (!WarplyDBHelper.getInstance(SplashActivity.this).isTableNotEmpty("auth")) {
WarplyManager.getCosmoteUser(new WarplyCosmoteUserRequest()
.setGuid("6005892749"), //6012049321, 6012049322, 6012049323, 7000000831 history, 7000000826, 7000000831 shared coupons, prod 6006552990, prod 6005892749, live 3000184910
.setGuid("7000070282"), //6012049321, 6012049322, 6012049323, 7000000831 history, 7000000826, 7000000831 shared coupons, prod 6006552990, prod 6005892749, live 3000184910
mLoginReceiver);
} else {
startNextActivity();
......
......@@ -2,7 +2,7 @@ apply plugin: 'com.android.library'
ext {
PUBLISH_GROUP_ID = 'ly.warp'
PUBLISH_VERSION = '4.5.4.6rc70'
PUBLISH_VERSION = '4.5.4.6rc71'
PUBLISH_ARTIFACT_ID = 'warply-android-sdk'
}
......
......@@ -280,9 +280,9 @@ public class LoyaltyMarketAnalysisActivity extends Activity implements View.OnCl
@Override
public void onSuccess(SharingList result) {
if (result != null && result.size() > 0) {
if (WarplyManagerHelper.getCouponsets() != null && WarplyManagerHelper.getCouponsets().size() > 0) {
if (WarplyManagerHelper.getCouponsetsDeals() != null && WarplyManagerHelper.getCouponsetsDeals().size() > 0) {
for (SharingCoupon shCoupon : result) {
for (Couponset cpnset : WarplyManagerHelper.getCouponsets()) {
for (Couponset cpnset : WarplyManagerHelper.getCouponsetsDeals()) {
if (shCoupon.getCouponsetUuid().equals(cpnset.getUuid())) {
SharingCoupon newShCoupon = new SharingCoupon();
newShCoupon = shCoupon;
......
......@@ -55,6 +55,7 @@ import ly.warp.sdk.io.models.ActiveDFYCouponEventModel;
import ly.warp.sdk.io.models.ActiveDFYCouponModel;
import ly.warp.sdk.io.models.Coupon;
import ly.warp.sdk.io.models.CouponList;
import ly.warp.sdk.io.models.Couponset;
import ly.warp.sdk.io.models.LoyaltySDKFirebaseEventModel;
import ly.warp.sdk.io.models.UnifiedCoupon;
import ly.warp.sdk.io.models.WarplyDealsAnalysisEventModel;
......@@ -530,15 +531,29 @@ public class LoyaltyWallet extends Activity implements View.OnClickListener, Vie
// Third Expandable Banner
if (WarplyManagerHelper.getMarketCoupons().size() > 0) {
countValue = 0.0f;
for (UnifiedCoupon unicou : WarplyManagerHelper.getMarketCoupons()) {
if (unicou.getCoupons() != null && unicou.getCoupons().size() > 0) {
for (Coupon inncou : unicou.getCoupons()) {
if (inncou.getStatus() == 0) {
countValue += Float.valueOf(inncou.getDiscount());
// for (UnifiedCoupon unicou : WarplyManagerHelper.getMarketCoupons()) {
// if (unicou.getCoupons() != null && unicou.getCoupons().size() > 0) {
// for (Coupon inncou : unicou.getCoupons()) {
// if (inncou.getStatus() == 0) {
// countValue += Float.valueOf(inncou.getDiscount());
// }
// }
// }
// }
if (WarplyManagerHelper.getCouponRedeemedList().size() > 0) {
if (WarplyManagerHelper.getCouponsetsDeals().size() > 0) {
for (Couponset couset : WarplyManagerHelper.getCouponsetsDeals()) {
for (Coupon cou : WarplyManagerHelper.getCouponRedeemedList()) {
if (cou.getCouponsetUuid().equals(couset.getUuid())) {
countValue += Float.valueOf(cou.getDiscount());
break;
}
}
}
}
}
mFavValue += countValue;
String badgeValue = String.format("%.02f", countValue);
mTvMarketValue.setText(String.format(getString(R.string.cos_value), badgeValue));
......
......@@ -43,6 +43,18 @@ public interface ApiService {
@Headers("Content-Type: application/json")
@POST("/oauth/{appUuid}/context")
Call<ResponseBody> getCouponsets(@Path("appUuid") String appUuid,
@Body RequestBody request,
@Header(WarpConstants.HEADER_DATE) String timeStamp,
@Header(WarpConstants.HEADER_LOYALTY_BUNDLE_ID) String bundleId,
@Header(WarpConstants.HEADER_UNIQUE_DEVICE_ID) String deviceId,
@Header(WarpConstants.HEADER_CHANNEL) String channel,
@Header(WarpConstants.HEADER_WEB_ID) String webId,
@Header(WarpConstants.HEADER_SIGNATURE) String signature,
@Header(WarpConstants.HEADER_AUTHORIZATION) String bearer);
@Headers("Content-Type: application/json")
@POST("/oauth/{appUuid}/context")
Call<ResponseBody> getUserCoupons(@Path("appUuid") String appUuid,
@Body RequestBody request,
@Header(WarpConstants.HEADER_DATE) String timeStamp,
......
......@@ -111,8 +111,10 @@ public class WarplyManagerHelper {
private static Consumer mConsumerInternal = new Consumer();
private static HashMap<String, CampaignList> mUniqueCampaignList = new HashMap<String, CampaignList>();
private static CouponList mCouponList = new CouponList();
private static CouponList mCouponRedeemedList = new CouponList();
private static CouponList mCouponListExpired = new CouponList();
private static CouponsetsList mCouponsetsList = new CouponsetsList();
private static CouponsetsList mCouponsetsDealsList = new CouponsetsList();
private static CustomerStateModel mCustomerStateModel = new CustomerStateModel();
private static ArrayList<Campaign> mCampaignList = new ArrayList<Campaign>();
private static ArrayList<Campaign> mCampaignListAll = new ArrayList<Campaign>();
......@@ -1231,6 +1233,15 @@ public class WarplyManagerHelper {
});
}
public static void setCouponRedeemedList(CouponList couponRedeemedList) {
mCouponRedeemedList.clear();
mCouponRedeemedList.addAll(couponRedeemedList);
}
public static CouponList getCouponRedeemedList() {
return mCouponRedeemedList;
}
public static LoyaltyBadgeModel getLoyaltyBadge() {
return mLoyaltyBadge;
}
......@@ -1243,6 +1254,14 @@ public class WarplyManagerHelper {
mCouponsetsList = couponsets;
}
public static void setCouponsetsDeals(CouponsetsList couponsetsDeals) {
mCouponsetsDealsList = couponsetsDeals;
}
public static CouponsetsList getCouponsetsDeals() {
return mCouponsetsDealsList;
}
public static void setMerchantList(MerchantList merchantList) {
mMerchantList.clear();
mMerchantList = merchantList;
......