using CommunityToolkit.Mvvm.DependencyInjection;
using PSCHelpdesk.Plugins.HetznerServer.ViewModels;
using PSCHelpdesk.Shared.Service;
using Microsoft.Extensions.DependencyInjection;
using Prise.Plugin;

namespace PSCHelpdesk.Plugins.HetznerServer;

[PluginBootstrapper(PluginType = typeof(HetznerServer))]
public class HetznerServerBootstrap : IPluginBootstrapper
{
    [BootstrapperService(ServiceType = typeof(IMenuService), ProxyType =  typeof(MenuService))]
    private readonly IMenuService menuService;
    
    public IServiceCollection Bootstrap(IServiceCollection services)
    {
        services.AddSingleton<IMenuService>(this.menuService);
        services.AddTransient<ServerViewModel>();
        Ioc.Default.ConfigureServices(services.BuildServiceProvider());
        return services;
    }
}
