Overview

The Rewards Backend processes real-time events from a message queue (Kafka) to power the following features:
  1. Loyalty (Level System): XP progression and level-ups based on player activity
  2. Challenges: Track progress on wager, deposit, casino count, consecutive login, and other challenge types
  3. Game Mapping: Automatic discovery and mapping of games from player activity

Event Types

GamesEnriched (CasinoEvent)

Description: Individual casino transaction events (bet or win) before round aggregation.
Used by:
  1. Loyalty System
  2. Wager Challenges
  3. Casino Count Challenges
  4. Win Multiplier Challenges
  5. Game Mapping Service
Required Fields:
FieldTypeDescription
user_id
int64
Internal user ID (must be > 0 and < MaxInt32)
game_id
string
Game identifier
game_name
string
Game name
vendor_id
string
Game vendor/provider identifier. Can be optional if allow_incomplete_game_hash is enabled.
vendor_name
string
Game vendor/provider name. Can be optional if allow_incomplete_game_hash is enabled.
origin
string
Player origin identifier
type
string
Transaction type (e.g., "bet", "win")
amount
float64
Transaction amount (must be > 0)
activity_id
string
Unique activity/transaction identifier
currency
string
Currency code
timestamp
time
Event timestamp (cannot be zero)
status
string
Must be "approved" or "rollback"
round_id
string
Game round identifier. Required by some services, configurable.
Example JSON:

PaymentEnriched

Description: Payment transaction events (deposits and withdrawals).
Used by:
  1. Loyalty Service: for deposit-based XP contribution
  2. (Consecutive) Deposit Challenges
Required Fields:
FieldTypeDescription
user_id
int64
Internal user ID (must be > 0 and < MaxInt32)
payment_id
string
Unique payment identifier
status
string
Payment status. Must be "approved" for challenge processing. Rollback status is also supported for loyalty contribution reversal.
type
string
Payment type. Must be "deposit" for challenge processing.
amount
float64
Payment amount (must be > 0)
currency
string
Currency code
origin
string
Player origin identifier
timestamp
time
Event timestamp (cannot be zero)
Example JSON:

LoginEventEnriched

Description: User login events.
Used by:
  1. Consecutive Login Challenges
Required Fields:
FieldTypeDescription
user_id
int64
Internal user ID (must be > 0 and < MaxInt32)
unique_id
string
Unique event identifier
timestamp
time
Event timestamp (cannot be zero)
Example JSON:

SportsBetEnriched

Description: Sports betting events.
Used by:
  1. Loyalty Service: for sports bet XP contribution
Required Fields:
FieldTypeDescription
user_id
int64
Internal user ID (must be > 0)
origin
string
Player origin identifier
activity_id
string
Unique activity identifier
status
string
Bet status. For loyalty XP contribution, only events with "Settlement" status are processed.
currency
string
Currency code
timestamp
time
Event timestamp (cannot be zero)
amount
float64
Bet amount (must be > 0)
type
string
Bet type
Example JSON: