Panagiotis Triantafyllou

sm coupons history request and response model

<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="CompilerConfiguration">
<bytecodeTargetLevel target="21" />
<bytecodeTargetLevel target="17" />
</component>
</project>
\ No newline at end of file
......
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectMigrations">
<option name="MigrateToGradleLocalJavaHome">
<set>
<option value="$PROJECT_DIR$" />
</set>
</option>
</component>
</project>
\ No newline at end of file
......@@ -184,7 +184,7 @@
</map>
</option>
</component>
<component name="ProjectRootManager" version="2" languageLevel="JDK_21" default="true" project-jdk-name="jbr-21" project-jdk-type="JavaSDK">
<component name="ProjectRootManager" version="2" languageLevel="JDK_17" default="true" project-jdk-name="zulu-17" project-jdk-type="JavaSDK">
<output url="file://$PROJECT_DIR$/build/classes" />
</component>
<component name="ProjectType">
......
......@@ -5,7 +5,7 @@ android.buildFeatures.buildConfig = true
ext {
PUBLISH_GROUP_ID = 'ly.warp'
PUBLISH_VERSION = '4.5.5.4r46'
PUBLISH_VERSION = '4.5.5.4m1'
PUBLISH_ARTIFACT_ID = 'warply-android-sdk'
}
......
......@@ -23,6 +23,7 @@ import ly.warp.sdk.db.WarplyDBHelper;
import ly.warp.sdk.fragments.HomeFragment;
import ly.warp.sdk.io.callbacks.CallbackReceiver;
import ly.warp.sdk.io.models.Campaign;
import ly.warp.sdk.io.models.RedeemedSMHistoryModel;
import ly.warp.sdk.utils.managers.WarplyManager;
public class BaseFragmentActivity extends FragmentActivity implements NavigationBarView.OnItemSelectedListener {
......@@ -52,6 +53,7 @@ public class BaseFragmentActivity extends FragmentActivity implements Navigation
if (WarplyDBHelper.getInstance(this).isTableNotEmpty("auth")) {
WarplyManager.getSupermarketCampaign(mCampaignsCallback);
WarplyManager.getRedeemedSMHistory(mSMHistoryReceiver);
}
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) {
......@@ -147,4 +149,16 @@ public class BaseFragmentActivity extends FragmentActivity implements Navigation
Toast.makeText(BaseFragmentActivity.this, "Campaigns Error", Toast.LENGTH_SHORT).show();
}
};
private final CallbackReceiver<RedeemedSMHistoryModel> mSMHistoryReceiver = new CallbackReceiver<RedeemedSMHistoryModel>() {
@Override
public void onSuccess(RedeemedSMHistoryModel result) {
Toast.makeText(BaseFragmentActivity.this, "SM HISTORY SUCCESS", Toast.LENGTH_SHORT).show();
}
@Override
public void onFailure(int errorCode) {
Toast.makeText(BaseFragmentActivity.this, "SM HISTORY ERROR", Toast.LENGTH_SHORT).show();
}
};
}
......
......@@ -23,6 +23,7 @@ import ly.warp.sdk.R;
import ly.warp.sdk.db.WarplyDBHelper;
import ly.warp.sdk.io.callbacks.CallbackReceiver;
import ly.warp.sdk.io.models.Campaign;
import ly.warp.sdk.io.models.RedeemedSMHistoryModel;
import ly.warp.sdk.utils.WarplyManagerHelper;
import ly.warp.sdk.utils.managers.WarplyManager;
......@@ -100,6 +101,7 @@ public class HomeFragment extends Fragment implements View.OnClickListener, Swip
public void onRefresh() {
if (WarplyDBHelper.getInstance(getActivity()).isTableNotEmpty("auth")) {
WarplyManager.getSupermarketCampaign(mCampaignsCallback);
WarplyManager.getRedeemedSMHistory(mSMHistoryReceiver);
mSwipeRefresh.setRefreshing(false);
} else {
mSwipeRefresh.setRefreshing(false);
......@@ -182,6 +184,7 @@ public class HomeFragment extends Fragment implements View.OnClickListener, Swip
// }
WarplyManager.getSupermarketCampaign(mCampaignsCallback);
WarplyManager.getRedeemedSMHistory(mSMHistoryReceiver);
}
@Override
......@@ -190,4 +193,16 @@ public class HomeFragment extends Fragment implements View.OnClickListener, Swip
Toast.makeText(getActivity(), "LOGIN ERROR", Toast.LENGTH_SHORT).show();
}
};
private final CallbackReceiver<RedeemedSMHistoryModel> mSMHistoryReceiver = new CallbackReceiver<RedeemedSMHistoryModel>() {
@Override
public void onSuccess(RedeemedSMHistoryModel result) {
Toast.makeText(getActivity(), "SM HISTORY SUCCESS", Toast.LENGTH_SHORT).show();
}
@Override
public void onFailure(int errorCode) {
Toast.makeText(getActivity(), "SM HISTORY ERROR", Toast.LENGTH_SHORT).show();
}
};
}
\ No newline at end of file
......
/*
* Copyright 2010-2013 Warply Ltd. All rights reserved.
*
* Redistribution and use in source and binary forms, without modification, are
* permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE WARPLY LTD ``AS IS'' AND ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
* EVENT SHALL WARPLY LTD OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
* OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package ly.warp.sdk.io.models;
/**
* Created by Panagiotis Triantafyllou on 05-Mar-25.
*/
public class RedeemedSMHistoryModel {
private CouponList redeemedCouponList = new CouponList();
private float totalRedeemedValue = 0.0f;
public RedeemedSMHistoryModel() {
this.redeemedCouponList = new CouponList();
this.totalRedeemedValue = 0.0f;
}
// ================================================================================
// Getters
// ================================================================================
public CouponList getRedeemedCouponList() {
return redeemedCouponList;
}
public void setRedeemedCouponList(CouponList redeemedCouponList) {
this.redeemedCouponList = redeemedCouponList;
}
public float getTotalRedeemedValue() {
return totalRedeemedValue;
}
public void setTotalRedeemedValue(float totalRedeemedValue) {
this.totalRedeemedValue = totalRedeemedValue;
}
}