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

namespace TeleWave.Application.Admin.Roles.ChangeUserRole;

public sealed class ChangeUserRoleCommandHandler(IRoleService roleService)
    : ICommandHandler<ChangeUserRoleCommand, Result>
{
    public Task<Result> Handle(
        ChangeUserRoleCommand command,
        CancellationToken cancellationToken
    ) => roleService.ChangeUserRoleAsync(command.UserId, command.RoleId, cancellationToken);
}
