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

PropertyReturnsDescription
activeStatusbooleanIndicates whether this reward's status is active.
autoReconcileBooleanApplicable to points buckets only. If true, debits are automatically reconciled against, ie linked to, matching credits.
balanceCalculationModeBalanceCalculationModeThe 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.
categoryRewardCategoryThe category this reward is classified under, used for grouping and filtering rewards in listings.
clientOrganisationThe 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.
completedModulesOrgTypeOrgTypeWhen 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.
deletedByProfileThe profile that soft-deleted this reward, if it has been deleted.
deletedDateDateThe date and time this reward was soft-deleted, ie marked deleted without removing the row.
effectiveDateDateDate from which the expiration mode applies, so that changing the mode only affects points issued after this date rather than retroactively.
emailConfirmbooleanIndicates whether recipients must confirm by email before this reward is awarded to them.
endDateDateThe date and time this reward or promotion closes to participants.
excludedPointsOrgTypeOrgTypeOrganisation type that is excluded from eligibility for this reward. Currently only used for promotions, not points buckets.
expirationModeStringExpiration 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.
expiryDateDateThe date and time after which points or entries awarded under this reward expire. Distinct from the reward's own end date.
externalUrlStringBuilds the full external URL for this reward's page on its website, using the website's live domain.
extraFieldsNvSetA set of custom name/value fields attached to this reward for storing additional configuration not covered by the standard properties.
featuredBooleanIndicates whether this reward is flagged as featured, for prominent display in reward listings.
fulfiledDateDateThe date and time this reward was processed, ie when gift vouchers were allocated or prize draw entries were collected.
groupRequirementsStringDetermines 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.
groupRewardsList<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.
groupsList<Group>The groups linked to this reward, derived from its group links.
idlongThe database-assigned unique identifier for this reward.
imageItemImageThe image associated with this reward, used as its visual representation on reward pages.
individualbooleanIndicates whether this reward's points accumulate to the individual profile rather than to an organisation.
nameStringThe 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.
notesStringFree-text administrator notes about this reward. Not shown to participants.
objectNameStringThe display name for this reward, used where a generic named-object label is required. Returns the same value as getName().
onePerRecipientBooleanIndicates 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.
orgCompletedModulesStringComma-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.
participantSelectorsStringConfiguration string identifying the participants eligible for this reward. Intended to eventually replace groupRewards, pointsOrgType and excludedPointsOrgType, but is currently used only for holding organisations.
performanceCalculationbooleanIndicates whether this points bucket uses the performance balance calculation mode, ie a simple sum of credits minus debits.
pointsExpiryRuleConfigStringXML configuration for the points expiry rule identified by pointsExpiryRuleTypeId.
pointsExpiryRuleTypeIdStringIdentifier of the points expiry rule type used to expire points issued under this reward. See PointsExpiryRuleType for the available rule types.
pointsOrgTypeOrgTypeWhen 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.
pointsTypePointsTypeIndicates 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.
promotionTypeStringIdentifier for the promotion mechanic type used by this reward, eg the kind of prize draw or voucher scheme.
requireApprovalBooleanIndicates whether points or entries awarded under this reward require administrator approval before being confirmed.
rigorousCalculationbooleanIndicates whether this points bucket uses the rigorous balance calculation mode.
rigorousV2CalculationbooleanIndicates whether this points bucket uses the rigorous v2 balance calculation mode, which reconciles negative points balances.
selectedGroupsList<Group>The groups selected for this reward, excluding any whose target group has itself been deleted.
stagingEnabledBooleanApplicable to points buckets only. If true, points requests for this bucket are recorded in a staging spreadsheet for review instead of being awarded immediately.
startDateDateThe date and time this reward or promotion opens to participants.
statusStringStatus 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.
statusListMap<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.
subTitleStringSecondary title text shown alongside the main title, for additional context or a call to action.
teamBasedbooleanIndicates whether this reward's points accumulate to a participant's organisation rather than to the individual profile.
templateStringPath to the template used to render this reward, if a non-default template is required.
titleStringUser-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.
urlStringA URL associated with this reward, such as a link to further details or terms and conditions.
userCompletedModulesStringComma-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.
validForDaysIntegerNumber of days points issued under this reward remain valid for before they expire, when using a relative expiry rule.
websiteWebsiteThe 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.
winnersStringFree-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.

ParameterDescription
websitethe 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.

ParameterDescription
idthe 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.

ParameterDescription
pointsTypethe 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.

ParameterDescription
templatethe 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.

ParameterDescription
pointsOrgTypethe 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.

ParameterDescription
excludedPointsOrgTypethe 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.

ParameterDescription
titlethe display title to set

setOrganisation(Organisation organisation)

Returns: void

Sets the organisation that owns this reward.

ParameterDescription
organisationthe 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.

ParameterDescription
clientthe 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.

ParameterDescription
namethe 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.

ParameterDescription
notesthe 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.

ParameterDescription
onePerRecipienttrue 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.

ParameterDescription
statusthe 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.

ParameterDescription
startDatethe 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.

ParameterDescription
endDatethe 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.

ParameterDescription
expiryDatethe 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.

ParameterDescription
deletedDatethe 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.

ParameterDescription
deletedBythe 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.

ParameterDescription
validForDaysthe 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.

ParameterDescription
fulfiledDatethe 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.

ParameterDescription
emailConfirmtrue 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.

ParameterDescription
completedModulesOrgTypethe 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.

ParameterDescription
orgCompletedModulesthe 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.

ParameterDescription
userCompletedModulesthe 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.

ParameterDescription
subTitlethe 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.

ParameterDescription
urlthe 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.

ParameterDescription
promotionTypethe 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.

ParameterDescription
imagethe 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.

ParameterDescription
winnersthe 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.

ParameterDescription
extraFieldsthe 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.

ParameterDescription
autoReconciletrue 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.

ParameterDescription
stagingEnabledtrue 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.

ParameterDescription
requireApprovaltrue 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.

ParameterDescription
participantSelectorsthe 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.

ParameterDescription
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.

ParameterDescription
balanceCalculationModethe 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.

ParameterDescription
pointsExpiryRuleTypeIdthe 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.

ParameterDescription
pointsExpiryRuleConfigthe 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.

ParameterDescription
expirationModethe 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.

ParameterDescription
effectiveDatethe 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.

ParameterDescription
categorythe 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.

ParameterDescription
currentUserthe 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.

ParameterDescription
currentUserthe 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.

ParameterDescription
nowthe 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.

ParameterDescription
nowthe 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.

ParameterDescription
nowthe 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.

ParameterDescription
nowthe 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.

ParameterDescription
currentUserthe 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.

ParameterDescription
userthe 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.

ParameterDescription
orgthe organisation to check eligibility for

containsGroup(Group g)

Returns: boolean

Checks whether the given group is one of the groups selected for this reward.

ParameterDescription
gthe 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.

ParameterDescription
salesTeamthe organisation to check, or null

isExcludedOrgType(Organisation salesTeam)

Returns: boolean

Checks whether the given organisation matches this reward's excluded points organisation type.

ParameterDescription
salesTeamthe 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.

ParameterDescription
featuredtrue to feature this reward

Returns: boolean

Returns whether this reward is featured, treating a null featured flag as false.

To get full access to the Kademi Hub existing customers can login here, or new customers can register here.