using LiteCqrs;
using TeleWave.Application.Common.Interfaces;
using TeleWave.Application.Common.Models;

namespace TeleWave.Application.Admin.Users.ResetPassword;

public sealed class ResetUserPasswordCommandHandler(IIdentityService identityService)
    : ICommandHandler<ResetUserPasswordCommand, Result>
{
    public Task<Result> Handle(
        ResetUserPasswordCommand command,
        CancellationToken cancellationToken
    ) => identityService.ResetPasswordAsync(command.UserId, command.NewPassword, cancellationToken);
}
