Pular para o conteúdo principal

computeChampionshipTopScorers

@raizfc/contracts


@raizfc/contracts / computeChampionshipTopScorers

Function: computeChampionshipTopScorers()

computeChampionshipTopScorers(matches): readonly Readonly<{ assists: number; displayName: string; goals: number; position: number; publicRoute?: string; teamName: string; }>[]

Defined in: championship/championship-standings.dto.ts:129

Aggregates type: 'goal' events by scorer (primaryPlayer) across every validated match supplied, sorted by goals desc then name asc. Assists count times the player appears as secondaryPlayer on a goal event — same "assist" definition toPublicReportRow (match domain) already uses per match, just summed across the edition here.

Parameters

matches

readonly Readonly<{ awayScore: number; awayTeam: PublicTeamSummaryDto; events: readonly Readonly<{ description: string; id: string; minuteLabel: string; period: "administrative" | "first_half" | "second_half" | "extra_time" | "penalties"; primaryPlayer?: Readonly<{ displayName: string; playerId?: string; publicRoute?: string; }>; secondaryPlayer?: Readonly<{ displayName: string; playerId?: string; publicRoute?: string; }>; teamId?: string; type: PublicMatchEventType; }>[]; groupName?: string; homeScore: number; homeTeam: PublicTeamSummaryDto; matchId: string; }>[]

Returns

readonly Readonly<{ assists: number; displayName: string; goals: number; position: number; publicRoute?: string; teamName: string; }>[]