public class RewardPointMgr extends BaseMgr implements RewardPointMgrIf
Modifier and Type | Field and Description |
---|---|
protected static org.apache.commons.logging.Log |
log |
templateBaseDir
Constructor and Description |
---|
RewardPointMgr(KKEngIf eng)
Constructor
|
Modifier and Type | Method and Description |
---|---|
int |
addPoints(int customerId,
int points,
java.lang.String code,
java.lang.String description)
Adds a number of reward points to the total for customer identified by the
sessionId parameter. |
int |
addPoints(java.lang.String sessionId,
int points,
java.lang.String code,
java.lang.String description)
Adds a number of reward points to the total for customer identified by the
sessionId parameter. |
int |
deletePoints(int customerId,
int points,
java.lang.String code,
java.lang.String description)
Deletes a number of reward points from the total for the customer identified by the
sessionId parameter. |
int |
deletePoints(java.lang.String sessionId,
int points,
java.lang.String code,
java.lang.String description)
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)
Verifies that the
reservationId parameter exists and that it belongs to the
customer identified by the sessionId parameter. |
void |
deleteReservedPoints(java.lang.String sessionId,
int reservationId,
java.lang.String code,
java.lang.String description)
Verifies that the
reservationId parameter exists and that it belongs to the
customer identified by the sessionId parameter. |
int |
freeReservedPoints(int customerId,
int reservationId)
Verifies that the
reservationId parameter exists and that it belongs to the
customer identified by the sessionId parameter. |
int |
freeReservedPoints(java.lang.String sessionId,
int reservationId)
Verifies that the
reservationId parameter exists and that it belongs to the
customer identified by the sessionId parameter. |
protected int |
getCount(KKCriteria c)
This method is mainly used for paging.
|
protected int |
getReservationId()
Get a unique reservation id from the counter table
|
RewardPoints |
getRewardPoints(java.lang.String sessionId,
DataDescriptorIf dataDesc)
Gets an array of reward point objects for a customer identified by the
sessionId
parameter. |
RewardPoints |
getRewardPointsWithOptions(java.lang.String sessionId,
DataDescriptorIf dataDescriptor,
FetchRewardPointOptionsIf options)
Gets an array of reward point objects for a customer identified by the
sessionId
parameter. |
int |
pointsAvailable(int customerId)
Calculates the number of reward points available for the customer identified by the
sessionId parameter. |
int |
pointsAvailable(java.lang.String sessionId)
Calculates the number of reward points available for the customer identified by the
sessionId parameter. |
int |
reservePoints(int customerId,
int points)
Removes a number of reward points from the total for the customer identified by the
sessionId parameter. |
int |
reservePoints(java.lang.String sessionId,
int points)
Removes a number of reward points from the total for the customer identified by the
sessionId parameter. |
acquireLock, addInsertAttr, addInsertAttr, addStringRuleConstraint, addStringRuleConstraint, checkRequired, escapeHTML, executeQuery, executeQuery, executeQuery, executeQuery, executeQuery, getAdminEngMgr, getBasketMgr, getBillingMgr, getBookableProductMgr, getCacheMgr, getCatMgr, getConfigMgr, getCookieMgr, getCurrMgr, getCustMgr, getCustomerIdFromSession, getCustomerStatsMgr, getCustomerTagMgr, getEmailMgr, getEng, getEventMgr, getExportMgr, getHTMLEscaper, getKonaKartConfig, getKonaKartConfig, getKonaKartConfig, getLangMgr, getManuMgr, getMiscItemMgr, getMiscPriceMgr, getMode, getModeString, getMqMgr, getMultiStoreMgr, getNewCriteria, getNewCriteria, getOrderIntegrationMgr, getOrderMgr, getOrderTotalMgr, getPaymentMgr, getProdMgr, getProductsToCategoresCriteria, getPromMgr, getPunchOutMgr, getRewardPointMgr, getSecMgr, getShippingMgr, getSolrMgr, getStoreId, getStoreMgr, getStoreTime, getSuggestionMgr, getTaxMgr, getTemplate, getTemplateRoot, getVelocityContextMgr, getWishListMgr, init, insertKKEvent, insertKKEvent, isBusiness, isBusinessOrEnterprise, isClassPresent, isCommunity, isDeadlockException, isEnterprise, isMultiStoreShareCategories, isMultiStoreShareCustomers, isMultiStoreShareCustomersOrProducts, isMultiStoreSharedDb, isMultiStoreShareProducts, isMultiVendor, isUnix, manageThrowable, releaseLock, updateStaticVariablesNow
public RewardPointMgr(KKEngIf eng) throws java.lang.Exception
eng
- the engjava.lang.Exception
- an unexpected exceptionpublic int pointsAvailable(java.lang.String sessionId) throws java.lang.Exception
sessionId
parameter.pointsAvailable
in interface RewardPointMgrIf
sessionId
- the sessionIdjava.lang.Exception
- an unexpected exceptionpublic int pointsAvailable(int customerId) throws java.lang.Exception
sessionId
parameter.pointsAvailable
in interface RewardPointMgrIf
customerId
- the customerIdjava.lang.Exception
- an unexpected exceptionpublic int addPoints(java.lang.String sessionId, int points, java.lang.String code, java.lang.String description) throws java.lang.Exception
sessionId
parameter.addPoints
in interface RewardPointMgrIf
sessionId
- the sessionIdpoints
- the pointscode
- An optional code to categorize the reason for awarding the pointsdescription
- An optional description describing why the points were awardedjava.lang.Exception
- an unexpected exceptionpublic int addPoints(int customerId, int points, java.lang.String code, java.lang.String description) throws java.lang.Exception
sessionId
parameter.addPoints
in interface RewardPointMgrIf
customerId
- the customerIdpoints
- the pointscode
- An optional code to categorize the reason for awarding the pointsdescription
- An optional description describing why the points were awardedjava.lang.Exception
- an unexpected exceptionpublic int deletePoints(java.lang.String sessionId, int points, java.lang.String code, java.lang.String description) throws java.lang.Exception
sessionId
parameter.deletePoints
in interface RewardPointMgrIf
sessionId
- the sessionIdpoints
- the pointscode
- An optional code to categorize the reason for redeeming the pointsdescription
- An optional description describing how the points were redeemedjava.lang.Exception
- an unexpected exceptionpublic int deletePoints(int customerId, int points, java.lang.String code, java.lang.String description) throws java.lang.Exception
sessionId
parameter.deletePoints
in interface RewardPointMgrIf
customerId
- the customerIdpoints
- the pointscode
- An optional code to categorize the reason for redeeming the pointsdescription
- An optional description describing how the points were redeemedjava.lang.Exception
- an unexpected exceptionpublic int reservePoints(java.lang.String sessionId, int points) 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.reservePoints
in interface RewardPointMgrIf
sessionId
- the sessionIdpoints
- the pointsjava.lang.Exception
- an unexpected exceptionpublic int reservePoints(int customerId, int points) 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.reservePoints
in interface RewardPointMgrIf
customerId
- the customerIdpoints
- the pointsjava.lang.Exception
- an unexpected exceptionpublic void deleteReservedPoints(java.lang.String sessionId, int reservationId, java.lang.String code, java.lang.String description) 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.deleteReservedPoints
in interface RewardPointMgrIf
sessionId
- the sessionIdreservationId
- the reservationIdcode
- An optional code to categorize the reason for redeeming the pointsdescription
- An optional description describing how the points were redeemedjava.lang.Exception
- an unexpected exceptionpublic void deleteReservedPoints(int customerId, int reservationId, java.lang.String code, java.lang.String description) 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.deleteReservedPoints
in interface RewardPointMgrIf
customerId
- the customerIdreservationId
- the reservationIdcode
- An optional code to categorize the reason for redeeming the pointsdescription
- An optional description describing how the points were redeemedjava.lang.Exception
- an unexpected exceptionpublic int freeReservedPoints(java.lang.String sessionId, int reservationId) 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.freeReservedPoints
in interface RewardPointMgrIf
sessionId
- the sessionIdreservationId
- the reservationIdjava.lang.Exception
- an unexpected exceptionpublic int freeReservedPoints(int customerId, int reservationId) 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.freeReservedPoints
in interface RewardPointMgrIf
customerId
- the customerIdreservationId
- the reservationIdjava.lang.Exception
- an unexpected exceptionprotected int getReservationId() throws java.lang.Exception
org.apache.torque.TorqueException
- an unexpected exception in Torque (the database layer)com.konakart.app.KKException
- an unexpected KKException exceptionjava.lang.Exception
public RewardPoints getRewardPointsWithOptions(java.lang.String sessionId, DataDescriptorIf dataDescriptor, FetchRewardPointOptionsIf options) throws java.lang.Exception
sessionId
parameter.getRewardPointsWithOptions
in interface RewardPointMgrIf
sessionId
- the sessionIddataDescriptor
- the dataDescriptoroptions
- the optionsjava.lang.Exception
- an unexpected exceptionpublic RewardPoints getRewardPoints(java.lang.String sessionId, DataDescriptorIf dataDesc) throws java.lang.Exception
sessionId
parameter.getRewardPoints
in interface RewardPointMgrIf
sessionId
- the sessionIddataDesc
- the dataDescjava.lang.Exception
- an unexpected exceptionprotected int getCount(KKCriteria c) throws org.apache.torque.TorqueException, com.workingdogs.village.DataSetException
c
- the corg.apache.torque.TorqueException
- an unexpected exception in Torque (the database layer)com.workingdogs.village.DataSetException
- an unexpected exception due to data in Torque (the database layer)Copyright © 2018 DS Data Systems UK Ltd.