/** * Wallet Types * * Types related to wallet management, payment accounts, transactions, orders, and items. * These types match the server contracts from be-pay-svc (modelsv3). */ // ============================================================================ // Player Address // ============================================================================ /** * Player billing or shipping address * * Stored in auth-svc, used by wallet for account linking and checkout */ export interface PlayerAddressProps { /** Unique address ID */ player_address_id: string; /** Associated player ID */ player_id: string; /** Name on the address (e.g. full name) */ name?: string; /** Street address */ street: string; /** City */ city: string; /** Two-letter state code (e.g. "NY") */ state: string; /** Country code (e.g. "US") */ country: string; /** Address type */ type: 'shipping' | 'billing'; /** ZIP/postal code */ zip: string; /** Address status */ status: string; /** Timestamp when address was created */ create_datetime: any; /** Timestamp of last update */ last_update_datetime: any; } // ============================================================================ // Location // ============================================================================ /** * Geographic location with legal jurisdiction info * * Used for location-restricted purchases and compliance */ export interface LocationProps { /** Unique location ID */ location_id: string; /** Location value (e.g. state abbreviation) */ value: string; /** Display label */ label: string; /** Whether this location is legal for real-money operations */ legal_ind: boolean; /** Commission percentage for this location */ commission_pct: number; /** URL to location image/flag */ location_image: string; /** Timestamp when location was created */ create_datetime: any; /** Timestamp of last update */ last_update_datetime: any; } // ============================================================================ // Wallet Settings // ============================================================================ /** * Wallet settings for a player * * Controls PIN authentication, terms agreement, and account permissions. * Auto-created with defaults when first accessed for a player. */ export interface WalletSettingsProps { /** Unique wallet settings ID */ wallet_settings_id: string; /** Associated player ID */ player_id: string; /** Whether PIN is required for wallet access */ require_pin: boolean; /** PIN value (masked as "hidden" in GET responses when set) */ pin?: string; /** Whether card accounts are allowed */ allow_cards: boolean; /** Whether manual ACH accounts are allowed */ allow_manual_ach: boolean; /** Whether PayPal accounts are allowed */ allow_paypal: boolean; /** Whether player has agreed to wallet terms */ agreed_to_terms: boolean; /** Number of chargebacks on the account */ chargebacks?: number; /** Admin override: allow blacklisted ACH banks */ override_blacklist_ach?: boolean; /** Admin override: skip verification transactions */ override_verify_transactions?: boolean; /** When the current PIN authentication session expires */ auth_end_datetime?: any; /** When terms were agreed to */ terms_timestamp?: any; /** Admin override: allow accounts with no activity */ allow_no_activity?: boolean; /** Wallet status */ status: string; /** Description when wallet is suspended */ status_description?: string; /** Timestamp when settings were created */ create_datetime: any; /** Timestamp of last update */ last_update_datetime: any; } // ============================================================================ // Accounts // ============================================================================ /** * Payment account (ACH, card, PayPal, or internal BettorEdge wallet) * * Accounts link to either an ACH detail or card detail based on account_type. */ export interface AccountProps { /** Unique account ID */ account_id: string; /** Associated player ID */ player_id: string; /** Type of payment account */ account_type: 'card' | 'ach' | 'paypal' | 'bettoredge'; /** Display label (e.g. "Chase ****1234") */ account_label: string; /** Account status */ status: string; /** Populated ACH details (when account_type is 'ach') */ ach_detail?: ACHDetailProps; /** Populated card details (when account_type is 'card') */ card_detail?: CardDetailProps; /** Timestamp when account was created */ create_datetime: any; /** Default billing address ID for this account */ default_billing_address_id?: string; /** Whether this is the player's default payment account */ default_account?: boolean; /** Transaction fee rate (e.g. 0.015 = 1.5%) */ transaction_fee: number; /** External client ID (e.g. Nuvei user token) */ client_id?: string; /** Redirect URL for external payment flows */ redirect_url?: string; /** Whether this is a placeholder for instant bank transfer linking */ ibt_placeholder?: boolean; /** Legacy account ID from v1/v2 migration */ legacy_id?: string; /** Timestamp of last verification attempt */ last_verify_attempt?: any; /** Timestamp of last update */ last_update_datetime: any; } /** * ACH bank account details * * Account and routing numbers are encrypted at rest. * Masked account number is always available. */ export interface ACHDetailProps { /** Unique ACH detail ID */ ach_detail_id: string; /** Associated account ID */ account_id: string; /** External ID from payment provider (e.g. Nuvei UPO ID) */ external_id: string; /** Masked account number (e.g. "************1234") */ masked_account_number?: string; /** Bank name */ bank_name: string; /** Bank account type */ account_type: 'checking' | 'savings'; /** Bank routing number (encrypted at rest, only returned decrypted on specific endpoints) */ routing_number?: string; /** Bank account number (encrypted at rest, only returned decrypted on specific endpoints) */ account_number?: string; /** Encryption initialization vector (hex) */ encryption_iv?: string; /** Payment session ID */ session_id?: string; /** Whether manual withdrawal is allowed (Nuvei accounts with collected details for Payliance) */ manual_withdraw_allowed?: boolean; /** Whether instant deposits are allowed */ instant_allowed?: boolean; /** Payment processor provider */ payment_provider: 'nuvei' | 'payliance'; /** ACH linking method */ ach_type: 'ibf' | 'manual'; /** Timestamp when detail was created */ create_datetime: any; /** Timestamp of last update */ last_update_datetime: any; } /** * Credit/debit card details * * Card numbers are encrypted at rest. Masked card number is always available. */ export interface CardDetailProps { /** Unique card detail ID */ card_detail_id: string; /** Associated account ID */ account_id: string; /** Cardholder first name */ first_name: string; /** Cardholder last name */ last_name: string; /** Cardholder middle name */ middle_name?: string; /** Card expiration date */ expiration_date: any; /** Card number (encrypted at rest) */ card_number: string; /** Card type (e.g. "credit", "debit") */ card_type?: string; /** Card brand (e.g. "VISA", "AMEX", "MASTERCARD", "DISCOVER") */ card_brand?: string; /** Masked card number (e.g. "************1234") */ masked_card_number: string; /** Encryption initialization vector */ encryption_iv: any; /** External transaction ID from card verification */ authorize_transaction_id?: string; /** Reason for verification failure */ fail_reason?: string; /** Card CVV (not stored, used during transactions) */ cvv: string; /** Default billing address ID */ default_address_id?: string; /** Card verification status */ status: string; /** Timestamp when detail was created */ create_datetime: any; /** Timestamp of last update */ last_update_datetime: any; } // ============================================================================ // Limits // ============================================================================ /** * Player deposit limits and fee configuration * * Auto-created with defaults when first accessed for a player. * Tracks daily deposit amounts and instant deposit availability. */ export interface PlayerDepositLimitProps { /** Unique deposit limit ID */ player_deposit_limit_id: string; /** Associated player ID */ player_id: string; /** Maximum instant deposit amount */ instant_limit: number; /** Remaining instant deposit availability */ instant_available: number; /** Total instant deposits currently in-flight */ instant_deposits: number; /** Card deposits in the last rolling period */ last_days_card_deposits: number; /** ACH deposits in the last rolling period */ last_days_ach_deposits: number; /** ACH transaction fee rate (e.g. 0.015 = 1.5%) */ ach_fee: number; /** Card transaction fee rate (e.g. 0.045 = 4.5%) */ card_fee: number; /** PayPal transaction fee rate (e.g. 0.05 = 5%) */ paypal_fee: number; /** Consecutive success/fail streak count */ streak: number; /** Whether streak is success or failure */ streak_type: 'success' | 'fail'; /** Number of days deposits are held before settlement */ hold_days: number; /** Daily ACH deposit limit */ ach_daily_limit: number; /** Daily card deposit limit */ card_daily_limit: number; /** Timestamp when limit was created */ create_datetime: any; /** Timestamp of last update */ last_update_datetime: any; } /** * Player withdrawal limits * * Auto-created with defaults when first accessed for a player. * Tracks daily withdrawal amounts and weekly count. */ export interface PlayerWithdrawLimitProps { /** Unique withdraw limit ID */ player_withdraw_limit_id: string; /** Associated player ID */ player_id: string; /** Daily ACH withdrawal limit */ ach_daily_limit: number; /** Daily card withdrawal limit */ card_daily_limit: number; /** Total promo balance received */ promo_received: number; /** Date when promo was received */ promo_received_date?: string; /** Total amount staked (used for withdrawal eligibility) */ total_staked: number; /** Maximum withdrawals allowed per week */ withdraws_per_week: number; /** ACH withdrawals in the last rolling period */ last_days_ach_withdraws: number; /** Card withdrawals in the last rolling period */ last_days_card_withdraws: number; /** Number of withdrawals this week */ week_withdraw_count: number; /** Timestamp when limit was created */ create_datetime: any; /** Timestamp of last update */ last_update_datetime: any; } /** * Per-account spending limit * * Players can set limits on individual accounts to manage spending. * Resets after limit_days period. */ export interface AccountLimitProps { /** Unique account limit ID */ account_limit_id: string; /** Associated account ID */ account_id: string; /** Maximum spending amount for the period */ limit_amount: number; /** Number of days in the limit period (1=daily, 7=weekly, 30=monthly) */ limit_days: number; /** Limit status */ status: 'active' | 'inactive'; /** Amount already spent in current period */ current_amount: number; /** Timestamp when limit was created */ create_datetime: any; /** When the current period resets */ reset_datetime: any; /** Timestamp of last update */ last_update_datetime: any; } // ============================================================================ // Account Snooze // ============================================================================ /** * Temporary account disable (snooze) * * Prevents deposits and withdrawals on a specific account for a set duration. * end_datetime is calculated server-side from snooze_days. */ export interface AccountSnoozeProps { /** Unique snooze ID */ account_snooze_id: string; /** Associated account ID */ account_id: string; /** Number of days to snooze */ snooze_days: number; /** Snooze status */ status: 'active' | 'inactive'; /** Timestamp when snooze was created */ create_datetime: any; /** When the snooze ends (calculated server-side: now + snooze_days) */ end_datetime: any; /** Timestamp of last update */ last_update_datetime: any; } // ============================================================================ // Transactions // ============================================================================ /** * Payment transaction * * Represents a deposit (debit) or withdrawal (credit) transaction. */ export interface TransactionProps { /** Unique transaction ID */ transaction_id: string; /** Associated account ID */ account_id: string; /** Transaction direction: debit = deposit, credit = withdrawal */ transaction_type: 'debit' | 'credit'; /** Transaction description */ description: string; /** Currency code */ currency: 'USD'; /** Associated player ID */ player_id: string; /** Transaction amount */ amount: number; /** Billing address ID used for this transaction */ billing_address_id?: string; /** Whether an admin has reviewed this transaction */ reviewed?: boolean; /** Whether the transaction has an error */ is_error?: boolean; /** Error code from payment provider */ error_code?: string; /** Error description */ error_description?: string; /** Client-generated unique ID for idempotency */ be_client_id?: string; /** Redirect URL for external payment flows (Plaid, PayPal) */ redirect_url?: string; /** Whether this transaction requires admin review */ require_review?: boolean; /** Payment session ID */ session_id?: string; /** Card CVV (sent during creation, not persisted) */ cvv?: string; /** Populated transaction details */ transaction_details?: TransactionDetailProps[]; /** Player balance request ID (used for withdraw confirmation with auth-svc) */ player_balance_request_id?: string; /** External payment provider transaction ID */ external_id?: string | number; /** Transaction status */ status: 'redirect' | 'posted' | 'failed' | 'settled' | 'error' | 'chargeback' | 'pending' | 'cancelled'; /** Status from external payment provider */ external_status?: string; /** Estimated settlement datetime */ estimated_settle_datetime?: any; /** IP address of the request */ ip_address?: string; /** Legacy transaction ID from v1/v2 migration */ legacy_id?: string; /** Timestamp when transaction was created */ create_datetime: any; /** Timestamp of last update */ last_update_datetime: any; } /** * Transaction detail line item * * Individual amounts that make up a transaction (e.g. deposit amount, fees, chargebacks). */ export interface TransactionDetailProps { /** Unique transaction detail ID */ transaction_detail_id: string; /** Associated transaction ID */ transaction_id: string; /** Amount for this detail line */ amount: number; /** Action type for this detail */ action?: 'deposit' | 'withdraw' | 'chargeback' | 'wallet_purchase'; /** Fee type if this is a fee line */ fee_type?: 'processing' | 'shipping' | 'chargeback'; /** Description of this detail line */ description: string; /** Legacy detail ID from v1/v2 migration */ legacy_id?: string; /** Timestamp when detail was created */ create_datetime: any; /** Timestamp of last update */ last_update_datetime: any; } // ============================================================================ // Items & Orders // ============================================================================ /** * Size option for store items */ export interface SizeOptionProps { /** Size value */ size: 'xs' | 's' | 'm' | 'l' | 'xl' | 'xxl' | 'xxxl'; /** Display label */ label: string; /** Whether this size is in stock */ in_stock: boolean; } /** * Color option for store items */ export interface ColorOptionProps { /** Color hex value */ color: string; /** Display label */ label: string; /** Whether this color is in stock */ in_stock: boolean; } /** * Item image */ export interface ItemImageProps { /** Image URL */ url: string; /** Whether this is the default/primary image */ default: boolean; /** Optional color this image corresponds to */ color?: string; /** Image width in pixels */ width?: number; /** Image height in pixels */ height?: number; } /** * Item fee configuration * * Per-item fee definitions that can vary by account type. */ export interface ItemFeeProps { /** Unique item fee ID */ item_fee_id: string; /** Associated item ID */ item_id: string; /** Fee percentage (multiplied by amount) */ fee_pct: number; /** Fee description */ description: string; /** Fee status */ status: string; /** Account type this fee applies to */ account_type: string; /** Timestamp when fee was created */ create_datetime: any; /** Timestamp of last update */ last_update_datetime: any; } /** * Purchasable item (deposit, withdrawal, store product, subscription) * * Items define what can be purchased and the rules around the purchase * (fees, location restrictions, address requirements, etc). */ export interface ItemProps { /** Unique item ID */ item_id: string; /** Company that owns this item */ company_id: string; /** Item category */ type: 'store' | 'affiliate' | 'wallet'; /** Item name */ name: string; /** Associated fee definitions */ item_fees: ItemFeeProps[]; /** Item description */ description: string; /** Item value (separate from price, used for display) */ value?: number; /** Whether this creates a debit or credit transaction */ transaction_type: 'credit' | 'debit'; /** Catalog this item belongs to */ catalog_id?: string; /** Unique string identifier (e.g. "deposit", "withdraw") */ identifier?: string; /** Base price */ price: number; /** Available size options (store items) */ size_options?: SizeOptionProps[]; /** Available color options (store items) */ color_options?: ColorOptionProps[]; /** Whether the customer can edit the price/amount */ price_editable?: boolean; /** Whether this item requires location verification */ location_required?: boolean; /** Whether this item is restricted to legal jurisdictions */ location_restricted?: boolean; /** List of allowed location values */ locations_allowed?: string[]; /** Whether a shipping address is required */ shipping_address_required: boolean; /** Whether a billing address is required */ billing_address_required: boolean; /** Whether the BettorEdge internal wallet can be used to purchase */ wallet_allowed: boolean; /** Item images */ images: ItemImageProps[] | any[]; /** Item status */ status: string; /** Whether only debit transactions are allowed */ debit_only?: boolean; /** Whether fees should be skipped for this item */ no_fees?: boolean; /** Whether this item can be purchased on a recurring basis */ recurring_eligible?: boolean; /** Recurring frequency value */ recur_frequency?: number; /** Recurring frequency unit */ recur_frequency_unit?: 'days' | 'months' | 'weeks'; /** Next item ID in a recurring sequence */ recur_next_item_id?: string; /** Per-item processing fee rate (multiplied by amount) */ processing_fee?: number; /** Restrict which account types can purchase this item */ restricted_account_types?: string[]; /** Timestamp when item was created */ create_datetime: any; /** Timestamp of last update */ last_update_datetime: any; } /** * Item order (purchase record) * * Represents a purchase containing one or more items. * Used for deposits, withdrawals, store purchases, and subscriptions. */ export interface ItemOrderProps { /** Unique item order ID */ item_order_id: string; /** Ordered items with quantities and amounts */ items: { item_id: string; size?: SizeOptionProps; color?: ColorOptionProps; quantity: number; amount: number; }[]; /** Subtotal amount (before fees) */ amount: number; /** Associated transaction ID */ transaction_id?: string; /** Associated player ID */ player_id: string; /** External order ID (e.g. PayPal order ID) */ external_id?: string; /** Order status */ status: string; /** Primary fee label (e.g. "Transaction Fee") */ fee_1?: string; /** Primary fee amount */ fee_1_amount?: number; /** Secondary fee label */ fee_2?: string; /** Secondary fee amount */ fee_2_amount?: number; /** Associated recurring order ID */ recurring_order_id?: string; /** Whether only debit transactions are allowed */ debit_only?: boolean; /** Geographic region for the order */ region: string; /** Order category */ type: 'wallet' | 'store' | 'affiliate'; /** Location data (coordinates, jurisdiction) */ location: any; /** Shipping status for physical items */ shipping_status?: 'not_shipped' | 'in_transit' | 'delivered'; /** Shipping address ID */ shipping_address_id?: string; /** Tracking URL for shipments */ tracking_url?: string; /** Total amount (subtotal + fees) */ total_amount: number; /** Order description */ description: string; /** Timestamp when order was created */ create_datetime: any; /** Timestamp of last update */ last_update_datetime: any; } // ============================================================================ // Account Actions (client-side helper type) // ============================================================================ /** * Account action menu option * * Used by the wallet UI to display available actions for an account. */ export interface AccountActionProps { /** Unique action ID */ action_id: string; /** Action type identifier */ action_type: string; /** Display title */ action_title: string; /** Display description */ action_description: string; }