using Codex.CQRS.Commands;
using Microsoft.Extensions.DependencyInjection;
using OpenHarbor.CQRS;
using OpenHarbor.CQRS.FluentValidation;
using PoweredSoft.Module.Abstractions;

namespace Codex.CQRS;

public class CommandsModule : IModule
{
    public IServiceCollection ConfigureServices(IServiceCollection services)
    {
        // Agent commands
        services.AddCommand<CreateAgentCommand, CreateAgentCommandHandler, CreateAgentCommandValidator>();
        services.AddCommand<UpdateAgentCommand, UpdateAgentCommandHandler, UpdateAgentCommandValidator>();
        services.AddCommand<DeleteAgentCommand, DeleteAgentCommandHandler, DeleteAgentCommandValidator>();

        // Conversation commands
        services.AddCommand<CreateConversationCommand, Guid, CreateConversationCommandHandler, CreateConversationCommandValidator>();

        // Agent execution commands
        services.AddCommand<StartAgentExecutionCommand, Guid, StartAgentExecutionCommandHandler, StartAgentExecutionCommandValidator>();
        services.AddCommand<CompleteAgentExecutionCommand, CompleteAgentExecutionCommandHandler, CompleteAgentExecutionCommandValidator>();

        return services;
    }
}
