package league

import (
	"context"

	"github.com/SamuelTariku/FortuneBet-Backend/internal/domain"
	"github.com/SamuelTariku/FortuneBet-Backend/internal/repository"
)

type service struct {
	store *repository.Store
}

func New(store *repository.Store) Service {
	return &service{
		store: store,
	}
}

func (s *service) SaveLeague(ctx context.Context, l domain.League) error {
	return s.store.SaveLeague(ctx, l)
}

func (s *service) GetAllLeagues(ctx context.Context, filter domain.LeagueFilter) ([]domain.League, error) {
	return s.store.GetAllLeagues(ctx, filter)
}

func (s *service) SetLeagueActive(ctx context.Context, leagueId int64, isActive bool) error {
	return s.store.SetLeagueActive(ctx, leagueId, isActive)
}

func (s *service) UpdateLeague(ctx context.Context, league domain.UpdateLeague) error {
	return s.store.UpdateLeague(ctx, league)
}
