/** * Bracket Types * * Types related to bracket competitions, player brackets, and pick management */ import type { BracketProps, BracketGroupProps, BracketRoundProps, RoundEventProps } from './contests.types'; /** * Player bracket entry * * Represents a player's bracket submission for a bracket tournament */ export interface PlayerBracketProps { /** Unique player bracket identifier */ player_bracket_id: string; /** Parent bracket ID */ bracket_id: string; /** Player who owns this bracket */ player_id: string; /** Display name for this bracket entry */ bracket_name: string; /** Completion percentage (0–1) */ completion_pct: number; /** Completion status label */ completion_status: string; /** Champion pick ID */ champion_id?: string; /** Champion pick type (team/athlete) */ champion_id_type?: string; /** Current bracket status */ status: string; /** Array of picks for this bracket */ picks?: PlayerBracketPickProps[]; /** Timestamp when created */ create_datetime: any; /** Timestamp of last update */ last_update_datetime: any; } /** * Player bracket pick * * Individual pick within a player's bracket */ export interface PlayerBracketPickProps { /** Unique pick identifier */ player_bracket_pick_id: string; /** Parent player bracket ID */ player_bracket_id: string; /** Parent bracket ID */ bracket_id: string; /** Round event this pick corresponds to */ round_event_id: string; /** Side picked ('away' or 'home') */ pick_side: 'away' | 'home'; /** ID of the picked team/athlete */ pick_side_id: string; /** Type of the picked side (team/athlete) */ pick_side_type: string; /** Seed number of the pick */ pick_seed?: number; /** Whether this was an underdog pick */ underdog_pick: boolean; /** Sequence number within the event */ event_sequence: number; /** Result of the pick */ result_ind?: 'win' | 'lose'; /** Points awarded for this pick */ points?: number; /** Current pick status */ status: string; /** Timestamp when created */ create_datetime?: any; /** Timestamp of last update */ last_update_datetime?: any; } /** * Bracket competition * * Competition wrapper that groups player brackets for scoring and prizes */ export interface BracketCompetitionProps { /** Unique bracket competition identifier */ bracket_competition_id: string; /** Parent bracket ID */ bracket_id: string; /** Competition display name */ competition_name: string; /** Scheduled start time */ scheduled_datetime: any; /** Current competition status */ status: string; /** Scoring system used */ scoring_system: string; /** Market type */ market_type: 'FOR_MONEY' | 'FREE'; /** Buy-in amount */ buy_in: number; /** Maximum total brackets allowed */ max_brackets: number; /** Maximum brackets per player */ max_brackets_per_player: number; /** Number of tickets sold */ tickets_sold: number; /** Whether competition is invite-only */ invite_only: boolean; /** Optional competition invite code */ competition_code?: string; /** Admin player ID */ admin_id: string; /** Optional competition image */ image?: { url: string }; /** Optional scoring rules */ scoring_rules?: BracketCompetitionScoringRuleProps[]; /** Timestamp when created */ create_datetime?: any; /** Timestamp of last update */ last_update_datetime?: any; /** Current number of entrants */ current_entrants?: number; /** Competition result type ID */ competition_result_type_id?: string; /** Competition description */ competition_description?: string; /** Total ticket revenue */ ticket_revenue?: number; /** Guaranteed payout amount */ guaranteed_payout?: number; /** Company ID if company-owned */ company_id?: string; /** Group ID */ group_id?: string; } /** * Competition player bracket entry * * Represents a player bracket's entry in a competition with scoring and placement */ export interface CompetitionPlayerBracketProps { /** Unique competition player bracket identifier */ competition_player_bracket_id: string; /** Parent bracket competition ID */ bracket_competition_id: string; /** Player bracket ID */ player_bracket_id: string; /** Player ID */ player_id: string; /** Current entry status */ status: string; /** Current placement in the competition */ place?: number; /** Points scored so far */ points_scored: number; /** Maximum possible points remaining */ possible_points: number; /** Winnings amount */ winnings?: number; /** Whether results have been processed */ processed: boolean; /** Timestamp when created */ create_datetime?: any; /** Timestamp of last update */ last_update_datetime?: any; } /** * Bracket competition scoring rule * * Defines points awarded for correct picks in each round */ export interface BracketCompetitionScoringRuleProps { /** Unique scoring rule identifier */ bracket_competition_scoring_rule_id: string; /** Parent bracket competition ID */ bracket_competition_id: string; /** Round number this rule applies to */ round_number: number; /** Points awarded for a correct pick */ win_points: number; /** Bonus points for picking an underdog */ underdog_bonus: number | boolean; /** Multiplier for underdog picks */ underdog_multiplier: number; /** Timestamp when created */ create_datetime?: any; /** Timestamp of last update */ last_update_datetime?: any; } /** * Bracket pick statistics * * Aggregate pick statistics for a round event showing pick popularity */ export interface BracketPickStatProps { /** Parent bracket ID */ bracket_id: string; /** Round event ID */ round_event_id: string; /** Type of the picked side */ pick_side_type: string; /** ID of the picked side */ pick_side_id: string; /** Total number of picks for this side */ pick_count: number; } /** * Full bracket data * * Composite type containing the complete bracket structure */ export interface BracketFullDataProps { /** Bracket metadata */ bracket: BracketProps; /** Regional groups within the bracket */ bracket_groups: BracketGroupProps[]; /** Rounds within the bracket */ bracket_rounds: BracketRoundProps[]; /** Individual matchups within rounds */ round_events: RoundEventProps[]; }