# All files / src/types disagreement.types.ts

0% Statements 0/18
100% Branches 1/1
100% Functions 1/1
0% Lines 0/18

Press n or j to go to the next uncovered block, b, p or k for the previous block.

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57

     export interface OutlierBookmaker {
      bookmaker: string;
      line: number;
      deviation: number;
    }

    export interface BestValue {
      side: 'home' | 'away' | 'over' | 'under';
      bookmaker: string;
      line: number;
      impliedProb: number;
    }

    export interface ConsensusResult {
      gameId: string;
      marketType: string;
      consensusLine: number;
      standardDeviation: number;
      outlierBookmakers: OutlierBookmaker[];
      bookmakerCount: number;
      disagreementScore: number;
      bestValue: BestValue;
    }

    export interface HighDisagreementGame {
      gameId: string;
      homeTeamName: string;
      awayTeamName: string;
      commenceTime: string;
      sportKey: string;
      consensus: ConsensusResult[];
      maxDisagreementScore: number;
    }

    export type DisagreementCategory = 'low' | 'medium' | 'high' | 'extreme';

    export function getDisagreementCategory(score: number): DisagreementCategory {
      if (score >= 81) return 'extreme';
      if (score >= 61) return 'high';
      if (score >= 31) return 'medium';
      return 'low';
    }

    export function getDisagreementColor(score: number): string {
      if (score >= 81) return 'text-red-500';
      if (score >= 61) return 'text-orange-500';
      if (score >= 31) return 'text-yellow-500';
      return 'text-green-500';
    }

    export function getDisagreementBadgeColor(score: number): string {
      if (score >= 81) return 'bg-red-100 text-red-800 dark:bg-red-900/30 dark:text-red-400';
      if (score >= 61) return 'bg-orange-100 text-orange-800 dark:bg-orange-900/30 dark:text-orange-400';
      if (score >= 31) return 'bg-yellow-100 text-yellow-800 dark:bg-yellow-900/30 dark:text-yellow-400';
      return 'bg-green-100 text-green-800 dark:bg-green-900/30 dark:text-green-400';
    }