A VoucherExpiryRuleType implemented in JS, configured per-account via the Queries repo's voucher-expiry-rules.xml. Mirrors JsPointsExpiryRuleType. Its processFn function is invoked with the voucher, the reference date and this rule instance's own parameters, and must return the expiry date to assign - letting an account calculate calendar-based expiry logic instead of the fixed validForDays or staticExpiryDate options. Written as a voucher-expiry-rule element, with id, title, processFn and a fields list of the parameters the rule takes.

Group: Rewards

Implements: VoucherExpiryRuleType


Properties

PropertyReturnsDescription
fieldsList<ExtraField>The configuration fields shown when selecting this rule as a voucher type's expiration calculator, as defined in the account's Queries repo configuration.
idStringUnique identifier for this rule instance, used to select it as a voucher type's expiration calculator.
processFnStringName of the JS function that calculates the expiry date for a voucher.
titleStringDisplay title shown when choosing a voucher expiry rule type in the admin UI.

Methods

getId()

Returns: String

Unique identifier for this rule instance, used to select it as a voucher type's expiration calculator.

getFields()

Returns: List<ExtraField>

The configuration fields shown when selecting this rule as a voucher type's expiration calculator, as defined in the account's Queries repo configuration.

getProcessFn()

Returns: String

Name of the JS function that calculates the expiry date for a voucher.

getTitle()

Returns: String

Display title shown when choosing a voucher expiry rule type in the admin UI.

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