Rewards Club — Levels
Access prerequisites
- Permission (module):
viewRewardsProgram(to read) /manageRewardsLevels(to create/edit/delete/reorder) - License/Feature:
REWARDS_CLUB - Menu container: GENERAL → group Rewards Club
What it is / when to use
Manages the club's levels (tiers) in a fully dynamic way: you create as many levels as you want, with a free name, threshold (entry threshold), color, icon, and a list of benefits. The order is defined by drag-and-drop. Each level can have a tier NFT generated inline.
Use it when designing the loyalty ladder (e.g.: Bronze → Silver → Gold → Diamond) and when adjusting thresholds/benefits over time.
Pre-conditions
- Permission:
viewRewardsProgramto read;manageRewardsLevelsto edit (dual permission: CPM enum + dynamic module in the DB). - License/Feature:
REWARDS_CLUB. - Dependencies from other screens: the Program defines the metric and the reference fiat — this changes how the threshold is displayed: in pts when the metric is
POINTS, or in the reference currency when financial.
Step by step
- Go to the menu Rewards Club → Levels (
/rewards-club/levels). - The list shows levels in order; drag by handles to reorder (persists automatically).
- Click New (or click a level to edit) — opens the lateral drawer.
- Fill in the tier code, name, description, threshold, color, icon, and benefits.
- Save. To generate the level's NFT, use the Generate NFT button on the row.
Fields
| Field | What it is | Required? | System/backend effect |
|---|---|---|---|
Tier (tier) | Level code (free string, e.g.: GOLD) | Yes | Normalized to UPPERCASE with _ in place of spaces. It is the level's key (together with the program). Cannot duplicate on creation. |
Name (customName → name) | Displayed level name | Yes | Friendly label for the tier. |
Description (description) | Descriptive text | No | Free text. |
Threshold (threshold → minThresholdFiat) | Minimum threshold to enter the level | Yes | Compared against the program metric. Displayed in pts (POINTS metric) or in the reference currency (financial metric). Transmitted as a BigNumber string. |
Color (badgeColor → colorHex) | Badge color (hex) | Yes | Visual color of the level; suggested palette in cycle. |
Icon (iconName) | Badge icon (Material Icons) | No | Quick-picker with suggestions (trophy, medal, diamond…). |
Benefits (benefits[]) | List of level benefits | No | Line-by-line editor. Lines in key: value format become structured benefits (e.g.: indicationBonusPercent: 5); others become a label. |
Order (order → sortOrder) | Level position | Yes (managed) | Defined by drag-and-drop; renumbered in multiples of 10 (10, 20, 30…) to ease future insertions. |
Tier NFT (tierNftAssetId) | NFT asset representing the level | No | undefined = not yet generated. The Generate NFT button creates the asset via tknLib (idempotent). |
Actions and modals
- Reorder (drag-and-drop): persists the new order via
PATCH .../levels/reorderimmediately (optimistic update; on error, reloads to undo). - Save level:
PUT /v1/rewards-club/admin/levels/:tier. Requires step-up (password + MFA). Validates required tier, absence of duplicates on creation, and filled name. - Delete level:
DELETE .../levels/:tierwith step-up. Blocked if there are users in the tier — the backend respondsok=false+reason=USERS_IN_TIER+usersInTier, and the UI shows how many users prevent deletion. - Generate NFT:
POST .../levels/:tier/generate-nft. Idempotent: if it already exists, returnsalreadyExists=trueand only links theassetId.
Business rules / cautions
Caution
- It is not possible to delete a level that has users positioned in it — empty/migrate the users first. This protects the integrity of the tier engine.
- The tier NFT must be locked for sale/resale (block_sell and block_resell) — it is a badge, not a tradable asset. The inline generation already creates the asset appropriately.
- The threshold display depends on the Program metric: check there before defining thresholds (pts vs. fiat).
Irreversible
- Generate NFT creates an on-chain asset via tknLib. The operation is idempotent (does not duplicate), but the created asset permanently represents the level — treat the
tierNftAssetIdas definitive for that tier.
- Financial values: thresholds are transmitted as BigNumber strings — no rounding.
Examples
Scenario 1 — Financial ladder in BRL
Program with metric DEPOSIT_VOLUME, window LIFETIME, fiat BRL.
- Create Bronze (threshold
0), Silver (5000), Gold (20000), Diamond (100000). - Define distinct colors/icons; add benefits (e.g.:
indicationBonusPercent: 5for Gold). - Drag to ensure the order Bronze < Silver < Gold < Diamond.
- Generate the NFT for each level using the inline button.
Scenario 2 — Points-based ladder
Program with metric POINTS.
- Thresholds are now displayed in pts. Define, e.g.: Bronze
0, Silver1000, Gold5000. - Ensure point-awarding missions exist in Missions so users can accumulate points.
Scenario 3 — Blocked deletion attempt
When deleting "Silver" with 37 users in the tier:
- The confirmation is accepted, but the backend returns
USERS_IN_TIERwithusersInTier=37. - The UI informs that 37 users prevent deletion.
- Adjust thresholds/recompute to migrate the users and try again.