package collection

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_collection "codeberg.org/mapleopentech/monorepo/cloud/maplefile-backend/internal/service/collection"
)

// Wire providers for collection HTTP handlers

func ProvideCreateCollectionHTTPHandler(
	cfg *config.Configuration,
	logger *zap.Logger,
	service svc_collection.CreateCollectionService,
	mw middleware.Middleware,
) *CreateCollectionHTTPHandler {
	return NewCreateCollectionHTTPHandler(cfg, logger, service, mw)
}

func ProvideGetCollectionHTTPHandler(
	cfg *config.Configuration,
	logger *zap.Logger,
	service svc_collection.GetCollectionService,
	mw middleware.Middleware,
) *GetCollectionHTTPHandler {
	return NewGetCollectionHTTPHandler(cfg, logger, service, mw)
}

func ProvideListUserCollectionsHTTPHandler(
	cfg *config.Configuration,
	logger *zap.Logger,
	service svc_collection.ListUserCollectionsService,
	mw middleware.Middleware,
) *ListUserCollectionsHTTPHandler {
	return NewListUserCollectionsHTTPHandler(cfg, logger, service, mw)
}

func ProvideUpdateCollectionHTTPHandler(
	cfg *config.Configuration,
	logger *zap.Logger,
	service svc_collection.UpdateCollectionService,
	mw middleware.Middleware,
) *UpdateCollectionHTTPHandler {
	return NewUpdateCollectionHTTPHandler(cfg, logger, service, mw)
}

func ProvideSoftDeleteCollectionHTTPHandler(
	cfg *config.Configuration,
	logger *zap.Logger,
	service svc_collection.SoftDeleteCollectionService,
	mw middleware.Middleware,
) *SoftDeleteCollectionHTTPHandler {
	return NewSoftDeleteCollectionHTTPHandler(cfg, logger, service, mw)
}

func ProvideArchiveCollectionHTTPHandler(
	cfg *config.Configuration,
	logger *zap.Logger,
	service svc_collection.ArchiveCollectionService,
	mw middleware.Middleware,
) *ArchiveCollectionHTTPHandler {
	return NewArchiveCollectionHTTPHandler(cfg, logger, service, mw)
}

func ProvideRestoreCollectionHTTPHandler(
	cfg *config.Configuration,
	logger *zap.Logger,
	service svc_collection.RestoreCollectionService,
	mw middleware.Middleware,
) *RestoreCollectionHTTPHandler {
	return NewRestoreCollectionHTTPHandler(cfg, logger, service, mw)
}

func ProvideListSharedCollectionsHTTPHandler(
	cfg *config.Configuration,
	logger *zap.Logger,
	service svc_collection.ListSharedCollectionsService,
	mw middleware.Middleware,
) *ListSharedCollectionsHTTPHandler {
	return NewListSharedCollectionsHTTPHandler(cfg, logger, service, mw)
}

func ProvideFindRootCollectionsHTTPHandler(
	cfg *config.Configuration,
	logger *zap.Logger,
	service svc_collection.FindRootCollectionsService,
	mw middleware.Middleware,
) *FindRootCollectionsHTTPHandler {
	return NewFindRootCollectionsHTTPHandler(cfg, logger, service, mw)
}

func ProvideFindCollectionsByParentHTTPHandler(
	cfg *config.Configuration,
	logger *zap.Logger,
	service svc_collection.FindCollectionsByParentService,
	mw middleware.Middleware,
) *FindCollectionsByParentHTTPHandler {
	return NewFindCollectionsByParentHTTPHandler(cfg, logger, service, mw)
}

func ProvideCollectionSyncHTTPHandler(
	cfg *config.Configuration,
	logger *zap.Logger,
	service svc_collection.GetCollectionSyncDataService,
	mw middleware.Middleware,
) *CollectionSyncHTTPHandler {
	return NewCollectionSyncHTTPHandler(cfg, logger, service, mw)
}

func ProvideMoveCollectionHTTPHandler(
	cfg *config.Configuration,
	logger *zap.Logger,
	service svc_collection.MoveCollectionService,
	mw middleware.Middleware,
) *MoveCollectionHTTPHandler {
	return NewMoveCollectionHTTPHandler(cfg, logger, service, mw)
}

func ProvideGetFilteredCollectionsHTTPHandler(
	cfg *config.Configuration,
	logger *zap.Logger,
	service svc_collection.GetFilteredCollectionsService,
	mw middleware.Middleware,
) *GetFilteredCollectionsHTTPHandler {
	return NewGetFilteredCollectionsHTTPHandler(cfg, logger, service, mw)
}

func ProvideShareCollectionHTTPHandler(
	cfg *config.Configuration,
	logger *zap.Logger,
	service svc_collection.ShareCollectionService,
	mw middleware.Middleware,
) *ShareCollectionHTTPHandler {
	return NewShareCollectionHTTPHandler(cfg, logger, service, mw)
}

func ProvideRemoveMemberHTTPHandler(
	cfg *config.Configuration,
	logger *zap.Logger,
	service svc_collection.RemoveMemberService,
	mw middleware.Middleware,
) *RemoveMemberHTTPHandler {
	return NewRemoveMemberHTTPHandler(cfg, logger, service, mw)
}
