Brands
Represents the different brand identities operating under a parent company. Each brand can have its own configuration, players, games, and reward structures.
Relationships
- Belongs to
companiesviacompany_id - Has many players via
brand_id - Has many coin_packages via
brand_id - Has many transactions via
brand_id - Has many vip_levels via
brand_id - Has many daily_login_rewards via
brand_id - Has many user_vip_status_log via
brand_id - Has many vip_daily_cashback_log via
brand_id
Columns
| Column | Type | Nullable | Default | Description |
|---|---|---|---|---|
id | uuid | NO | gen_random_uuid() | Primary key |
name | varchar(255) | NO | Brand name. Must be unique across all brands. | |
is_enabled | boolean | YES | false | Whether the brand is currently active and accessible |
company_id | uuid | NO | FK to companies. Parent company that owns this brand. | |
config | jsonb | YES | Flexible JSON configuration for brand-specific settings (e.g., feature flags, UI config, payment settings) | |
origin | text[] | YES | '{}' | Array of allowed origin domains for CORS and request validation |
is_archived | boolean | NO | false | Soft-delete flag. Archived brands are hidden from active listings. |
is_sweepstakes | boolean | NO | false | Whether this brand operates as a sweepstakes casino (affects currency types, legal compliance, and game availability) |
created_at | timestamp | YES | CURRENT_TIMESTAMP | Record creation timestamp |
updated_at | timestamp | YES | CURRENT_TIMESTAMP | Last update timestamp |
Key Indexes
| Index | Columns | Notes |
|---|---|---|
brands_pkey | id | Primary key |
brands_name_key | name | Unique constraint |
idx_brands_is_sweepstakes | is_sweepstakes | Filter by sweepstakes mode |
idx_brands_origin | origin | GIN index for array search |
Business Rules
- Brand names must be globally unique
- The
is_sweepstakesflag determines the entire currency model:- Sweepstakes brands: Use Gold Coins (GC) and Sweepstakes Coins (SC) with no real-money deposits/withdrawals
- Regular brands: Use real-money currencies (EUR, USD, etc.)
- The
configJSONB field stores brand-specific overrides like payment provider settings, UI themes, and feature toggles - The
originarray is used for validating API requests from allowed frontend domains - Brands cannot be hard-deleted; they are archived via
is_archived