package handlers

import (
	"log/slog"

	"github.com/SamuelTariku/FortuneBet-Backend/internal/config"
	"github.com/SamuelTariku/FortuneBet-Backend/internal/services/authentication"
	"github.com/SamuelTariku/FortuneBet-Backend/internal/services/bet"
	"github.com/SamuelTariku/FortuneBet-Backend/internal/services/branch"
	"github.com/SamuelTariku/FortuneBet-Backend/internal/services/chapa"
	"github.com/SamuelTariku/FortuneBet-Backend/internal/services/company"
	"github.com/SamuelTariku/FortuneBet-Backend/internal/services/currency"
	"github.com/SamuelTariku/FortuneBet-Backend/internal/services/event"
	"github.com/SamuelTariku/FortuneBet-Backend/internal/services/league"
	notificationservice "github.com/SamuelTariku/FortuneBet-Backend/internal/services/notfication"
	"github.com/SamuelTariku/FortuneBet-Backend/internal/services/odds"
	"github.com/SamuelTariku/FortuneBet-Backend/internal/services/recommendation"
	referralservice "github.com/SamuelTariku/FortuneBet-Backend/internal/services/referal"
	"github.com/SamuelTariku/FortuneBet-Backend/internal/services/report"
	"github.com/SamuelTariku/FortuneBet-Backend/internal/services/result"
	"github.com/SamuelTariku/FortuneBet-Backend/internal/services/ticket"
	"github.com/SamuelTariku/FortuneBet-Backend/internal/services/transaction"
	"github.com/SamuelTariku/FortuneBet-Backend/internal/services/user"
	virtualgameservice "github.com/SamuelTariku/FortuneBet-Backend/internal/services/virtualGame"
	alea "github.com/SamuelTariku/FortuneBet-Backend/internal/services/virtualGame/Alea"
	"github.com/SamuelTariku/FortuneBet-Backend/internal/services/virtualGame/veli"
	"github.com/SamuelTariku/FortuneBet-Backend/internal/services/wallet"
	jwtutil "github.com/SamuelTariku/FortuneBet-Backend/internal/web_server/jwt"
	customvalidator "github.com/SamuelTariku/FortuneBet-Backend/internal/web_server/validator"
)

type Handler struct {
	currSvc            *currency.Service
	logger             *slog.Logger
	notificationSvc    *notificationservice.Service
	userSvc            *user.Service
	referralSvc        referralservice.ReferralStore
	reportSvc          report.ReportStore
	chapaSvc           *chapa.Service
	walletSvc          *wallet.Service
	transactionSvc     *transaction.Service
	ticketSvc          *ticket.Service
	betSvc             *bet.Service
	branchSvc          *branch.Service
	companySvc         *company.Service
	prematchSvc        *odds.ServiceImpl
	eventSvc           event.Service
	leagueSvc          league.Service
	virtualGameSvc     virtualgameservice.VirtualGameService
	aleaVirtualGameSvc alea.AleaVirtualGameService
	veliVirtualGameSvc veli.VeliVirtualGameService
	recommendationSvc  recommendation.RecommendationService
	authSvc            *authentication.Service
	resultSvc          result.Service
	jwtConfig          jwtutil.JwtConfig
	validator          *customvalidator.CustomValidator
	Cfg                *config.Config
}

func New(
	currSvc *currency.Service,
	logger *slog.Logger,
	notificationSvc *notificationservice.Service,
	validator *customvalidator.CustomValidator,
	reportSvc report.ReportStore,
	chapaSvc *chapa.Service,
	walletSvc *wallet.Service,
	referralSvc referralservice.ReferralStore,
	virtualGameSvc virtualgameservice.VirtualGameService,
	aleaVirtualGameSvc alea.AleaVirtualGameService,
	veliVirtualGameSvc veli.VeliVirtualGameService,
	recommendationSvc recommendation.RecommendationService,
	userSvc *user.Service,
	transactionSvc *transaction.Service,
	ticketSvc *ticket.Service,
	betSvc *bet.Service,
	authSvc *authentication.Service,
	jwtConfig jwtutil.JwtConfig,
	branchSvc *branch.Service,
	companySvc *company.Service,
	prematchSvc *odds.ServiceImpl,
	eventSvc event.Service,
	leagueSvc league.Service,
	resultSvc result.Service,
	cfg *config.Config,
) *Handler {
	return &Handler{
		currSvc:            currSvc,
		logger:             logger,
		notificationSvc:    notificationSvc,
		reportSvc:          reportSvc,
		chapaSvc:           chapaSvc,
		walletSvc:          walletSvc,
		referralSvc:        referralSvc,
		validator:          validator,
		userSvc:            userSvc,
		transactionSvc:     transactionSvc,
		ticketSvc:          ticketSvc,
		betSvc:             betSvc,
		branchSvc:          branchSvc,
		companySvc:         companySvc,
		prematchSvc:        prematchSvc,
		eventSvc:           eventSvc,
		leagueSvc:          leagueSvc,
		virtualGameSvc:     virtualGameSvc,
		aleaVirtualGameSvc: aleaVirtualGameSvc,
		veliVirtualGameSvc: veliVirtualGameSvc,
		recommendationSvc:  recommendationSvc,
		authSvc:            authSvc,
		resultSvc:          resultSvc,
		jwtConfig:          jwtConfig,
		Cfg:                cfg,
	}
}
