Skip to main content

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

Columns

ColumnTypeNullableDefaultDescription
iduuidNOgen_random_uuid()Primary key
brand_iduuidNOFK to brands. Rewards are brand-specific.
day_numberintegerNOConsecutive login day number (1, 2, 3... N). Infinite/extensible — admins can define as many days as needed.
gc_rewardnumeric(18)NO0Base Gold Coins reward for this day
sc_rewardnumeric(18)NO0Base Sweepstakes Coins reward for this day
descriptiontextYESDescription of the day's reward (shown in UI)
is_activebooleanNOtrueWhether this reward configuration is currently active
created_attimestamptzNOCURRENT_TIMESTAMPRecord creation timestamp
updated_attimestamptzNOCURRENT_TIMESTAMPLast update timestamp

Key Indexes

IndexColumnsNotes
daily_rewards_config_pkeyidPrimary key
daily_rewards_config_brand_id_day_number_keybrand_id, day_numberUnique — one reward config per day per brand
idx_daily_rewards_config_brand_activebrand_id, is_activeActive rewards for a brand
idx_daily_rewards_config_brand_daybrand_id, day_numberDay lookup per brand
idx_daily_rewards_config_brand_idbrand_idBrand filtering
idx_daily_rewards_config_day_numberday_numberDay number filtering
idx_daily_rewards_config_is_activeis_activeActive 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_multiplier from vip_levels
  • The actual formula: final_gc = gc_reward * vip_multiplier, final_sc = sc_reward * vip_multiplier
  • The player's consecutive_login_days field 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_login entry 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