Pular para o conteúdo principal

matchPendingActionFor

@raizfc/contracts


@raizfc/contracts / matchPendingActionFor

Function: matchPendingActionFor()

matchPendingActionFor(match, authority): Readonly<{ deadline?: string; kind: MatchPendingActionKind; }> | undefined

Defined in: match/match-status.ts:161

IS-MVP-06.5 "Pending Section" (SPEC-UX-GAMES-001): computes whether a specific viewer has an actionable pendency on this match — reporting a missing score (waiting_result) or responding to a reported one as the contraparte (waiting_validation, "validar ou contestar", merged into one item since both actions share the same deadline/eligible actor). Deliberately takes authority (already resolved per-viewer by the caller, same shape buildMatchPermissions uses) rather than a raw resultReportedByTeamId the caller could echo back to an unauthorized viewer — "quem precisa agir" is management-only per SPEC-UX-PUBLIC-MATCH-001 ("Validation Banner"), so this function's output must never be attached to an anonymous or unauthorized request; pure/shared so mocks and the real API compute the exact same pendency, single source of truth like MATCH_TRANSITIONS. Guest confirmation pendencies are out of scope here — different actor (jogador, not gestor), already served by the Player Panel (EP-MVP-05.3).

Parameters

match

Readonly<{ awayTeamId: ID; homeTeamId: ID; resultReportedAt?: ISODateString; resultReportedByTeamId?: ID; status: MatchStatus; }>

authority

Readonly<{ managesAway: boolean; managesHome: boolean; }>

Returns

Readonly<{ deadline?: string; kind: MatchPendingActionKind; }> | undefined