Real Time Events
This document describes the real-time events (notification types) consumed by the Rewards Backend services, including the required fields for each event type and which services consume them.
Overview
The Rewards Backend processes real-time events from a message queue (Kafka) to power the following features:
- Loyalty (Level System): XP progression and level-ups based on player activity
- Challenges: Track progress on wager, deposit, casino count, consecutive login, and other challenge types
- 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:
- Loyalty System
- Wager Challenges
- Casino Count Challenges
- Win Multiplier Challenges
- Game Mapping Service
Required Fields:
| Field | Type | Description |
|---|---|---|
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:
- Loyalty Service: for deposit-based XP contribution
- (Consecutive) Deposit Challenges
Required Fields:
| Field | Type | Description |
|---|---|---|
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:
- Consecutive Login Challenges
Required Fields:
| Field | Type | Description |
|---|---|---|
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:
- Loyalty Service: for sports bet XP contribution
Required Fields:
| Field | Type | Description |
|---|---|---|
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: