using Codex.CQRS.Queries;
using Codex.Dal;
using Microsoft.Extensions.DependencyInjection;
using OpenHarbor.CQRS.Abstractions;
using PoweredSoft.Module.Abstractions;

namespace Codex.CQRS;

public class QueriesModule : IModule
{
    public IServiceCollection ConfigureServices(IServiceCollection services)
    {
        // Health query
        services.AddQuery<HealthQuery, bool, HealthQueryHandler>();

        // Agent queries
        services.AddQuery<GetAgentQuery, GetAgentQueryResult, GetAgentQueryHandler>();

        // Agent execution queries
        services.AddQuery<GetAgentExecutionQuery, AgentExecutionDetails?, GetAgentExecutionQueryHandler>();

        // Conversation queries
        services.AddQuery<GetConversationQuery, ConversationDetails?, GetConversationQueryHandler>();

        return services;
    }
}
