Skip to main content

Module fantasy_teams

Module fantasy_teams 

Source

Modules§

contest_entries
Pure view assembly for the team detail page: a fantasy team’s scored contests ordered best-first, top-10 flags, and the score to beat.
open_contests
Pure view assembly for the owner’s open-contests section on the team detail page: contests still worth acting on, soonest first.
store

Structs§

CurrentTeam
The current user’s team in the current league. A guard for team-scoped pages: absence rejects with Unauthorized. Onboarding a user who has no team is the bootstrap middleware’s job — it redirects to /teams/new before a team-scoped handler runs.
FantasyTeam
FantasyTeamId
A fantasy team’s id as an opaque token: typed so it cannot be confused with other ids, open because the type distinction is the protection.
LeagueTeam
A league’s fantasy team with its logo joined in — the roster listing, without the columns only the team’s own pages need.
MaybeTeam
The signed-in user’s team in the resolved league, read from the request extension cached by the leagues::resolve middleware. None when signed out, teamless in the league, or when the middleware did not run.
NoTeam
OwnedTeam
The current user’s team, when it is the team named by the route’s {id}. Any other id — including a viewer with no team in the resolved league, such as the site admin visiting another league — is NotFound.
TeamCreator

Functions§

monogram
Up to two initials from a fantasy team name, for the logo fallback.
router
team_creation_target
Resolve where user may create a team, and the invite consumed by doing so (None invite for the site admin’s commissioner bootstrap). The single source of truth for team-creation authorization, shared by the bootstrap guard and the TeamCreator extractor.