using KArtSell.Modules.ModelOperations.Application;
using KArtSell.Modules.ModelOperations.Domain;
using KArtSell.Modules.ModelOperations.Infrastructure;
using KArtSell.Modules.ModelOperations.Observability;
using KArtSell.Modules.ModelOperations.ShadowRun;
using KArtSell.Modules.ModelOperations.ShadowRun.Services;
using Microsoft.Extensions.DependencyInjection;

namespace KArtSell.Modules.ModelOperations;

public static class ModelOperationsModule
{
    public static IServiceCollection AddModelOperationsModule(this IServiceCollection services)
    {
        services.AddScoped<IApprovedModelContextReader, DapperApprovedModelContextReader>();
        services.AddScoped<IModelScheduleRepository, DapperModelScheduleRepository>();
        services.AddScoped<IModelOperationRequestRepository, DapperModelOperationRequestRepository>();
        services.AddScoped<IModelOperationRequestService, ModelOperationRequestService>();
        services.AddSingleton<IMarketCalendarService, MarketCalendarService>();
        // KrxDataService registered in Host.Program.cs as typed HttpClient
        // ObservabilityService registered in Host.Program.cs with MetricsSql dependency
        return services;
    }
}
