Mutable request bean for awarding or debiting reward points to a participant. Created via PointsManager.newPointsRequest() and configured with a participant, a points value and, optionally, a reward, points tag or reason code, award and expiry dates, a team and a cart. Passed to PointsManager.processPointsRequest() to create the resulting points credit or debit: a positive numPoints creates an award, a negative numPoints creates a debit for the absolute value.


Properties

PropertyReturnsDescription
attachmentHashStringThe hash of a supporting file attached to this award. Only supported when the participant is a profile, not an organisation.
awardDateDateThe date the resulting award or debit is recorded as having been issued. If not set, the current date and time is used when the request is processed.
cartCartThe cart this request's debit is being applied for. Only applicable for debits: if set, the cart's Kademi id is recorded on the resulting PointsDebit's cartId field.
expiryDateDateThe date the points from an award expire, after which they can no longer be redeemed. Only meaningful for a credit; null if the reward's own expiry rules should apply instead.
invalidateBalanceBooleanWhether the participant's cached points balance should be invalidated as part of processing this request. Null is treated as false.
numPointsdoubleThe number of points this request applies: a positive value creates an award (credit) for that many points, a negative value creates a debit for the absolute value. A value of zero causes processing to do nothing.
participantBaseEntityThe profile or organisation this points request applies to. Must be set before the request is processed.
pasPointsAllocationSourceThe points allocation source, if any, this request is generated from. Only used when the participant is an organisation, to attribute the resulting debit or credit to the source that produced it.
reasonStringFree text explaining why the points were awarded or debited. Shown to the participant alongside the resulting transaction.
rewardRewardThe reward, ie the points bucket, this request is awarded from or debited against. May be null, in which case the participant's default reward is used when the request is processed.
tagOrReasonCodeStringFor a credit, the points tag classifying the award; for a debit, the reason code recorded against it. May be blank.
teamOrganisationThe team the points are being awarded to when the participant is an organisation. If set, it must match the participant organisation itself.

Methods

getParticipant() · setParticipant(BaseEntity participant) · getReward() · setReward(Reward reward) · getPas() · setPas(PointsAllocationSource pas) · getNumPoints() · setNumPoints(double numPoints) · getReason() · setReason(String reason) · getAwardDate() · setAwardDate(Date awardDate) · getExpiryDate() · setExpiryDate(Date expiryDate) · getInvalidateBalance() · setInvalidateBalance(Boolean invalidateBalance) · getTagOrReasonCode() · setTagOrReasonCode(String tagOrReasonCode) · getAttachmentHash() · setAttachmentHash(String attachmentHash) · getTeam() · setTeam(Organisation team) · getCart() · setCart(Cart cart)

getParticipant()

Returns: BaseEntity

The profile or organisation this points request applies to. Must be set before the request is processed.

setParticipant(BaseEntity participant)

Returns: void

Sets the profile or organisation this points request applies to.

ParameterDescription
participantthe participant to be awarded or debited points

getReward()

Returns: Reward

The reward, ie the points bucket, this request is awarded from or debited against. May be null, in which case the participant's default reward is used when the request is processed.

setReward(Reward reward)

Returns: void

Sets the reward, ie the points bucket, this request is awarded from or debited against.

ParameterDescription
rewardthe reward to apply this request to

getPas()

Returns: PointsAllocationSource

The points allocation source, if any, this request is generated from. Only used when the participant is an organisation, to attribute the resulting debit or credit to the source that produced it.

setPas(PointsAllocationSource pas)

Returns: void

Sets the points allocation source this request originates from.

ParameterDescription
pasthe points allocation source to attribute this request to

getNumPoints()

Returns: double

The number of points this request applies: a positive value creates an award (credit) for that many points, a negative value creates a debit for the absolute value. A value of zero causes processing to do nothing.

setNumPoints(double numPoints)

Returns: void

Sets the number of points to grant, if positive, or to deduct, if negative.

ParameterDescription
numPointsthe number of points to award or debit

getReason()

Returns: String

Free text explaining why the points were awarded or debited. Shown to the participant alongside the resulting transaction.

setReason(String reason)

Returns: void

Sets the free text reason to record against this request.

ParameterDescription
reasonthe reason for the award or debit

getAwardDate()

Returns: Date

The date the resulting award or debit is recorded as having been issued. If not set, the current date and time is used when the request is processed.

setAwardDate(Date awardDate)

Returns: void

Sets the date the resulting award or debit is recorded as having been issued.

ParameterDescription
awardDatethe award date to record, or null to use the current date when processed

getExpiryDate()

Returns: Date

The date the points from an award expire, after which they can no longer be redeemed. Only meaningful for a credit; null if the reward's own expiry rules should apply instead.

setExpiryDate(Date expiryDate)

Returns: void

Sets the date the points from the resulting award expire.

ParameterDescription
expiryDatethe expiry date for the award, or null to use the reward's own expiry rules

getInvalidateBalance()

Returns: Boolean

Whether the participant's cached points balance should be invalidated as part of processing this request. Null is treated as false.

setInvalidateBalance(Boolean invalidateBalance)

Returns: void

Sets whether the participant's cached points balance should be invalidated as part of processing this request.

ParameterDescription
invalidateBalancetrue to invalidate the cached balance, false or null to leave it as is

getTagOrReasonCode()

Returns: String

For a credit, the points tag classifying the award; for a debit, the reason code recorded against it. May be blank.

setTagOrReasonCode(String tagOrReasonCode)

Returns: void

Sets the points tag, for a credit, or reason code, for a debit, to record against this request.

ParameterDescription
tagOrReasonCodethe points tag or reason code to record

getAttachmentHash()

Returns: String

The hash of a supporting file attached to this award. Only supported when the participant is a profile, not an organisation.

setAttachmentHash(String attachmentHash)

Returns: void

Sets the hash of a supporting file to attach to this award.

ParameterDescription
attachmentHashthe attachment hash to record

getTeam()

Returns: Organisation

The team the points are being awarded to when the participant is an organisation. If set, it must match the participant organisation itself.

setTeam(Organisation team)

Returns: void

Sets the team the points are being awarded to when the participant is an organisation.

ParameterDescription
teamthe team to award the points to

getCart()

Returns: Cart

The cart this request's debit is being applied for. Only applicable for debits: if set, the cart's Kademi id is recorded on the resulting PointsDebit's cartId field.

setCart(Cart cart)

Returns: void

Sets the cart this request's debit is being applied for.

ParameterDescription
cartthe cart to record the resulting debit against
To get full access to the Kademi Hub existing customers can login here, or new customers can register here.