// codeberg.org/mapleopentech/monorepo/cloud/maplefile-backend/internal/interface/http/tag/provider.go
package tag

import (
	"go.uber.org/zap"

	"codeberg.org/mapleopentech/monorepo/cloud/maplefile-backend/config"
	"codeberg.org/mapleopentech/monorepo/cloud/maplefile-backend/internal/interface/http/middleware"
	svc_tag "codeberg.org/mapleopentech/monorepo/cloud/maplefile-backend/internal/service/tag"
	uc_tag "codeberg.org/mapleopentech/monorepo/cloud/maplefile-backend/internal/usecase/tag"
)

// Wire providers for tag HTTP handlers

func ProvideCreateTagHTTPHandler(
	cfg *config.Configuration,
	logger *zap.Logger,
	service *svc_tag.TagService,
	mw middleware.Middleware,
) *CreateTagHTTPHandler {
	return NewCreateTagHTTPHandler(cfg, logger, service, mw)
}

func ProvideListTagsHTTPHandler(
	cfg *config.Configuration,
	logger *zap.Logger,
	service *svc_tag.TagService,
	mw middleware.Middleware,
) *ListTagsHTTPHandler {
	return NewListTagsHTTPHandler(cfg, logger, service, mw)
}

func ProvideGetTagHTTPHandler(
	cfg *config.Configuration,
	logger *zap.Logger,
	service *svc_tag.TagService,
	mw middleware.Middleware,
) *GetTagHTTPHandler {
	return NewGetTagHTTPHandler(cfg, logger, service, mw)
}

func ProvideUpdateTagHTTPHandler(
	cfg *config.Configuration,
	logger *zap.Logger,
	service *svc_tag.TagService,
	mw middleware.Middleware,
) *UpdateTagHTTPHandler {
	return NewUpdateTagHTTPHandler(cfg, logger, service, mw)
}

func ProvideDeleteTagHTTPHandler(
	cfg *config.Configuration,
	logger *zap.Logger,
	service *svc_tag.TagService,
	mw middleware.Middleware,
) *DeleteTagHTTPHandler {
	return NewDeleteTagHTTPHandler(cfg, logger, service, mw)
}

func ProvideAssignTagHTTPHandler(
	cfg *config.Configuration,
	logger *zap.Logger,
	service *svc_tag.TagService,
	mw middleware.Middleware,
) *AssignTagHTTPHandler {
	return NewAssignTagHTTPHandler(cfg, logger, service, mw)
}

func ProvideUnassignTagHTTPHandler(
	cfg *config.Configuration,
	logger *zap.Logger,
	service *svc_tag.TagService,
	mw middleware.Middleware,
) *UnassignTagHTTPHandler {
	return NewUnassignTagHTTPHandler(cfg, logger, service, mw)
}

func ProvideGetTagsForCollectionHTTPHandler(
	cfg *config.Configuration,
	logger *zap.Logger,
	service *svc_tag.TagService,
	mw middleware.Middleware,
) *GetTagsForCollectionHTTPHandler {
	return NewGetTagsForCollectionHTTPHandler(cfg, logger, service, mw)
}

func ProvideGetTagsForFileHTTPHandler(
	cfg *config.Configuration,
	logger *zap.Logger,
	service *svc_tag.TagService,
	mw middleware.Middleware,
) *GetTagsForFileHTTPHandler {
	return NewGetTagsForFileHTTPHandler(cfg, logger, service, mw)
}

func ProvideListCollectionsByTagHandler(
	useCase *uc_tag.ListCollectionsByTagUseCase,
	logger *zap.Logger,
) *ListCollectionsByTagHandler {
	return NewListCollectionsByTagHandler(useCase, logger)
}

func ProvideListFilesByTagHandler(
	useCase *uc_tag.ListFilesByTagUseCase,
	logger *zap.Logger,
) *ListFilesByTagHandler {
	return NewListFilesByTagHandler(useCase, logger)
}

func ProvideSearchByTagsHandler(
	service *svc_tag.SearchByTagsService,
	logger *zap.Logger,
	mw middleware.Middleware,
) *SearchByTagsHandler {
	return NewSearchByTagsHandler(service, logger, mw)
}
