using Knot.Contracts.Conversations.Abstractions;
using Knot.Modules.Conversations.Application.Users.Commands.DeleteUser;
using Knot.Shared.Kernel;
using MediatR;

namespace Knot.Modules.Conversations.Infrastructure.Services;

public sealed class UserDeleterService : IUserDeleterService
{
    private readonly ISender _sender;

    public UserDeleterService(ISender sender)
    {
        _sender = sender;
    }

    public async Task<Result> DeleteUserAsync(Guid userId, CancellationToken cancellationToken)
    {
        return await _sender.Send(new DeleteUserCommand(userId), cancellationToken);
    }
}
