Reward campaigns — system description

Data model of the reward campaign master and the granted rewards, codes of reward types and trigger events, save validation, delete protection and permission keys.

Overview

Master data of referral and reward campaigns: code, name, reward type, value, currency, trigger event, validity, expiry days, cap, status. Rewards are granted by the system's central reward service; this module manages the master data and shows the granted rewards.

Data model

Table names carry the installation's own prefix in the database.

TablePurposeMain fields
reward_campaignthe campaigncode, name, type, value, currency, event, validity, expiry days, maximum per referrer, object type and identifier, status
rewardgranted rewardcampaign, referrer, referred client, value, state, qualification, booking and expiry dates
companynames of referrer and referreddisplay

Code sets

FieldValues
reward typeMONETARY_CREDIT (wallet credit), SUBSCRIPTION_FEE_CREDIT, USAGE_GRANT
trigger eventnew_client_created, first_paid_subscription, first_paid_order, manual_approval
object type (usage grant only)feature, product, service

Process and validation

  1. List: filter by status, event, search; per row code, name, type, value, event, validity, expiry, maximum, number of rewards, amount paid out; the row's expander shows the granted rewards.
  2. Save: the code must match [A-Za-z0-9_-]{2,64}, the name is required, the value greater than zero; for a usage grant object type and identifier are required. After a new record there is no redirect; the campaign identifier is written back into the form.
  3. Delete: only a campaign without referring rewards; otherwise an error with the code and the count.

Permissions

  • Layer 2: list, add/edit (on the form and on saving: identifier 0 = add, greater = edit), delete, debug. None of the keys is in the function catalogue, so in practice only the super admin reaches it.
  • Layer 3: none — system master data.
Related topics: reward subscription permissions