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.
| Table | Purpose | Main fields |
|---|---|---|
reward_campaign | the campaign | code, name, type, value, currency, event, validity, expiry days, maximum per referrer, object type and identifier, status |
reward | granted reward | campaign, referrer, referred client, value, state, qualification, booking and expiry dates |
company | names of referrer and referred | display |
Code sets
| Field | Values |
|---|---|
| reward type | MONETARY_CREDIT (wallet credit), SUBSCRIPTION_FEE_CREDIT, USAGE_GRANT |
| trigger event | new_client_created, first_paid_subscription, first_paid_order, manual_approval |
| object type (usage grant only) | feature, product, service |
Process and validation
- 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.
- 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. - 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.