using Managing.Application.Abstractions.Services;
using Managing.Application.ManageBot.Commands;
using MediatR;

namespace Managing.Application.ManageBot
{
    /// <summary>
    /// Handler for retrieving only online agent names
    /// </summary>
    public class GetOnlineAgentNamesCommandHandler : IRequestHandler<GetOnlineAgentNamesCommand, IEnumerable<string>>
    {
        private readonly IAgentService _agentService;

        public GetOnlineAgentNamesCommandHandler(IAgentService agentService)
        {
            _agentService = agentService;
        }

        public async Task<IEnumerable<string>> Handle(GetOnlineAgentNamesCommand request,
            CancellationToken cancellationToken)
        {
            return await _agentService.GetAllOnlineAgents();
        }
    }
} 