Add admin password reset functionality for users and customers
This commit is contained in:
@@ -7,9 +7,11 @@ import (
|
||||
"slices"
|
||||
"strings"
|
||||
"time"
|
||||
"tm/pkg/audit"
|
||||
"tm/pkg/authorization"
|
||||
"tm/pkg/logger"
|
||||
"tm/pkg/notification"
|
||||
"tm/pkg/redis"
|
||||
"tm/pkg/response"
|
||||
|
||||
"go.mongodb.org/mongo-driver/v2/bson"
|
||||
@@ -26,6 +28,7 @@ type Service interface {
|
||||
GetUsersByIDs(ctx context.Context, userIDs []string) (*UserListResponse, error)
|
||||
Search(ctx context.Context, form *SearchUsersForm, pagination *response.Pagination) (*UserListResponse, error)
|
||||
Delete(ctx context.Context, id string) error
|
||||
AdminResetPassword(ctx context.Context, actorID, targetID string) (*AdminResetPasswordResponse, error)
|
||||
|
||||
// Profile
|
||||
Login(ctx context.Context, form *LoginForm) (*AuthResponse, error)
|
||||
@@ -43,16 +46,20 @@ type userService struct {
|
||||
authService authorization.AuthorizationService
|
||||
validator ValidationService
|
||||
notification notification.SDK
|
||||
redisClient redis.Client
|
||||
auditLogger audit.Logger
|
||||
}
|
||||
|
||||
// NewService creates a new user service
|
||||
func NewService(repository Repository, logger logger.Logger, authService authorization.AuthorizationService, validator ValidationService, notificationSDK notification.SDK) Service {
|
||||
func NewService(repository Repository, logger logger.Logger, authService authorization.AuthorizationService, validator ValidationService, notificationSDK notification.SDK, redisClient redis.Client, auditLogger audit.Logger) Service {
|
||||
return &userService{
|
||||
repository: repository,
|
||||
logger: logger,
|
||||
authService: authService,
|
||||
validator: validator,
|
||||
notification: notificationSDK,
|
||||
redisClient: redisClient,
|
||||
auditLogger: auditLogger,
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user