package file

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

// Wire providers for file HTTP handlers

func ProvideCreatePendingFileHTTPHandler(
	cfg *config.Configuration,
	logger *zap.Logger,
	service svc_file.CreatePendingFileService,
	mw middleware.Middleware,
) *CreatePendingFileHTTPHandler {
	return NewCreatePendingFileHTTPHandler(cfg, logger, service, mw)
}

func ProvideGetPresignedUploadURLHTTPHandler(
	cfg *config.Configuration,
	logger *zap.Logger,
	service svc_file.GetPresignedUploadURLService,
	mw middleware.Middleware,
) *GetPresignedUploadURLHTTPHandler {
	return NewGetPresignedUploadURLHTTPHandler(cfg, logger, service, mw)
}

func ProvideCompleteFileUploadHTTPHandler(
	cfg *config.Configuration,
	logger *zap.Logger,
	service svc_file.CompleteFileUploadService,
	mw middleware.Middleware,
) *CompleteFileUploadHTTPHandler {
	return NewCompleteFileUploadHTTPHandler(cfg, logger, service, mw)
}

func ProvideGetFileHTTPHandler(
	cfg *config.Configuration,
	logger *zap.Logger,
	service svc_file.GetFileService,
	mw middleware.Middleware,
) *GetFileHTTPHandler {
	return NewGetFileHTTPHandler(cfg, logger, service, mw)
}

func ProvideGetPresignedDownloadURLHTTPHandler(
	cfg *config.Configuration,
	logger *zap.Logger,
	service svc_file.GetPresignedDownloadURLService,
	mw middleware.Middleware,
) *GetPresignedDownloadURLHTTPHandler {
	return NewGetPresignedDownloadURLHTTPHandler(cfg, logger, service, mw)
}

func ProvideListFilesByCollectionHTTPHandler(
	cfg *config.Configuration,
	logger *zap.Logger,
	service svc_file.ListFilesByCollectionService,
	mw middleware.Middleware,
) *ListFilesByCollectionHTTPHandler {
	return NewListFilesByCollectionHTTPHandler(cfg, logger, service, mw)
}

func ProvideListRecentFilesHTTPHandler(
	cfg *config.Configuration,
	logger *zap.Logger,
	service svc_file.ListRecentFilesService,
	mw middleware.Middleware,
) *ListRecentFilesHTTPHandler {
	return NewListRecentFilesHTTPHandler(cfg, logger, service, mw)
}

func ProvideUpdateFileHTTPHandler(
	cfg *config.Configuration,
	logger *zap.Logger,
	service svc_file.UpdateFileService,
	mw middleware.Middleware,
) *UpdateFileHTTPHandler {
	return NewUpdateFileHTTPHandler(cfg, logger, service, mw)
}

func ProvideSoftDeleteFileHTTPHandler(
	cfg *config.Configuration,
	logger *zap.Logger,
	service svc_file.SoftDeleteFileService,
	mw middleware.Middleware,
) *SoftDeleteFileHTTPHandler {
	return NewSoftDeleteFileHTTPHandler(cfg, logger, service, mw)
}

func ProvideArchiveFileHTTPHandler(
	cfg *config.Configuration,
	logger *zap.Logger,
	service svc_file.ArchiveFileService,
	mw middleware.Middleware,
) *ArchiveFileHTTPHandler {
	return NewArchiveFileHTTPHandler(cfg, logger, service, mw)
}

func ProvideRestoreFileHTTPHandler(
	cfg *config.Configuration,
	logger *zap.Logger,
	service svc_file.RestoreFileService,
	mw middleware.Middleware,
) *RestoreFileHTTPHandler {
	return NewRestoreFileHTTPHandler(cfg, logger, service, mw)
}

func ProvideDeleteMultipleFilesHTTPHandler(
	cfg *config.Configuration,
	logger *zap.Logger,
	service svc_file.DeleteMultipleFilesService,
	mw middleware.Middleware,
) *DeleteMultipleFilesHTTPHandler {
	return NewDeleteMultipleFilesHTTPHandler(cfg, logger, service, mw)
}

func ProvideFileSyncHTTPHandler(
	cfg *config.Configuration,
	logger *zap.Logger,
	service svc_file.ListFileSyncDataService,
	mw middleware.Middleware,
) *FileSyncHTTPHandler {
	return NewFileSyncHTTPHandler(cfg, logger, service, mw)
}

func ProvideReportDownloadCompletedHTTPHandler(
	cfg *config.Configuration,
	logger *zap.Logger,
	mw middleware.Middleware,
) *ReportDownloadCompletedHTTPHandler {
	return NewReportDownloadCompletedHTTPHandler(cfg, logger, mw)
}
