Pular para o conteúdo principal

computeTeamRanking

@raizfc/contracts


@raizfc/contracts / computeTeamRanking

Function: computeTeamRanking()

computeTeamRanking(entities, matches): readonly Readonly<{ badges: readonly "provisional"[]; crestUrl?: string; draws?: number; entityId: string; entityName: string; entityRoute: string; goalDifference?: number; losses?: number; matchesPlayed?: number; position: number; score: number; status: RankingRowStatus; wins?: number; }>[]

Defined in: ranking/ranking-formula.ts:52

Aggregates points/aproveitamento, match weight (championship > friendly), opponent strength (opponent's own average points-per-match in the same dataset) and regularity into a single 0-100 score. Provisional (matchesPlayed < 3) rows still get a score — sorted with the same tie-break chain as confirmed rows — but are flagged, never hidden, per "Menos de três jogos: marcar Provisório" (não "excluir").

Parameters

entities

readonly Readonly<{ crestUrl?: string; teamId: string; teamName: string; teamRoute: string; }>[]

matches

readonly Readonly<{ championshipId?: string; opponentScore: number; opponentTeamId: string; teamId: string; teamScore: number; }>[]

Returns

readonly Readonly<{ badges: readonly "provisional"[]; crestUrl?: string; draws?: number; entityId: string; entityName: string; entityRoute: string; goalDifference?: number; losses?: number; matchesPlayed?: number; position: number; score: number; status: RankingRowStatus; wins?: number; }>[]