Daily Login Rewards
Extensible configuration table defining the rewards players receive for consecutive daily logins. Each brand can define its own reward schedule for any number of consecutive days.
Table Comment
Extensible configuration for daily login rewards per brand. Admins can add rewards for any day number (Day 1, 2, 3... N)
Relationships
- Belongs to brands via
brand_id - Consumed by daily_reward_logs (which records when players claim these rewards)
Columns
| Column | Type | Nullable | Default | Description |
|---|---|---|---|---|
id | uuid | NO | gen_random_uuid() | Primary key |
brand_id | uuid | NO | FK to brands. Rewards are brand-specific. | |
day_number | integer | NO | Consecutive login day number (1, 2, 3... N). Infinite/extensible — admins can define as many days as needed. | |
gc_reward | numeric(18) | NO | 0 | Base Gold Coins reward for this day |
sc_reward | numeric(18) | NO | 0 | Base Sweepstakes Coins reward for this day |
description | text | YES | Description of the day's reward (shown in UI) | |
is_active | boolean | NO | true | Whether this reward configuration is currently active |
created_at | timestamptz | NO | CURRENT_TIMESTAMP | Record creation timestamp |
updated_at | timestamptz | NO | CURRENT_TIMESTAMP | Last update timestamp |
Key Indexes
| Index | Columns | Notes |
|---|---|---|
daily_rewards_config_pkey | id | Primary key |
daily_rewards_config_brand_id_day_number_key | brand_id, day_number | Unique — one reward config per day per brand |
idx_daily_rewards_config_brand_active | brand_id, is_active | Active rewards for a brand |
idx_daily_rewards_config_brand_day | brand_id, day_number | Day lookup per brand |
idx_daily_rewards_config_brand_id | brand_id | Brand filtering |
idx_daily_rewards_config_day_number | day_number | Day number filtering |
idx_daily_rewards_config_is_active | is_active | Active filtering |
Business Rules
- The
(brand_id, day_number)combination is unique — each brand can only define one reward per consecutive day - The system is extensible: admins can add rewards for Day 1, 2, 3, ... up to any number N
- These are base rewards — VIP players receive boosted amounts via
daily_bonus_multiplierfrom vip_levels - The actual formula:
final_gc = gc_reward * vip_multiplier,final_sc = sc_reward * vip_multiplier - The player's
consecutive_login_daysfield on players determines which day's reward they receive - When a player claims a reward, a record is created in daily_reward_logs and a
daily_loginentry in player_sweepstakes_rewards - If a player misses a day, their streak resets to Day 1
- Inactive rewards (
is_active = false) are skipped — useful for temporarily disabling specific days