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

namespace Managing.Application.ManageBot
{
    public class GetTopBotsByRoiCommandHandler(IBotRepository botRepository)
        : IRequestHandler<GetTopBotsByRoiCommand, IEnumerable<Bot>>
    {
        public async Task<IEnumerable<Bot>> Handle(GetTopBotsByRoiCommand request, CancellationToken cancellationToken)
        {
            return await botRepository.GetTopBotsByRoiAsync(request.Statuses, request.Count);
        }
    }
}
