The running points total held by one profile or organisation under one reward, kept as a stored value so a balance can be read without summing the whole ledger. This is a cached summary, not the ledger itself. The individual movements live in Points, for credits, and PointsDebit, for debits, and this row is expected to equal the sum of those less any expired credits. It is updated as transactions are recorded rather than recalculated on read, so if it ever drifts it is repaired with the 'refresh points balance' tool rather than by editing this row; restoring it from an audit backup is deliberately not supported for that reason.
Group: Database Entities
Implements: Auditable, Serializable
Properties
| Property | Returns | Description |
|---|---|---|
| auditOrg | Organisation | The organisation that owns the audit trail for this balance, taken from the reward's organisation. |
| id | long | The database-assigned unique identifier for this balance record. |
| issuedTo | BaseEntity | The profile or organisation this balance belongs to. Points can be held by either, so this is the common BaseEntity supertype rather than a Profile. |
| lastTransactionDate | Date | When the most recent credit or debit that contributed to this balance was recorded. Useful for telling a stale balance from one that is simply inactive. |
| numPoints | Double | The current points total for this entity and reward. Points are held as a floating point number because a reward can award fractional points, so do not assume a whole number. |
| reward | Reward | The reward whose points system this balance is counted under. A balance is always per reward, so an entity taking part in several rewards has one of these rows for each. |
Methods
getId()
Returns: long
The database-assigned unique identifier for this balance record.
getIssuedTo()
Returns: BaseEntity
The profile or organisation this balance belongs to. Points can be held by either, so this is the common BaseEntity supertype rather than a Profile.
getLastTransactionDate()
Returns: Date
When the most recent credit or debit that contributed to this balance was recorded. Useful for telling a stale balance from one that is simply inactive.
getNumPoints()
Returns: Double
The current points total for this entity and reward. Points are held as a floating point number because a reward can award fractional points, so do not assume a whole number.
getReward()
Returns: Reward
The reward whose points system this balance is counted under. A balance is always per reward, so an entity taking part in several rewards has one of these rows for each.
getAuditOrg()
Returns: Organisation
The organisation that owns the audit trail for this balance, taken from the reward's organisation.