using Managing.Application.Abstractions;
using Managing.Application.ManageBot.Commands;
using Managing.Domain.Bots;
using MediatR;

namespace Managing.Application.ManageBot
{
    public class GetBotsByStatusCommandHandler(IBotService botService)
        : IRequestHandler<GetBotsByStatusCommand, IEnumerable<Bot>>
    {
        public async Task<IEnumerable<Bot>> Handle(GetBotsByStatusCommand request, CancellationToken cancellationToken)
        {
            return await botService.GetBotsByStatusAsync(request.Status);
        }
    }
}