using KArtSell.Modules.SignalEngine.Application;
using KArtSell.Modules.SignalEngine.Domain;
using KArtSell.Modules.SignalEngine.Domain.Policies;
using KArtSell.Modules.SignalEngine.Infrastructure;
using Microsoft.Extensions.DependencyInjection;

namespace KArtSell.Modules.SignalEngine;

public static class SignalEngineModule
{
    public static IServiceCollection AddSignalEngineModule(this IServiceCollection services)
    {
        services.AddSingleton<ISellPolicy, HardImpairmentPolicy>();
        services.AddSingleton<ISellPolicy, PortfolioSurvivalPolicy>();
        services.AddSingleton<ISellPolicy, GapFloorBreachPolicy>();
        services.AddSingleton<ISellPolicy, TwoCloseFloorBreachPolicy>();
        services.AddSingleton<ISellPolicy, ConcentrationLiquidityPolicy>();
        services.AddSingleton<ISellPolicy, OpportunityCostPolicy>();
        services.AddSingleton<SellPolicyChain>();

        services.AddScoped<ISellDecisionContextReader, DapperSellDecisionContextReader>();
        services.AddScoped<ISellDecisionService, SellDecisionService>();
        return services;
    }
}
