public class RewardPointCore
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
protected static org.apache.commons.logging.Log |
log |
static int |
TX_TYPE_ADD_POINTS
Transaction type
|
static int |
TX_TYPE_REMOVE_POINTS
Transaction type
|
Constructor and Description |
---|
RewardPointCore()
Constructor
|
Modifier and Type | Method and Description |
---|---|
int |
addPoints(int customerId,
int points,
java.lang.String code,
java.lang.String description,
KKCriteria crit)
Adds a number of reward points to the total for customer identified by the
sessionId parameter. |
protected void |
checkRequired(java.lang.Object param,
java.lang.String paramType,
java.lang.String paramName)
Throws an exception with a proper message if the required parameter is null or null or empty
for the case of a string.
|
int |
deletePoints(int customerId,
int rewardPoints,
java.lang.String code,
java.lang.String description,
KKCriteria crit1,
KKCriteria crit2)
Deletes a number of reward points from the total for the customer identified by the
sessionId parameter. |
void |
deleteReservedPoints(int customerId,
int reservationId,
java.lang.String code,
java.lang.String description,
KKCriteria crit)
Verifies that the
reservationId parameter exists and that it belongs to the
customer identified by the sessionId parameter. |
int |
freeReservedPoints(int customerId,
int reservationId,
KKCriteria crit1,
KKCriteria crit2)
Verifies that the
reservationId parameter exists and that it belongs to the
customer identified by the sessionId parameter. |
int |
getReservationId(KKCriteria insertC)
Get a unique reservation id from the counter table
|
int |
pointsAvailable(int customerId,
KKCriteria crit)
Calculates the number of reward points available for the customer identified by the
sessionId parameter. |
int |
reservePoints(int customerId,
int rewardPoints,
KKCriteria crit1,
KKCriteria crit2)
Removes a number of reward points from the total for the customer identified by the
sessionId parameter. |
protected static org.apache.commons.logging.Log log
public static final int TX_TYPE_ADD_POINTS
public static final int TX_TYPE_REMOVE_POINTS
public RewardPointCore() throws java.lang.Exception
java.lang.Exception
- an unexpected exceptionpublic int pointsAvailable(int customerId, KKCriteria crit) throws java.lang.Exception
sessionId
parameter.customerId
- the customerIdcrit
- the critjava.lang.Exception
- an unexpected exceptionpublic int addPoints(int customerId, int points, java.lang.String code, java.lang.String description, KKCriteria crit) throws java.lang.Exception
sessionId
parameter.customerId
- the customerIdpoints
- the pointscode
- An optional code to categorize the reason for awarding the pointsdescription
- An optional description describing why the points were awardedcrit
- the critjava.lang.Exception
- an unexpected exceptionpublic int deletePoints(int customerId, int rewardPoints, java.lang.String code, java.lang.String description, KKCriteria crit1, KKCriteria crit2) throws java.lang.Exception
sessionId
parameter.customerId
- the customerIdrewardPoints
- the rewardPointscode
- the codedescription
- the descriptioncrit1
- the crit1crit2
- the crit2java.lang.Exception
- an unexpected exceptionpublic int reservePoints(int customerId, int rewardPoints, KKCriteria crit1, KKCriteria crit2) throws java.lang.Exception
sessionId
parameter. The removed points are not deleted but reserved, so that
they are no longer available for spending but may be deleted once the order has been paid for
or shipped. If the order is never fulfilled, then the reserved points may be freed and
returned to the available total.customerId
- the customerIdrewardPoints
- the rewardPointscrit1
- the crit1crit2
- the crit2java.lang.Exception
- an unexpected exceptionpublic void deleteReservedPoints(int customerId, int reservationId, java.lang.String code, java.lang.String description, KKCriteria crit) throws java.lang.Exception
reservationId
parameter exists and that it belongs to the
customer identified by the sessionId
parameter. The reserved points are normally
deleted once the order has been paid for or shipped. If the order is never fulfilled, then
the reserved points may be freed and returned to the available total. Once deleted. the
points can no longer be returned to the total.customerId
- the customerIdreservationId
- the reservationIdcode
- the codedescription
- the descriptioncrit
- the critjava.lang.Exception
- an unexpected exceptionpublic int freeReservedPoints(int customerId, int reservationId, KKCriteria crit1, KKCriteria crit2) throws java.lang.Exception
reservationId
parameter exists and that it belongs to the
customer identified by the sessionId
parameter. The reserved points may be freed
and returned to the available total using this API call. The method checks to see whether
some or all of the points have expired while they were in the reserved state.customerId
- the customerIdreservationId
- the reservationIdcrit1
- the crit1crit2
- the crit2java.lang.Exception
- an unexpected exceptionpublic int getReservationId(KKCriteria insertC) throws org.apache.torque.TorqueException, com.konakart.app.KKException
insertC
- the insertCorg.apache.torque.TorqueException
- an unexpected exception in Torque (the database layer)com.konakart.app.KKException
- an unexpected KKException exceptionprotected void checkRequired(java.lang.Object param, java.lang.String paramType, java.lang.String paramName) throws com.konakart.app.KKException
param
- the paramparamType
- the paramTypeparamName
- the paramNamecom.konakart.app.KKException
- an unexpected KKException exceptionCopyright © 2018 DS Data Systems UK Ltd.