package site

import (
	"go.uber.org/zap"

	siteusecase "codeberg.org/mapleopentech/monorepo/cloud/maplepress-backend/internal/usecase/site"
)

// ProvideCreateSiteService creates a new CreateSiteService for dependency injection
func ProvideCreateSiteService(
	validateDomainUC *siteusecase.ValidateDomainUseCase,
	generateAPIKeyUC *siteusecase.GenerateAPIKeyUseCase,
	generateVerifyTokenUC *siteusecase.GenerateVerificationTokenUseCase,
	createSiteEntityUC *siteusecase.CreateSiteEntityUseCase,
	saveSiteToRepoUC *siteusecase.SaveSiteToRepoUseCase,
	logger *zap.Logger,
) CreateSiteService {
	return NewCreateSiteService(
		validateDomainUC,
		generateAPIKeyUC,
		generateVerifyTokenUC,
		createSiteEntityUC,
		saveSiteToRepoUC,
		logger,
	)
}

// ProvideGetSiteService creates a new GetSiteService for dependency injection
func ProvideGetSiteService(
	getUC *siteusecase.GetSiteUseCase,
	logger *zap.Logger,
) GetSiteService {
	return NewGetSiteService(getUC, logger)
}

// ProvideListSitesService creates a new ListSitesService for dependency injection
func ProvideListSitesService(
	listUC *siteusecase.ListSitesUseCase,
	logger *zap.Logger,
) ListSitesService {
	return NewListSitesService(listUC, logger)
}

// ProvideDeleteSiteService creates a new DeleteSiteService for dependency injection
func ProvideDeleteSiteService(
	validateSiteForDeletionUC *siteusecase.ValidateSiteForDeletionUseCase,
	deleteSiteFromRepoUC *siteusecase.DeleteSiteFromRepoUseCase,
	logger *zap.Logger,
) DeleteSiteService {
	return NewDeleteSiteService(
		validateSiteForDeletionUC,
		deleteSiteFromRepoUC,
		logger,
	)
}

// ProvideRotateAPIKeyService creates a new RotateAPIKeyService for dependency injection
func ProvideRotateAPIKeyService(
	getSiteUC *siteusecase.GetSiteUseCase,
	generateAPIKeyUC *siteusecase.GenerateAPIKeyUseCase,
	updateSiteAPIKeyUC *siteusecase.UpdateSiteAPIKeyUseCase,
	updateSiteAPIKeyToRepoUC *siteusecase.UpdateSiteAPIKeyToRepoUseCase,
	logger *zap.Logger,
) RotateAPIKeyService {
	return NewRotateAPIKeyService(
		getSiteUC,
		generateAPIKeyUC,
		updateSiteAPIKeyUC,
		updateSiteAPIKeyToRepoUC,
		logger,
	)
}

// ProvideAuthenticateAPIKeyService creates a new AuthenticateAPIKeyService for dependency injection
func ProvideAuthenticateAPIKeyService(
	authenticateUC *siteusecase.AuthenticateAPIKeyUseCase,
	logger *zap.Logger,
) AuthenticateAPIKeyService {
	return NewAuthenticateAPIKeyService(authenticateUC, logger)
}
