package collection

import (
	"go.uber.org/zap"

	"codeberg.org/mapleopentech/monorepo/cloud/maplefile-backend/config"
	dom_collection "codeberg.org/mapleopentech/monorepo/cloud/maplefile-backend/internal/domain/collection"
)

// Wire providers for collection use cases

func ProvideCreateCollectionUseCase(
	cfg *config.Configuration,
	logger *zap.Logger,
	repo dom_collection.CollectionRepository,
) CreateCollectionUseCase {
	return NewCreateCollectionUseCase(cfg, logger, repo)
}

func ProvideUpdateCollectionUseCase(
	cfg *config.Configuration,
	logger *zap.Logger,
	repo dom_collection.CollectionRepository,
) UpdateCollectionUseCase {
	return NewUpdateCollectionUseCase(cfg, logger, repo)
}

func ProvideGetCollectionUseCase(
	cfg *config.Configuration,
	logger *zap.Logger,
	repo dom_collection.CollectionRepository,
) GetCollectionUseCase {
	return NewGetCollectionUseCase(cfg, logger, repo)
}

func ProvideSoftDeleteCollectionUseCase(
	cfg *config.Configuration,
	logger *zap.Logger,
	repo dom_collection.CollectionRepository,
) SoftDeleteCollectionUseCase {
	return NewSoftDeleteCollectionUseCase(cfg, logger, repo)
}

func ProvideArchiveCollectionUseCase(
	cfg *config.Configuration,
	logger *zap.Logger,
	repo dom_collection.CollectionRepository,
) ArchiveCollectionUseCase {
	return NewArchiveCollectionUseCase(cfg, logger, repo)
}

func ProvideRestoreCollectionUseCase(
	cfg *config.Configuration,
	logger *zap.Logger,
	repo dom_collection.CollectionRepository,
) RestoreCollectionUseCase {
	return NewRestoreCollectionUseCase(cfg, logger, repo)
}

func ProvideListCollectionsByUserUseCase(
	cfg *config.Configuration,
	logger *zap.Logger,
	repo dom_collection.CollectionRepository,
) ListCollectionsByUserUseCase {
	return NewListCollectionsByUserUseCase(cfg, logger, repo)
}

func ProvideListCollectionsSharedWithUserUseCase(
	cfg *config.Configuration,
	logger *zap.Logger,
	repo dom_collection.CollectionRepository,
) ListCollectionsSharedWithUserUseCase {
	return NewListCollectionsSharedWithUserUseCase(cfg, logger, repo)
}

func ProvideFindRootCollectionsUseCase(
	cfg *config.Configuration,
	logger *zap.Logger,
	repo dom_collection.CollectionRepository,
) FindRootCollectionsUseCase {
	return NewFindRootCollectionsUseCase(cfg, logger, repo)
}

func ProvideFindCollectionsByParentUseCase(
	cfg *config.Configuration,
	logger *zap.Logger,
	repo dom_collection.CollectionRepository,
) FindCollectionsByParentUseCase {
	return NewFindCollectionsByParentUseCase(cfg, logger, repo)
}

func ProvideGetCollectionSyncDataUseCase(
	cfg *config.Configuration,
	logger *zap.Logger,
	repo dom_collection.CollectionRepository,
) GetCollectionSyncDataUseCase {
	return NewGetCollectionSyncDataUseCase(cfg, logger, repo)
}

func ProvideCheckCollectionAccessUseCase(
	cfg *config.Configuration,
	logger *zap.Logger,
	repo dom_collection.CollectionRepository,
) CheckCollectionAccessUseCase {
	return NewCheckCollectionAccessUseCase(cfg, logger, repo)
}

func ProvideCountUserCollectionsUseCase(
	cfg *config.Configuration,
	logger *zap.Logger,
	repo dom_collection.CollectionRepository,
) CountUserCollectionsUseCase {
	return NewCountUserCollectionsUseCase(cfg, logger, repo)
}

func ProvideCountUserFoldersUseCase(
	cfg *config.Configuration,
	logger *zap.Logger,
	repo dom_collection.CollectionRepository,
) CountUserFoldersUseCase {
	return NewCountUserFoldersUseCase(cfg, logger, repo)
}

func ProvideUpdateMemberPermissionUseCase(
	cfg *config.Configuration,
	logger *zap.Logger,
	repo dom_collection.CollectionRepository,
) UpdateMemberPermissionUseCase {
	return NewUpdateMemberPermissionUseCase(cfg, logger, repo)
}

func ProvideMoveCollectionUseCase(
	cfg *config.Configuration,
	logger *zap.Logger,
	repo dom_collection.CollectionRepository,
) MoveCollectionUseCase {
	return NewMoveCollectionUseCase(cfg, logger, repo)
}

func ProvideGetFilteredCollectionsUseCase(
	cfg *config.Configuration,
	logger *zap.Logger,
	repo dom_collection.CollectionRepository,
) GetFilteredCollectionsUseCase {
	return NewGetFilteredCollectionsUseCase(cfg, logger, repo)
}

func ProvideAddMemberToHierarchyUseCase(
	cfg *config.Configuration,
	logger *zap.Logger,
	repo dom_collection.CollectionRepository,
) AddMemberToHierarchyUseCase {
	return NewAddMemberToHierarchyUseCase(cfg, logger, repo)
}

func ProvideRemoveMemberFromHierarchyUseCase(
	cfg *config.Configuration,
	logger *zap.Logger,
	repo dom_collection.CollectionRepository,
) RemoveMemberFromHierarchyUseCase {
	return NewRemoveMemberFromHierarchyUseCase(cfg, logger, repo)
}

func ProvideFindDescendantsUseCase(
	cfg *config.Configuration,
	logger *zap.Logger,
	repo dom_collection.CollectionRepository,
) FindDescendantsUseCase {
	return NewFindDescendantsUseCase(cfg, logger, repo)
}

func ProvideAddCollectionMemberUseCase(
	cfg *config.Configuration,
	logger *zap.Logger,
	repo dom_collection.CollectionRepository,
) AddCollectionMemberUseCase {
	return NewAddCollectionMemberUseCase(cfg, logger, repo)
}

func ProvideRemoveCollectionMemberUseCase(
	cfg *config.Configuration,
	logger *zap.Logger,
	repo dom_collection.CollectionRepository,
) RemoveCollectionMemberUseCase {
	return NewRemoveCollectionMemberUseCase(cfg, logger, repo)
}

func ProvideAnonymizeOldIPsUseCase(
	cfg *config.Configuration,
	logger *zap.Logger,
	repo dom_collection.CollectionRepository,
) AnonymizeOldIPsUseCase {
	return NewAnonymizeOldIPsUseCase(cfg, logger, repo)
}

func ProvideRemoveUserFromAllCollectionsUseCase(
	logger *zap.Logger,
	repo dom_collection.CollectionRepository,
) RemoveUserFromAllCollectionsUseCase {
	return NewRemoveUserFromAllCollectionsUseCase(logger, repo)
}

func ProvideHardDeleteCollectionUseCase(
	cfg *config.Configuration,
	logger *zap.Logger,
	repo dom_collection.CollectionRepository,
) HardDeleteCollectionUseCase {
	return NewHardDeleteCollectionUseCase(cfg, logger, repo)
}

func ProvideAnonymizeUserReferencesUseCase(
	logger *zap.Logger,
	repo dom_collection.CollectionRepository,
) AnonymizeUserReferencesUseCase {
	return NewAnonymizeUserReferencesUseCase(logger, repo)
}
