Fired when points are debited from a profile or organisation against a reward, for example when redeeming points or reversing a previously granted reward. Raised by RewardService whenever a PointsDebit or a RewardEntry status change reduces a participant's points balance for a reward. FunnelManager fans this out into a RewardDebitedFunnelEvent per profile associated with the debited entity, and this event also implements IndexedItemUpdatedEvent so the debit or reward entry is re-indexed for search.
Implements: TriggerEvent, IndexedItemUpdatedEvent
Properties
| Property | Returns | Description |
|---|---|---|
| attributes | Map<String,Object> | Extra properties associated with this event. This event does not populate any. |
| availableBalance | Double | The debited entity's current available balance for the reward, ie points not yet committed to other debits, looked up from RewardService at the time this is called. |
| awardedToEntity | BaseEntity | The entity the points were debited from: the points issue's recipient if this debit relates to a specific PointsDebit, otherwise the entity passed to the constructor. |
| awardedToOrg | Organisation | The organisation the points were debited from, if the debit was made against an organisation rather than a specific profile. |
| branch | Branch | The branch this update occurred within. This event is not scoped to a branch. |
| deleted | boolean | Whether the updated object should be removed from the search index. A debit never deletes the underlying record, so this is always false. |
| eventId | String | The persistence-friendly identifier for this event type. |
| numDebited | double | The number of points that were debited. |
| pointsBalance | Double | The debited entity's current points balance for the reward, looked up from RewardService at the time this is called. |
| reward | Reward | The reward the points were debited against. |
| rewardDate | Date | The date the debit occurred. |
| rewardEndDate | Date | The end date of the reward the points were debited against. |
| rewardEntryStatus | RewardEntryStatus | The status of the reward entry associated with this debit, if this debit was raised from a reward entry status change rather than a PointsDebit. |
| rewardName | String | The name of the reward the points were debited against. |
| rewardStartDate | Date | The start date of the reward the points were debited against. |
| rewardTemplate | String | The template code of the reward the points were debited against. |
| sourceProfile | Profile | The profile the points were debited from, if the debited entity is a profile. |
| transaction | Transaction | The database transaction associated with this debit, so indexing can be deferred until it commits. |
| triggerItem1 | String | The ID of the website the debit occurred within, used as a trigger key. |
| triggerItem2 | String | The ID of the reward the points were debited against, used as a trigger key. |
| triggerItem3 | String | Not used by this event; always null. |
| triggerItem4 | String | Not used by this event; always null. |
| triggerItem5 | String | Not used by this event; always null. |
| updatedObject | Object | The object that should be re-indexed as a result of this debit: the PointsDebit if one was provided, otherwise the RewardEntry. |
| website | Website | The website the debit occurred within. |
Inherited from TriggerEvent
Properties
| Property | Returns | Description |
|---|---|---|
| serialisable | boolean | Whether this event's attributes were built to survive being persisted, ie every value is a plain serialisable value rather than a persistent entity or some other object that only makes sense inside the firing transaction. Only the firing app can know this, so it declares it - see EventBuilder. An agent that subscribes to an event does not run when it fires. The event is written to storage as JSON, buffered with others, and read back minutes later in a different session, so a value that cannot be written and read back is not merely awkward, it breaks the whole delivery. The agent framework therefore ignores any event which does not say yes here. |
Methods
isSerialisable()
Returns: boolean
Whether this event's attributes were built to survive being persisted, ie every value is a plain serialisable value rather than a persistent entity or some other object that only makes sense inside the firing transaction. Only the firing app can know this, so it declares it - see EventBuilder. An agent that subscribes to an event does not run when it fires. The event is written to storage as JSON, buffered with others, and read back minutes later in a different session, so a value that cannot be written and read back is not merely awkward, it breaks the whole delivery. The agent framework therefore ignores any event which does not say yes here.
Methods
getAwardedToEntity() · getSourceProfile() · getEventId() · getWebsite() · getTriggerItem1() · getTriggerItem2() · getTriggerItem3() · getTriggerItem4() · getTriggerItem5() · getAttributes() · getNumDebited() · getAwardedToOrg() · getRewardDate() · getRewardName() · getRewardEntryStatus() · getRewardTemplate() · getRewardStartDate() · getRewardEndDate() · getPointsBalance() · getAvailableBalance() · getBranch() · getUpdatedObject() · isDeleted() · getTransaction() · getReward()
getAwardedToEntity()
Returns: BaseEntity
The entity the points were debited from: the points issue's recipient if this debit relates to a specific PointsDebit, otherwise the entity passed to the constructor.
getSourceProfile()
Returns: Profile
The profile the points were debited from, if the debited entity is a profile.
getEventId()
Returns: String
The persistence-friendly identifier for this event type.
getWebsite()
Returns: Website
The website the debit occurred within.
getTriggerItem1()
Returns: String
The ID of the website the debit occurred within, used as a trigger key.
getTriggerItem2()
Returns: String
The ID of the reward the points were debited against, used as a trigger key.
getTriggerItem3()
Returns: String
Not used by this event; always null.
getTriggerItem4()
Returns: String
Not used by this event; always null.
getTriggerItem5()
Returns: String
Not used by this event; always null.
getAttributes()
Returns: Map<String,Object>
Extra properties associated with this event. This event does not populate any.
getNumDebited()
Returns: double
The number of points that were debited.
getAwardedToOrg()
Returns: Organisation
The organisation the points were debited from, if the debit was made against an organisation rather than a specific profile.
getRewardDate()
Returns: Date
The date the debit occurred.
getRewardName()
Returns: String
The name of the reward the points were debited against.
getRewardEntryStatus()
Returns: RewardEntryStatus
The status of the reward entry associated with this debit, if this debit was raised from a reward entry status change rather than a PointsDebit.
getRewardTemplate()
Returns: String
The template code of the reward the points were debited against.
getRewardStartDate()
Returns: Date
The start date of the reward the points were debited against.
getRewardEndDate()
Returns: Date
The end date of the reward the points were debited against.
getPointsBalance()
Returns: Double
The debited entity's current points balance for the reward, looked up from RewardService at the time this is called.
getAvailableBalance()
Returns: Double
The debited entity's current available balance for the reward, ie points not yet committed to other debits, looked up from RewardService at the time this is called.
getBranch()
Returns: Branch
The branch this update occurred within. This event is not scoped to a branch.
getUpdatedObject()
Returns: Object
The object that should be re-indexed as a result of this debit: the PointsDebit if one was provided, otherwise the RewardEntry.
isDeleted()
Returns: boolean
Whether the updated object should be removed from the search index. A debit never deletes the underlying record, so this is always false.
getTransaction()
Returns: Transaction
The database transaction associated with this debit, so indexing can be deferred until it commits.
getReward()
Returns: Reward
The reward the points were debited against.