generated from VLADIMIR/template
up
This commit is contained in:
@@ -19,20 +19,39 @@ import (
|
||||
|
||||
// TeamService handles team operations.
|
||||
type TeamService struct {
|
||||
gamesRepo *games_repo.GamesRepo
|
||||
teamsRepo *teams_repo.TeamsRepo
|
||||
gamesRepo ITeamGamesRepository
|
||||
teamsRepo ITeamsRepository
|
||||
passwordGenerator password_generator.IPasswordGenerator
|
||||
appBaseURL string
|
||||
emailSender email_sender.IEmailSender
|
||||
venueMode bool
|
||||
receiptPrinter IReceiptPrinter
|
||||
}
|
||||
|
||||
// ITeamGamesRepository reads games used by team operations.
|
||||
type ITeamGamesRepository interface {
|
||||
GetGameByID(context.Context, int) (*repos.Game, error)
|
||||
}
|
||||
|
||||
// ITeamsRepository stores teams used by this service.
|
||||
type ITeamsRepository interface {
|
||||
GetTeamByID(context.Context, string) (*repos.Team, error)
|
||||
GetActiveTeamsByGameID(context.Context, int) ([]*repos.Team, error)
|
||||
AddTeamWithParticipation(context.Context, int, int, string, string, string, int32, bool) (string, error)
|
||||
UpdateTeam(context.Context, string, string) error
|
||||
DeleteTeam(context.Context, string) error
|
||||
RegisterTeamWithParticipation(context.Context, int, string, string, string, int32, string, bool) (string, error)
|
||||
}
|
||||
|
||||
// NewTeamService creates a team service.
|
||||
func NewTeamService(
|
||||
gamesRepo *games_repo.GamesRepo,
|
||||
teamsRepo *teams_repo.TeamsRepo,
|
||||
gamesRepo ITeamGamesRepository,
|
||||
teamsRepo ITeamsRepository,
|
||||
passwordGenerator password_generator.IPasswordGenerator,
|
||||
appBaseURL string,
|
||||
emailSender email_sender.IEmailSender,
|
||||
venueMode bool,
|
||||
receiptPrinter IReceiptPrinter,
|
||||
) *TeamService {
|
||||
return &TeamService{
|
||||
gamesRepo: gamesRepo,
|
||||
@@ -40,6 +59,8 @@ func NewTeamService(
|
||||
passwordGenerator: passwordGenerator,
|
||||
appBaseURL: appBaseURL,
|
||||
emailSender: emailSender,
|
||||
venueMode: venueMode,
|
||||
receiptPrinter: receiptPrinter,
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user