Represents a participant's points balance within a single points bucket (Reward). Wraps read-only access to the participant's credit and debit totals, current balance, and most recent credit and debit, computed on demand via PointsManager rather than persisted as a row of its own.
Properties
| Property | Returns | Description |
|---|---|---|
| bucket | Reward | Points bucket (Reward) this account's balance is tracked within. |
| participant | BaseEntity | Profile or organisation whose points balance this account represents. |
Methods
getBucket()
Returns: Reward
Points bucket (Reward) this account's balance is tracked within.
getParticipant()
Returns: BaseEntity
Profile or organisation whose points balance this account represents.
totalCredits()
Returns: Double
Sums all points credited to the participant in this bucket. Queries the database, so is not free to call.
totalDebits()
Returns: Double
Sums all points debited from the participant in this bucket. Queries the database, so is not free to call.
pointsBalance()
Returns: Double
Calculates the participant's current points balance in this bucket, ie total credits minus total debits.
lastCredit()
Returns: Points
Finds the most recent points credit recorded for the participant in this bucket.
lastDebit()
Returns: PointsDebit
Finds the most recent points debit recorded for the participant in this bucket.