using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;
using SatelliteProvider.Common.Interfaces;
using SatelliteProvider.Services.RouteManagement.TileProvision;

namespace SatelliteProvider.Services.RouteManagement;

public static class RouteManagementServiceCollectionExtensions
{
    public static IServiceCollection AddRouteManagement(this IServiceCollection services)
    {
        services.AddSingleton<RouteCsvWriter>();
        services.AddSingleton<RouteSummaryWriter>();
        services.AddSingleton<RouteImageRenderer>();
        services.AddSingleton<TilesZipBuilder>();
        services.AddSingleton<RegionFileCleaner>();
        services.AddSingleton<GeofenceGridCalculator>();
        services.AddSingleton<RoutePointGraphBuilder>();
        services.AddSingleton<RouteTileExpander>();
        services.AddSingleton<RouteTileDeliveryOrchestrator>();
        services.AddSingleton<IRouteService, RouteService>();
        services.AddHostedService<RouteProcessingService>();
        return services;
    }
}
