season

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: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Season

type Season struct {
	LeagueID uuid.UUID
}

type SeasonUpdate

type SeasonUpdate struct {
	LeagueID uuid.UUID
}

type SeasonWeek

type SeasonWeek struct {
	ID        uuid.UUID
	CreatedAt time.Time
	UpdatedAt sql.NullTime
	SeasonID  uuid.UUID
	StartDate time.Time
	EndDate   time.Time
}

type SeasonWeekUpdate

type SeasonWeekUpdate struct {
	SeasonStartYear int
	StartDate       time.Time
	EndDate         time.Time
}

type Service

type Service interface {
	GetCurrentSeasonStartYear(ctx context.Context) (int, error)
	UpdateSeasonForLeague(ctx context.Context, leagueID string, seasonStartYear int) (string, error)
	UpdateSeasonWeeks(ctx context.Context) ([]SeasonWeek, error)
}

func NewService

func NewService(seasonStore Store, nbaClient nba.Client) Service

type Store

type Store interface {
	UpdateSeasons(ctx context.Context, seasonUpdates []SeasonUpdate) ([]Season, error)
	UpdateSeasonWeeks(ctx context.Context, seasonWeekUpdates []SeasonWeekUpdate) ([]SeasonWeek, error)
}

Jump to

Keyboard shortcuts

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