Represents an incentive program, such as a prize draw, gift voucher, or points bucket, that an organisation runs for its members. When pointsType is set the reward behaves as a points bucket that credits and debits accumulate against, either the profile or its organisation; when pointsType is null it is a one-off promotion such as a prize draw or gift voucher. Eligibility is controlled by group membership, organisation type, and completed learning modules, and the status together with the start and end dates determine whether it is currently open to participants.
Group: Database Entities
Implements: Serializable, NamedObject, Relational
Properties
| Property | Returns | Description |
|---|---|---|
| activeStatus | boolean | Indicates whether this reward's status is active. |
| autoReconcile | Boolean | Applicable to points buckets only. If true, debits are automatically reconciled against, ie linked to, matching credits. |
| balanceCalculationMode | BalanceCalculationMode | The points balance calculation mode for this points bucket. RIGOROUS uses the full PointsBalanceCalculator; PERFORMANCE uses a simple sum of credits minus debits; RIGOROUS_V2 is the rigorous calculation with reconciliation of negative balances. A null value defaults to rigorous. |
| category | RewardCategory | The category this reward is classified under, used for grouping and filtering rewards in listings. |
| client | Organisation | The organisation this promotion is run on behalf of, when applicable. For example a store might run many promotions, each sponsored by a different supplier client. |
| completedModulesOrgType | OrgType | When orgCompletedModules is set, specifies which organisation type to check for the current user. For each of the user's memberships to an organisation of this type, its users are checked for completion of the configured modules. |
| deletedBy | Profile | The profile that soft-deleted this reward, if it has been deleted. |
| deletedDate | Date | The date and time this reward was soft-deleted, ie marked deleted without removing the row. |
| effectiveDate | Date | Date from which the expiration mode applies, so that changing the mode only affects points issued after this date rather than retroactively. |
| emailConfirm | boolean | Indicates whether recipients must confirm by email before this reward is awarded to them. |
| endDate | Date | The date and time this reward or promotion closes to participants. |
| excludedPointsOrgType | OrgType | Organisation type that is excluded from eligibility for this reward. Currently only used for promotions, not points buckets. |
| expirationMode | String | Expiration date mode for points buckets. When set, points expire at the exact date and time of the expiry date rather than rolling to the end of the day, which is the default behaviour. |
| expiryDate | Date | The date and time after which points or entries awarded under this reward expire. Distinct from the reward's own end date. |
| externalUrl | String | Builds the full external URL for this reward's page on its website, using the website's live domain. |
| extraFields | NvSet | A set of custom name/value fields attached to this reward for storing additional configuration not covered by the standard properties. |
| featured | Boolean | Indicates whether this reward is flagged as featured, for prominent display in reward listings. |
| fulfiledDate | Date | The date and time this reward was processed, ie when gift vouchers were allocated or prize draw entries were collected. |
| groupRequirements | String | Determines whether group eligibility requirements for this reward are combined with AND or OR logic, ie whether a participant must belong to all selected groups or just one of them. |
| groupRewards | List<GroupReward> | The group links for this reward. Each GroupReward associates this reward with a group, permitting members of that group to receive it; an empty or null list means the reward is not restricted by group. |
| groups | List<Group> | The groups linked to this reward, derived from its group links. |
| id | long | The database-assigned unique identifier for this reward. |
| image | ItemImage | The image associated with this reward, used as its visual representation on reward pages. |
| individual | boolean | Indicates whether this reward's points accumulate to the individual profile rather than to an organisation. |
| name | String | The path-safe, unique identifier for this reward within its organisation. It is normally derived from the title when the reward is created but, unlike the title, is immutable from a user's perspective so it can be used as a fixed directory name in the rewards repository and in URLs. |
| notes | String | Free-text administrator notes about this reward. Not shown to participants. |
| objectName | String | The display name for this reward, used where a generic named-object label is required. Returns the same value as getName(). |
| onePerRecipient | Boolean | Indicates whether this reward may be given to a recipient, a user or their organisation depending on the points type, more than once, or only once. |
| orgCompletedModules | String | Comma-separated list of module paths, including the website, that must be completed by users within the current user's organisation for this reward to activate, for example mywebsite:/p1/c1/m1,mywebsite2:/p2/c2/m2. |
| participantSelectors | String | Configuration string identifying the participants eligible for this reward. Intended to eventually replace groupRewards, pointsOrgType and excludedPointsOrgType, but is currently used only for holding organisations. |
| performanceCalculation | boolean | Indicates whether this points bucket uses the performance balance calculation mode, ie a simple sum of credits minus debits. |
| pointsExpiryRuleConfig | String | XML configuration for the points expiry rule identified by pointsExpiryRuleTypeId. |
| pointsExpiryRuleTypeId | String | Identifier of the points expiry rule type used to expire points issued under this reward. See PointsExpiryRuleType for the available rule types. |
| pointsOrgType | OrgType | When the points type is POINTS_ORG, specifies which organisation type points should be awarded to. This matters because a user can belong to many organisations, so the org type narrows down which membership receives the points. |
| pointsType | PointsType | Indicates whether this reward is a points bucket and, if so, whether points accumulate against the profile (the individual user) or against their organisation. Null means this reward is not part of a points system, ie it is a one-off promotion such as a prize draw or gift voucher. |
| promotionType | String | Identifier for the promotion mechanic type used by this reward, eg the kind of prize draw or voucher scheme. |
| requireApproval | Boolean | Indicates whether points or entries awarded under this reward require administrator approval before being confirmed. |
| rigorousCalculation | boolean | Indicates whether this points bucket uses the rigorous balance calculation mode. |
| rigorousV2Calculation | boolean | Indicates whether this points bucket uses the rigorous v2 balance calculation mode, which reconciles negative points balances. |
| selectedGroups | List<Group> | The groups selected for this reward, excluding any whose target group has itself been deleted. |
| stagingEnabled | Boolean | Applicable to points buckets only. If true, points requests for this bucket are recorded in a staging spreadsheet for review instead of being awarded immediately. |
| startDate | Date | The date and time this reward or promotion opens to participants. |
| status | String | Status code for this reward: "a" for active, "e" for expired (has finished running), "f" for fulfilled (the administrator has processed the draw or competition), or null for a draft that is not yet enabled. |
| statusList | Map<String,String> | Builds a map of status code to display label for all possible reward statuses, including the blank draft status, suitable for populating a status selection control. |
| subTitle | String | Secondary title text shown alongside the main title, for additional context or a call to action. |
| teamBased | boolean | Indicates whether this reward's points accumulate to a participant's organisation rather than to the individual profile. |
| template | String | Path to the template used to render this reward, if a non-default template is required. |
| title | String | User-entered display title of the reward, shown to participants. May contain any characters, including path-hostile ones, so it should never be used as an identifier. |
| url | String | A URL associated with this reward, such as a link to further details or terms and conditions. |
| userCompletedModules | String | Comma-separated list of module paths, including the website, that must be completed by the user for this reward to activate, for example mywebsite:/p1/c1/m1,mywebsite2:/p2/c2/m2. |
| validForDays | Integer | Number of days points issued under this reward remain valid for before they expire, when using a relative expiry rule. |
| website | Website | The website this reward or promotion is associated with, used to scope reward-related pages and links. May be null for rewards that are not tied to a specific website. |
| winners | String | Free-text record of the winners of this reward, typically entered by an administrator after a prize draw is processed. |
Methods
getWebsite() · setWebsite(Website website) · getId() · setId(long id) · getPointsType() · setPointsType(PointsType pointsType) · getTemplate() · setTemplate(String template) · getPointsOrgType() · setPointsOrgType(OrgType pointsOrgType) · getExcludedPointsOrgType() · setExcludedPointsOrgType(OrgType excludedPointsOrgType) · getTitle() · setTitle(String title) · setOrganisation(Organisation organisation) · getClient() · setClient(Organisation client) · getName() · setName(String name) · getNotes() · setNotes(String notes) · getOnePerRecipient() · setOnePerRecipient(Boolean onePerRecipient) · getStatus() · setStatus(String status) · getStartDate() · setStartDate(Date startDate) · getEndDate() · setEndDate(Date endDate) · getExpiryDate() · setExpiryDate(Date expiryDate) · getDeletedDate() · setDeletedDate(Date deletedDate) · getDeletedBy() · setDeletedBy(Profile deletedBy) · getValidForDays() · setValidForDays(Integer validForDays) · getFulfiledDate() · setFulfiledDate(Date fulfiledDate) · isEmailConfirm() · setEmailConfirm(boolean emailConfirm) · getCompletedModulesOrgType() · setCompletedModulesOrgType(OrgType completedModulesOrgType) · getOrgCompletedModules() · setOrgCompletedModules(String orgCompletedModules) · getUserCompletedModules() · setUserCompletedModules(String userCompletedModules) · getGroupRewards() · getSubTitle() · setSubTitle(String subTitle) · getUrl() · setUrl(String url) · getPromotionType() · setPromotionType(String promotionType) · getImage() · setImage(ItemImage image) · getWinners() · setWinners(String winners) · getExtraFields() · setExtraFields(NvSet extraFields) · getAutoReconcile() · setAutoReconcile(Boolean autoReconcile) · autoReconcile() · getStagingEnabled() · setStagingEnabled(Boolean stagingEnabled) · stagingEnabled() · getRequireApproval() · setRequireApproval(Boolean requireApproval) · getParticipantSelectors() · setParticipantSelectors(String participantSelectors) · getGroupRequirements() · setGroupRequirements(String groupRequirements) · getBalanceCalculationMode() · setBalanceCalculationMode(BalanceCalculationMode balanceCalculationMode) · getPointsExpiryRuleTypeId() · setPointsExpiryRuleTypeId(String pointsExpiryRuleTypeId) · getPointsExpiryRuleConfig() · setPointsExpiryRuleConfig(String pointsExpiryRuleConfig) · getExpirationMode() · setExpirationMode(String expirationMode) · getEffectiveDate() · setEffectiveDate(Date effectiveDate) · getCategory() · setCategory(RewardCategory category) · onePerParticipant() · isInGroup(Profile currentUser) · isInOrg(Profile currentUser) · isOpen(Date now) · containsDate(Date now) · isActiveStatus() · isViewable(Date now) · isFinished(Date now) · getPointsRecip(Profile currentUser) · containsUser(Profile user) · containsOrg(Organisation org) · containsGroup(Group g) · hasOrgCriteria() · matchesOrgType(Organisation salesTeam) · isExcludedOrgType(Organisation salesTeam) · isTeamBased() · isIndividual() · isRigorousCalculation() · isPerformanceCalculation() · isRigorousV2Calculation() · getExternalUrl() · selectedGroupRewards() · getGroups() · requireApproval() · getObjectName() · getStatusList() · getSelectedGroups() · isFeatured() · setFeatured(Boolean featured) · featured()
getWebsite()
Returns: Website
The website this reward or promotion is associated with, used to scope reward-related pages and links. May be null for rewards that are not tied to a specific website.
setWebsite(Website website)
Returns: void
Sets the website this reward is associated with.
| Parameter | Description |
|---|---|
website | the website to associate with this reward |
getId()
Returns: long
The database-assigned unique identifier for this reward.
setId(long id)
Returns: void
Sets the database identifier for this reward. Normally only set by the persistence layer.
| Parameter | Description |
|---|---|
id | the primary key to assign |
getPointsType()
Returns: PointsType
Indicates whether this reward is a points bucket and, if so, whether points accumulate against the profile (the individual user) or against their organisation. Null means this reward is not part of a points system, ie it is a one-off promotion such as a prize draw or gift voucher.
setPointsType(PointsType pointsType)
Returns: void
Sets whether this reward is a points bucket and, if so, whether points accumulate to the profile or to its organisation.
| Parameter | Description |
|---|---|
pointsType | the points accumulation mode to set, or null to make this a one-off promotion |
getTemplate()
Returns: String
Path to the template used to render this reward, if a non-default template is required.
setTemplate(String template)
Returns: void
Sets the path to the template used to render this reward.
| Parameter | Description |
|---|---|
template | the template path to set, or null to use the default template |
getPointsOrgType()
Returns: OrgType
When the points type is POINTS_ORG, specifies which organisation type points should be awarded to. This matters because a user can belong to many organisations, so the org type narrows down which membership receives the points.
setPointsOrgType(OrgType pointsOrgType)
Returns: void
Sets the organisation type that points should be awarded to when this reward's points type is POINTS_ORG.
| Parameter | Description |
|---|---|
pointsOrgType | the organisation type to award points to, or null to leave unrestricted |
getExcludedPointsOrgType()
Returns: OrgType
Organisation type that is excluded from eligibility for this reward. Currently only used for promotions, not points buckets.
setExcludedPointsOrgType(OrgType excludedPointsOrgType)
Returns: void
Sets the organisation type that is excluded from eligibility for this reward.
| Parameter | Description |
|---|---|
excludedPointsOrgType | the organisation type to exclude, or null to exclude none |
getTitle()
Returns: String
User-entered display title of the reward, shown to participants. May contain any characters, including path-hostile ones, so it should never be used as an identifier.
setTitle(String title)
Returns: void
Sets the display title of the reward.
| Parameter | Description |
|---|---|
title | the display title to set |
setOrganisation(Organisation organisation)
Returns: void
Sets the organisation that owns this reward.
| Parameter | Description |
|---|---|
organisation | the owning organisation to set |
getClient()
Returns: Organisation
The organisation this promotion is run on behalf of, when applicable. For example a store might run many promotions, each sponsored by a different supplier client.
setClient(Organisation client)
Returns: void
Sets the client organisation this promotion is run on behalf of.
| Parameter | Description |
|---|---|
client | the sponsoring client organisation to set, or null if none |
getName()
Returns: String
The path-safe, unique identifier for this reward within its organisation. It is normally derived from the title when the reward is created but, unlike the title, is immutable from a user's perspective so it can be used as a fixed directory name in the rewards repository and in URLs.
setName(String name)
Returns: void
Sets the unique, path-safe name for this reward.
| Parameter | Description |
|---|---|
name | the unique name to set |
getNotes()
Returns: String
Free-text administrator notes about this reward. Not shown to participants.
setNotes(String notes)
Returns: void
Sets the administrator notes for this reward.
| Parameter | Description |
|---|---|
notes | the notes to set |
getOnePerRecipient()
Returns: Boolean
Indicates whether this reward may be given to a recipient, a user or their organisation depending on the points type, more than once, or only once.
setOnePerRecipient(Boolean onePerRecipient)
Returns: void
Sets whether this reward can only be awarded once per recipient.
| Parameter | Description |
|---|---|
onePerRecipient | true to restrict the reward to one award per recipient |
getStatus()
Returns: String
Status code for this reward: "a" for active, "e" for expired (has finished running), "f" for fulfilled (the administrator has processed the draw or competition), or null for a draft that is not yet enabled.
setStatus(String status)
Returns: void
Sets the status code for this reward.
| Parameter | Description |
|---|---|
status | the status code to set: "a" for active, "e" for expired, "f" for fulfilled, or null for draft |
getStartDate()
Returns: Date
The date and time this reward or promotion opens to participants.
setStartDate(Date startDate)
Returns: void
Sets the date and time this reward opens to participants.
| Parameter | Description |
|---|---|
startDate | the start date to set, or null for no start restriction |
getEndDate()
Returns: Date
The date and time this reward or promotion closes to participants.
setEndDate(Date endDate)
Returns: void
Sets the date and time this reward closes to participants.
| Parameter | Description |
|---|---|
endDate | the end date to set, or null for no end restriction |
getExpiryDate()
Returns: Date
The date and time after which points or entries awarded under this reward expire. Distinct from the reward's own end date.
setExpiryDate(Date expiryDate)
Returns: void
Sets the date after which points or entries awarded under this reward expire.
| Parameter | Description |
|---|---|
expiryDate | the expiry date to set, or null for no expiry |
getDeletedDate()
Returns: Date
The date and time this reward was soft-deleted, ie marked deleted without removing the row.
setDeletedDate(Date deletedDate)
Returns: void
Sets the date this reward was soft-deleted.
| Parameter | Description |
|---|---|
deletedDate | the soft-delete date to set |
getDeletedBy()
Returns: Profile
The profile that soft-deleted this reward, if it has been deleted.
setDeletedBy(Profile deletedBy)
Returns: void
Sets the profile that soft-deleted this reward.
| Parameter | Description |
|---|---|
deletedBy | the profile that deleted this reward |
getValidForDays()
Returns: Integer
Number of days points issued under this reward remain valid for before they expire, when using a relative expiry rule.
setValidForDays(Integer validForDays)
Returns: void
Sets the number of days points issued under this reward remain valid for.
| Parameter | Description |
|---|---|
validForDays | the validity period in days to set |
getFulfiledDate()
Returns: Date
The date and time this reward was processed, ie when gift vouchers were allocated or prize draw entries were collected.
setFulfiledDate(Date fulfiledDate)
Returns: void
Sets the date this reward was fulfilled.
| Parameter | Description |
|---|---|
fulfiledDate | the fulfilment date to set |
isEmailConfirm()
Returns: boolean
Indicates whether recipients must confirm by email before this reward is awarded to them.
setEmailConfirm(boolean emailConfirm)
Returns: void
Sets whether recipients must confirm by email before this reward is awarded.
| Parameter | Description |
|---|---|
emailConfirm | true to require email confirmation |
getCompletedModulesOrgType()
Returns: OrgType
When orgCompletedModules is set, specifies which organisation type to check for the current user. For each of the user's memberships to an organisation of this type, its users are checked for completion of the configured modules.
setCompletedModulesOrgType(OrgType completedModulesOrgType)
Returns: void
Sets the organisation type to check when evaluating orgCompletedModules.
| Parameter | Description |
|---|---|
completedModulesOrgType | the organisation type to check |
getOrgCompletedModules()
Returns: String
Comma-separated list of module paths, including the website, that must be completed by users within the current user's organisation for this reward to activate, for example mywebsite:/p1/c1/m1,mywebsite2:/p2/c2/m2.
setOrgCompletedModules(String orgCompletedModules)
Returns: void
Sets the CSV list of module paths that must be completed within the user's organisation for this reward to activate.
| Parameter | Description |
|---|---|
orgCompletedModules | the CSV of module paths to set |
getUserCompletedModules()
Returns: String
Comma-separated list of module paths, including the website, that must be completed by the user for this reward to activate, for example mywebsite:/p1/c1/m1,mywebsite2:/p2/c2/m2.
setUserCompletedModules(String userCompletedModules)
Returns: void
Sets the CSV list of module paths that must be completed by the user for this reward to activate.
| Parameter | Description |
|---|---|
userCompletedModules | the CSV of module paths to set |
getGroupRewards()
Returns: List<GroupReward>
The group links for this reward. Each GroupReward associates this reward with a group, permitting members of that group to receive it; an empty or null list means the reward is not restricted by group.
getSubTitle()
Returns: String
Secondary title text shown alongside the main title, for additional context or a call to action.
setSubTitle(String subTitle)
Returns: void
Sets the subtitle shown alongside the reward's main title.
| Parameter | Description |
|---|---|
subTitle | the subtitle to set |
getUrl()
Returns: String
A URL associated with this reward, such as a link to further details or terms and conditions.
setUrl(String url)
Returns: void
Sets the URL associated with this reward.
| Parameter | Description |
|---|---|
url | the URL to set |
getPromotionType()
Returns: String
Identifier for the promotion mechanic type used by this reward, eg the kind of prize draw or voucher scheme.
setPromotionType(String promotionType)
Returns: void
Sets the promotion mechanic type identifier for this reward.
| Parameter | Description |
|---|---|
promotionType | the promotion type identifier to set |
getImage()
Returns: ItemImage
The image associated with this reward, used as its visual representation on reward pages.
setImage(ItemImage image)
Returns: void
Sets the image associated with this reward.
| Parameter | Description |
|---|---|
image | the image to set |
getWinners()
Returns: String
Free-text record of the winners of this reward, typically entered by an administrator after a prize draw is processed.
setWinners(String winners)
Returns: void
Sets the free-text record of winners for this reward.
| Parameter | Description |
|---|---|
winners | the winners text to set |
getExtraFields()
Returns: NvSet
A set of custom name/value fields attached to this reward for storing additional configuration not covered by the standard properties.
setExtraFields(NvSet extraFields)
Returns: void
Sets the custom name/value fields attached to this reward.
| Parameter | Description |
|---|---|
extraFields | the extra fields set to attach |
getAutoReconcile()
Returns: Boolean
Applicable to points buckets only. If true, debits are automatically reconciled against, ie linked to, matching credits.
setAutoReconcile(Boolean autoReconcile)
Returns: void
Sets whether debits should be automatically reconciled against credits for this points bucket.
| Parameter | Description |
|---|---|
autoReconcile | true to enable auto-reconciliation |
autoReconcile()
Returns: boolean
Returns whether debits should be automatically reconciled against credits for this points bucket, treating a null autoReconcile flag as false.
getStagingEnabled()
Returns: Boolean
Applicable to points buckets only. If true, points requests for this bucket are recorded in a staging spreadsheet for review instead of being awarded immediately.
setStagingEnabled(Boolean stagingEnabled)
Returns: void
Sets whether points requests for this bucket should be staged for review instead of awarded immediately.
| Parameter | Description |
|---|---|
stagingEnabled | true to enable staging |
stagingEnabled()
Returns: boolean
Returns whether points requests for this bucket are staged for review, treating a null stagingEnabled flag as false.
getRequireApproval()
Returns: Boolean
Indicates whether points or entries awarded under this reward require administrator approval before being confirmed.
setRequireApproval(Boolean requireApproval)
Returns: void
Sets whether this reward requires administrator approval before awards are confirmed.
| Parameter | Description |
|---|---|
requireApproval | true to require approval |
getParticipantSelectors()
Returns: String
Configuration string identifying the participants eligible for this reward. Intended to eventually replace groupRewards, pointsOrgType and excludedPointsOrgType, but is currently used only for holding organisations.
setParticipantSelectors(String participantSelectors)
Returns: void
Sets the participant selector configuration for this reward.
| Parameter | Description |
|---|---|
participantSelectors | the participant selector configuration to set |
getGroupRequirements()
Returns: String
Determines whether group eligibility requirements for this reward are combined with AND or OR logic, ie whether a participant must belong to all selected groups or just one of them.
setGroupRequirements(String groupRequirements)
Returns: void
Sets whether group eligibility requirements are combined with AND or OR logic.
| Parameter | Description |
|---|---|
groupRequirements | "and" to require all selected groups, or another value or null to require just one |
getBalanceCalculationMode()
Returns: BalanceCalculationMode
The points balance calculation mode for this points bucket. RIGOROUS uses the full PointsBalanceCalculator; PERFORMANCE uses a simple sum of credits minus debits; RIGOROUS_V2 is the rigorous calculation with reconciliation of negative balances. A null value defaults to rigorous.
setBalanceCalculationMode(BalanceCalculationMode balanceCalculationMode)
Returns: void
Sets the points balance calculation mode for this points bucket.
| Parameter | Description |
|---|---|
balanceCalculationMode | the balance calculation mode to set |
getPointsExpiryRuleTypeId()
Returns: String
Identifier of the points expiry rule type used to expire points issued under this reward. See PointsExpiryRuleType for the available rule types.
setPointsExpiryRuleTypeId(String pointsExpiryRuleTypeId)
Returns: void
Sets the points expiry rule type identifier used to expire points for this reward.
| Parameter | Description |
|---|---|
pointsExpiryRuleTypeId | the expiry rule type identifier to set |
getPointsExpiryRuleConfig()
Returns: String
XML configuration for the points expiry rule identified by pointsExpiryRuleTypeId.
setPointsExpiryRuleConfig(String pointsExpiryRuleConfig)
Returns: void
Sets the XML configuration for the points expiry rule.
| Parameter | Description |
|---|---|
pointsExpiryRuleConfig | the expiry rule configuration XML to set |
getExpirationMode()
Returns: String
Expiration date mode for points buckets. When set, points expire at the exact date and time of the expiry date rather than rolling to the end of the day, which is the default behaviour.
setExpirationMode(String expirationMode)
Returns: void
Sets the expiration date mode for points buckets.
| Parameter | Description |
|---|---|
expirationMode | the expiration mode to set |
getEffectiveDate()
Returns: Date
Date from which the expiration mode applies, so that changing the mode only affects points issued after this date rather than retroactively.
setEffectiveDate(Date effectiveDate)
Returns: void
Sets the effective date from which the expiration mode applies.
| Parameter | Description |
|---|---|
effectiveDate | the effective date to set |
getCategory()
Returns: RewardCategory
The category this reward is classified under, used for grouping and filtering rewards in listings.
setCategory(RewardCategory category)
Returns: void
Sets the category this reward is classified under.
| Parameter | Description |
|---|---|
category | the category to set |
onePerParticipant()
Returns: boolean
Returns whether this reward can only be awarded once per participant, treating a null onePerRecipient flag as false.
isInGroup(Profile currentUser)
Returns: boolean
Checks whether the given user belongs to one of the groups selected for this reward. If no groups are selected, anyone is considered eligible.
| Parameter | Description |
|---|---|
currentUser | the user to check group membership for, or null |
isInOrg(Profile currentUser)
Returns: boolean
Checks whether the given user's organisation memberships satisfy this reward's included and excluded organisation type requirements.
| Parameter | Description |
|---|---|
currentUser | the user to check organisation eligibility for, or null |
isOpen(Date now)
Returns: boolean
Checks whether this reward is open to participants at the given date and time. The status must be active, the start date must be null or on or before now, and the end date must be null or on or after now.
| Parameter | Description |
|---|---|
now | the date and time to check openness at |
containsDate(Date now)
Returns: boolean
Checks whether the given date falls within this reward's start and end dates, ignoring its status.
| Parameter | Description |
|---|---|
now | the date to check |
isActiveStatus()
Returns: boolean
Indicates whether this reward's status is active.
isViewable(Date now)
Returns: boolean
Checks whether this reward should be visible to participants at the given date, based on its status and start date. Unlike isOpen, a finished reward, ie expired or fulfilled, remains viewable.
| Parameter | Description |
|---|---|
now | the date to check visibility at |
isFinished(Date now)
Returns: boolean
Checks whether this reward has finished running as at the given date, either because its end date has passed while active, or because its status is already expired.
| Parameter | Description |
|---|---|
now | the date to check |
getPointsRecip(Profile currentUser)
Returns: BaseEntity
Works out which entity, the user's profile or one of their organisations, should receive points awarded under this reward, based on the points type and organisation type configuration.
| Parameter | Description |
|---|---|
currentUser | the user to determine the points recipient for |
containsUser(Profile user)
Returns: boolean
Checks whether the given user is eligible for this reward based on its selected groups, applying AND or OR logic according to groupRequirements. If no groups are selected, anyone is eligible.
| Parameter | Description |
|---|---|
user | the user to check eligibility for, or null |
containsOrg(Organisation org)
Returns: boolean
Checks the given organisation's selected organisation types against this reward's included and excluded points organisation types.
| Parameter | Description |
|---|---|
org | the organisation to check eligibility for |
containsGroup(Group g)
Returns: boolean
Checks whether the given group is one of the groups selected for this reward.
| Parameter | Description |
|---|---|
g | the group to check, or null |
hasOrgCriteria()
Returns: boolean
Indicates whether this reward has any organisation-based eligibility criteria set, ie an included organisation type, an excluded organisation type, or participant selectors.
matchesOrgType(Organisation salesTeam)
Returns: boolean
Checks whether the given organisation matches this reward's included points organisation type and does not match its excluded organisation type. A null organisation only matches when neither an included nor excluded type is configured.
| Parameter | Description |
|---|---|
salesTeam | the organisation to check, or null |
isExcludedOrgType(Organisation salesTeam)
Returns: boolean
Checks whether the given organisation matches this reward's excluded points organisation type.
| Parameter | Description |
|---|---|
salesTeam | the organisation to check, or null |
isTeamBased()
Returns: boolean
Indicates whether this reward's points accumulate to a participant's organisation rather than to the individual profile.
isIndividual()
Returns: boolean
Indicates whether this reward's points accumulate to the individual profile rather than to an organisation.
isRigorousCalculation()
Returns: boolean
Indicates whether this points bucket uses the rigorous balance calculation mode.
isPerformanceCalculation()
Returns: boolean
Indicates whether this points bucket uses the performance balance calculation mode, ie a simple sum of credits minus debits.
isRigorousV2Calculation()
Returns: boolean
Indicates whether this points bucket uses the rigorous v2 balance calculation mode, which reconciles negative points balances.
getExternalUrl()
Returns: String
Builds the full external URL for this reward's page on its website, using the website's live domain.
selectedGroupRewards()
Returns: List<GroupReward>
Returns this reward's group links, excluding any whose target group has itself been deleted.
getGroups()
Returns: List<Group>
The groups linked to this reward, derived from its group links.
requireApproval()
Returns: boolean
Returns whether this reward requires administrator approval, treating a null requireApproval flag as false.
getObjectName()
Returns: String
The display name for this reward, used where a generic named-object label is required. Returns the same value as getName().
getStatusList()
Returns: Map<String,String>
Builds a map of status code to display label for all possible reward statuses, including the blank draft status, suitable for populating a status selection control.
getSelectedGroups()
Returns: List<Group>
The groups selected for this reward, excluding any whose target group has itself been deleted.
isFeatured()
Returns: Boolean
Indicates whether this reward is flagged as featured, for prominent display in reward listings.
setFeatured(Boolean featured)
Returns: void
Sets whether this reward is flagged as featured.
| Parameter | Description |
|---|---|
featured | true to feature this reward |
featured()
Returns: boolean
Returns whether this reward is featured, treating a null featured flag as false.