// codeberg.org/mapleopentech/monorepo/cloud/maplefile-backend/internal/service/user/provider.go
package user

import (
	"go.uber.org/zap"

	"codeberg.org/mapleopentech/monorepo/cloud/maplefile-backend/config"
	svc_collection "codeberg.org/mapleopentech/monorepo/cloud/maplefile-backend/internal/service/collection"
	svc_file "codeberg.org/mapleopentech/monorepo/cloud/maplefile-backend/internal/service/file"
	uc_collection "codeberg.org/mapleopentech/monorepo/cloud/maplefile-backend/internal/usecase/collection"
	uc_filemetadata "codeberg.org/mapleopentech/monorepo/cloud/maplefile-backend/internal/usecase/filemetadata"
	uc_storagedailyusage "codeberg.org/mapleopentech/monorepo/cloud/maplefile-backend/internal/usecase/storagedailyusage"
	uc_storageusageevent "codeberg.org/mapleopentech/monorepo/cloud/maplefile-backend/internal/usecase/storageusageevent"
	uc_user "codeberg.org/mapleopentech/monorepo/cloud/maplefile-backend/internal/usecase/user"
)

// ProvideUserPublicLookupService provides the user public lookup service
func ProvideUserPublicLookupService(
	config *config.Config,
	logger *zap.Logger,
	userGetByEmailUC uc_user.UserGetByEmailUseCase,
) UserPublicLookupService {
	return NewUserPublicLookupService(config, logger, userGetByEmailUC)
}

// ProvideCompleteUserDeletionService provides the complete GDPR user deletion service
func ProvideCompleteUserDeletionService(
	cfg *config.Configuration,
	logger *zap.Logger,
	getUserUseCase uc_user.UserGetByIDUseCase,
	deleteUserByIDUseCase uc_user.UserDeleteByIDUseCase,
	listFilesByOwnerIDService svc_file.ListFilesByOwnerIDService,
	softDeleteFileService svc_file.SoftDeleteFileService,
	listCollectionsByUserUseCase uc_collection.ListCollectionsByUserUseCase,
	softDeleteCollectionService svc_collection.SoftDeleteCollectionService,
	removeUserFromAllCollectionsUseCase uc_collection.RemoveUserFromAllCollectionsUseCase,
	deleteStorageDailyUsageUseCase uc_storagedailyusage.DeleteByUserUseCase,
	deleteStorageUsageEventUseCase uc_storageusageevent.DeleteByUserUseCase,
	anonymizeUserIPsImmediatelyUseCase uc_user.AnonymizeUserIPsImmediatelyUseCase,
	clearUserCacheUseCase uc_user.ClearUserCacheUseCase,
	anonymizeFileUserReferencesUseCase uc_filemetadata.AnonymizeUserReferencesUseCase,
	anonymizeCollectionUserReferencesUseCase uc_collection.AnonymizeUserReferencesUseCase,
) CompleteUserDeletionService {
	return NewCompleteUserDeletionService(
		cfg,
		logger,
		getUserUseCase,
		deleteUserByIDUseCase,
		listFilesByOwnerIDService,
		softDeleteFileService,
		listCollectionsByUserUseCase,
		softDeleteCollectionService,
		removeUserFromAllCollectionsUseCase,
		deleteStorageDailyUsageUseCase,
		deleteStorageUsageEventUseCase,
		anonymizeUserIPsImmediatelyUseCase,
		clearUserCacheUseCase,
		anonymizeFileUserReferencesUseCase,
		anonymizeCollectionUserReferencesUseCase,
	)
}
