package me

import (
	"go.uber.org/zap"

	"codeberg.org/mapleopentech/monorepo/cloud/maplefile-backend/config"
	uc_user "codeberg.org/mapleopentech/monorepo/cloud/maplefile-backend/internal/usecase/user"
	svc_user "codeberg.org/mapleopentech/monorepo/cloud/maplefile-backend/internal/service/user"
	"codeberg.org/mapleopentech/monorepo/cloud/maplefile-backend/pkg/auditlog"
	"codeberg.org/mapleopentech/monorepo/cloud/maplefile-backend/pkg/emailer/mailgun"
)

// Wire providers for me services

func ProvideGetMeService(
	cfg *config.Configuration,
	logger *zap.Logger,
	userGetByIDUseCase uc_user.UserGetByIDUseCase,
	userCreateUseCase uc_user.UserCreateUseCase,
	userUpdateUseCase uc_user.UserUpdateUseCase,
) GetMeService {
	return NewGetMeService(cfg, logger, userGetByIDUseCase, userCreateUseCase, userUpdateUseCase)
}

func ProvideUpdateMeService(
	cfg *config.Configuration,
	logger *zap.Logger,
	userGetByIDUseCase uc_user.UserGetByIDUseCase,
	userGetByEmailUseCase uc_user.UserGetByEmailUseCase,
	userUpdateUseCase uc_user.UserUpdateUseCase,
) UpdateMeService {
	return NewUpdateMeService(cfg, logger, userGetByIDUseCase, userGetByEmailUseCase, userUpdateUseCase)
}

func ProvideDeleteMeService(
	cfg *config.Configuration,
	logger *zap.Logger,
	completeUserDeletionService svc_user.CompleteUserDeletionService,
) DeleteMeService {
	return NewDeleteMeService(
		cfg,
		logger,
		completeUserDeletionService,
	)
}

func ProvideVerifyProfileService(
	cfg *config.Configuration,
	logger *zap.Logger,
	userGetByIDUseCase uc_user.UserGetByIDUseCase,
	userUpdateUseCase uc_user.UserUpdateUseCase,
) VerifyProfileService {
	return NewVerifyProfileService(cfg, logger, userGetByIDUseCase, userUpdateUseCase)
}

func ProvideChangeEmailRequestService(
	cfg *config.Configuration,
	logger *zap.Logger,
	auditLogger auditlog.AuditLogger,
	userGetByIDUseCase uc_user.UserGetByIDUseCase,
	userGetByEmailUseCase uc_user.UserGetByEmailUseCase,
	userUpdateUseCase uc_user.UserUpdateUseCase,
	emailer mailgun.Emailer,
) ChangeEmailRequestService {
	return NewChangeEmailRequestService(cfg, logger, auditLogger, userGetByIDUseCase, userGetByEmailUseCase, userUpdateUseCase, emailer)
}

func ProvideChangeEmailVerifyService(
	cfg *config.Configuration,
	logger *zap.Logger,
	auditLogger auditlog.AuditLogger,
	userGetByIDUseCase uc_user.UserGetByIDUseCase,
	userUpdateUseCase uc_user.UserUpdateUseCase,
	emailer mailgun.Emailer,
) ChangeEmailVerifyService {
	return NewChangeEmailVerifyService(cfg, logger, auditLogger, userGetByIDUseCase, userUpdateUseCase, emailer)
}
