Pular para o conteúdo principal

shufflePublicSponsors

@raizfc/contracts


@raizfc/contracts / shufflePublicSponsors

Function: shufflePublicSponsors()

shufflePublicSponsors(items): readonly Readonly<{ href?: string; id: string; logo?: Readonly<{ alt?: string; height?: number; id: string; url: string; width?: number; }>; name: string; }>[]

Defined in: sponsor/sponsor.dto.ts:167

IS-MVP-10.2 (SPEC-DOMAIN-SPONSOR-001 "Exibição em grade, ordem randômica por sessão/request"; "Ordem é randômica sem favorecer pagamento maior") — the stored public projection (PublicTeamResponse.sponsors/PublicTorcidaResponse.sponsors) keeps a stable write-time order (most recently activated first), but every public read must reshuffle it so no sponsor is consistently first. Called once per response by both the real API mappers and the mocks handlers (never persisted), so the same three active sponsors can render in a different order on the next request. Plain Math.random() Fisher-Yates is intentional here — unlike championship-fixture-generator.ts#seededShuffle, there is no replay/idempotency requirement to keep this pure/reproducible, only fairness.

Parameters

items

readonly Readonly<{ href?: string; id: string; logo?: Readonly<{ alt?: string; height?: number; id: string; url: string; width?: number; }>; name: string; }>[]

Returns

readonly Readonly<{ href?: string; id: string; logo?: Readonly<{ alt?: string; height?: number; id: string; url: string; width?: number; }>; name: string; }>[]