A PointsRuleType implemented in JS, configured per-account via the Queries repo's points-rules.xml. Its processFn function calculates the points to award a sales record's participant, and its optional includeFn function decides whether a record should be processed by this rule at all - when includeFn is not configured, every record is included. Configured as a points-rule element.
Group: Rewards
Implements: PointsRuleType
Properties
| Property | Returns | Description |
|---|---|---|
| fields | List<ExtraField> | The configuration fields shown when setting up this rule on a points allocation source, as defined in the account's Queries repo configuration. |
| id | String | Unique identifier for this rule instance, used to select it when configuring a points allocation source. |
| includeFn | String | Name of the optional JS function that decides whether a sales record should be processed by this rule. When configured, the function's result is coerced to a boolean, with true meaning the record is included. When not configured, every record is included. |
| processFn | String | Name of the JS function that calculates points for a sales record. |
| title | String | Display title shown when choosing a points rule type in the admin UI. |
Methods
getId()
Returns: String
Unique identifier for this rule instance, used to select it when configuring a points allocation source.
getFields()
Returns: List<ExtraField>
The configuration fields shown when setting up this rule on a points allocation source, as defined in the account's Queries repo configuration.
getProcessFn()
Returns: String
Name of the JS function that calculates points for a sales record.
getIncludeFn()
Returns: String
Name of the optional JS function that decides whether a sales record should be processed by this rule. When configured, the function's result is coerced to a boolean, with true meaning the record is included. When not configured, every record is included.
getTitle()
Returns: String
Display title shown when choosing a points rule type in the admin UI.