using presence.data.Repository;
using presence.domain.UseCase;
using presence.ui;
using Microsoft.Extensions.DependencyInjection;
using System.Text.RegularExpressions;
using presence.data.RemoteData.RemoteDataBase;

IServiceCollection services = new ServiceCollection();

services
    .AddDbContext<RemoteDataBaseContext>()
    .AddSingleton<IGroupRepository, SQLGroupRepositoryImpl>()
    .AddSingleton<IUserRepository, SQLUserRepositoryImpl>()
    .AddSingleton<IPresenceRepository, SQLPresenceRepositoryImpl>()
    .AddSingleton<UserUseCase>()
    .AddSingleton<GroupUseCase>()
    .AddSingleton<PresenceUseCase>()
    .AddSingleton<PresenceConsoleUI>()
    .AddSingleton<MainMenuUI>();

var serviceProvider = services.BuildServiceProvider();
// Создаем пользовательский интерфейс
MainMenuUI mainMenuUI = serviceProvider.GetService<MainMenuUI>();

// Выводим главное меню
mainMenuUI.DisplayMenu();