team

package
v0.0.0-...-5888283 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 4, 2024 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Handler

type Handler interface {
	Routes() chi.Router
	List(w http.ResponseWriter, r *http.Request)
	Get(w http.ResponseWriter, r *http.Request)
	UpdateTeams(w http.ResponseWriter, r *http.Request)
}

func NewHandler

func NewHandler(logger *slog.Logger, teamService Service) Handler

type Service

type Service interface {
	Get(ctx context.Context, teamID string) (api.Team, error)
	ListTeams(ctx context.Context) ([]api.Team, error)
	UpdateTeamsForSeason(ctx context.Context, seasonStartYear int) ([]api.Team, error)
	UpdateFranchiseTeams(ctx context.Context, franchises []nba.Franchise) ([]api.Team, error)
	EnsureTeamsExistForLeague(ctx context.Context, logger *slog.Logger, nbaLeagueID string, nbaTeamIDs []int) error
}

func NewService

func NewService(teamStore Store, teamSeasonService team_season.Service, nbaClient nba.Client) Service

type Store

type Store interface {
	GetTeamWithID(ctx context.Context, teamID string) (api.Team, error)
	GetTeamsWithIDs(ctx context.Context, ids []uuid.UUID) ([]api.Team, error)
	GetTeamsWithNBAIDs(ctx context.Context, ids []int) ([]api.Team, error)
	ListTeams(ctx context.Context) ([]api.Team, error)
	UpdateTeams(ctx context.Context, teams []TeamUpdate) ([]api.Team, error)
	NBATeamIDMappings(ctx context.Context) (map[string]string, error)
}

type TeamUpdate

type TeamUpdate struct {
	Name          string
	Nickname      string
	City          string
	AlternateCity *string
	NBAURLName    *string
	NBAShortName  *string
	NBATeamID     int
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL