id | uuid | NO | gen_random_uuid() | Primary key |
email | varchar(255) | NO | | Player's email address. Unique per brand (email + brand_id composite unique). |
password | varchar(255) | YES | | Hashed password. NULL for social login accounts. |
first_name | varchar(255) | YES | | Player's first name |
last_name | varchar(255) | YES | | Player's last name |
title | varchar(10) | YES | | Honorific title (Mr, Mrs, etc.) |
gender | varchar(10) | NO | 'UNKNOWN' | Player gender. Values: MALE, FEMALE, UNKNOWN |
birthdate | date | YES | | Date of birth (used for age verification and VIP birthday gifts) |
phone | varchar(20) | YES | | Phone number |
country | varchar(3) | YES | | ISO 3166-1 alpha-2/3 country code |
state | varchar(3) | YES | | US state code (relevant for sweepstakes geo-restrictions) |
address | varchar(255) | YES | | Street address |
city | varchar(100) | YES | | City |
zip_code | varchar(20) | YES | | Postal/ZIP code |
brand_id | uuid | NO | | FK to brands. Which brand the player registered under. |
company_id | uuid | NO | | FK to companies. Parent company of the brand. |
account_status | varchar(50) | YES | 'PENDING' | Account lifecycle status. Values: PENDING, ACTIVE, SUSPENDED, CLOSED |
is_verified | boolean | YES | false | Overall verification flag |
is_kyc_verified | boolean | YES | false | KYC (Know Your Customer) verification complete |
kyc_status | varchar(50) | YES | 'not_started' | KYC verification workflow status. Values: not_started, pending, approved, rejected |
kyc_applicant_id | varchar(255) | YES | | External KYC provider applicant identifier |
kyc_triggered_at | timestamptz | YES | | When KYC verification was initiated |
kyc_completed_at | timestamptz | YES | | When KYC verification was completed |
address_verified | boolean | YES | false | Address verification status |
address_confirmed_at | timestamptz | YES | | When address was confirmed |
personal_details_confirmed_at | timestamptz | YES | | When personal details were confirmed |
terms_accepted | boolean | NO | false | Whether the player accepted terms and conditions |
email_verified | boolean | NO | false | Whether the player's email has been verified |
phone_verified | boolean | YES | false | Whether the player's phone has been verified |
can_withdraw | boolean | YES | false | Whether the player is allowed to withdraw funds. Managed by the sync_can_withdraw trigger. |
can_purchase | boolean | YES | false | Whether the player is allowed to make purchases |
first_purchase_date | timestamp | YES | | Timestamp of the player's first purchase |
first_purchase_transaction_id | uuid | YES | | FK to transactions. Links to the first deposit/purchase transaction. |
social_provider | varchar(50) | YES | | OAuth provider name (e.g., google, facebook) |
social_provider_id | varchar(255) | YES | | External ID from the social provider |
wallet_currency | varchar(3) | YES | 'EUR' | Player's wallet display currency |
preferred_currency_type | varchar(20) | YES | 'real_money' | User currency preference: real_money (regular casinos), sweepstakes (legacy), gc (Gold Coins), or sc (Sweepstakes Coins) |
user_language | char(2) | YES | 'EN' | Player's preferred language (ISO 639-1) |
consecutive_login_days | integer | YES | 0 | Tracks how many consecutive days the player has logged in. Used by the daily login rewards system. |
last_login_date | timestamp | YES | | Timestamp of the player's most recent login |
ip | inet | YES | | Last known IP address |
browser | varchar(100) | YES | | Last known browser user-agent |
os | varchar(100) | YES | | Last known operating system |
is_test_account | boolean | NO | false | Indicates whether this is a test/QA account (excluded from reporting) |
affiliate_id | numeric | YES | | Legacy numeric affiliate identifier |
affiliate_str | varchar(255) | YES | | Legacy affiliate string identifier |
email_disabled_by_platform | boolean | YES | false | Whether marketing emails were disabled by the platform |
sms_disabled_by_platform | boolean | YES | false | Whether marketing SMS was disabled by the platform |
redeemable_sc | numeric(18) | NO | 0 | Amount of SC (Sweepstakes Coins) eligible for redemption. Only SC that has been wagered (bet or won from betting) qualifies. Maintained automatically by triggers. Always <= current SC withdrawable balance. |
metadata | jsonb | YES | | Flexible JSON metadata for additional player data |
created_at | timestamp | YES | CURRENT_TIMESTAMP | Account creation timestamp |
updated_at | timestamp | YES | | Last update timestamp (managed by update_updated_at trigger) |