using System.Collections.Generic;
using System.Threading.Tasks;
using SvetoforVKBot.Models.Commands;
using SvetoforVKBot.Models.Commands.Admin;
using VkNet;
using VkNet.Model;
using SvetoforVKBot.Models.Commands.Registration;
using SvetoforVKBot.Models.Commands.LK;
using SvetoforVKBot.Models.Commands.LK.Menu;
using SvetoforVKBot.Models.Commands.LK.Menu.Products;
using SvetoforVKBot.Models.Commands.LK.Calculators;
using SvetoforVKBot.Models.Commands.LK.Reports;
using SvetoforVKBot.Models.Commands.ExpertLK;
using SvetoforVKBot.Models.Commands.LK.Consultation;
using SvetoforVKBot.Models.Commands.LK.Cart;
using SvetoforVKBot.Models.Commands.LK.Tracks;
using SvetoforVKBot.Models.Commands.LK.EditData;
using SvetoforVKBot.Models.Commands.Water;
using System.Configuration;
using SvetoforVKBot.App_Start;

namespace SvetoforVKBot.Models
{
    public static class Bot
    {
        private static VkApi client;

        private static List<Command> commandsList;

        public static IReadOnlyList<Command> Commands => commandsList.AsReadOnly();

        public static async Task<VkApi> Get()
        {
            commandsList = new List<Command>
            {
                //Основные
                new StartCommand(),
                new StartLowerCommand(),
                new StartPLCommand(),
                new SelectRoleCommand(),
                new SelectAboutCommand(),
                new SelectAskQuestionsCommand(),
                
                //Регистрация
                new SelectParticipateCommand(),
                new SelectChildAgeCommand(),
                new SelectAgreementCommand(),
                new SelectAcceptPDCommand(),
                new SelectDateCommand(),
                new SelectDateNavigationCommand(),
                new SelectDRMonthCommand(),
                new SelectGenderCommand(),
                new SelectActivityCoefCommand(),
                new SelectActivityKindCommand(),
                new SelectSportsCommand(),
                new SelectDayCommand(),
                new SelectNotifyCountCommand(),
                new SelectVyatsuRoleCommand(),

                //Личный кабинет
                new SelectEditDataCommand(),
                new SelectMenuCommand(),
                new SelectDayMenuCommand(),
                new SelectColorCommand(),
                new SelectProductCommand(),
                new SelectCalculatorCcalCommand(),
                new SelectCalcCcalResultCommand(),
                new SelectIdealWeightCommand(),
                new SelectCreateReportCommand(),
                new SelectReportRateCommand(),
                new SelectReportCcalCommand(),
                new SelectConsultationCommand(),
                new SelectPersonalMenuCommand(),

                //Редактирование данных
                new SelectEditNotifyCount(),
                new SelectUpdateSportDaysCommand(),

                //Вода
                new SelectGoWaterNotifyCommand(),
                new SelectOffWaterNotifyCommand(),
                new SelectWaterNotifyCountCommand(),

                //Треки
                new SelectTrackCommand(),
                new SelectRationCommand(),
                new SelectExampleMenuCommand(),
                new SelectChooseTrackCommand(),

                //Корзина
                new SelectAddToCartCommand(),
                new SelectCartCommand(),
                new SelectEditCartCommand(),
                new SelectConfirmClearCartCommand(),

                //Дополнительные
                new SelectAskQuestionsCommand(),

                //Админ
                new SelectGetPhotoCommand(),
                new SelectAdminCommand(),
                new SelectStatisticCommand(),
                new SelectTestNotifyCommand(),

                //Консультации
                new SelectLiveConsultationCommand(),
                new SelectSubmitConsultationCommand(),
                new SelectMoreAboutSpecCommand(),

                //Эксперт
                new SelectExpertLKCommand(),
                new SelectParticipantsCommand(),
                new SelectParticipantInfoCommand(),
                new SelectUpPersonalPlanCommand(),
                new SelectPersonalPlanCommand(),

                //Питание
                new SelectDayFoodCommand(),
            };

            client = new VkApi();

            

            await client.AuthorizeAsync(new ApiAuthParams
            {
                AccessToken = ((WebConfiguration)ConfigurationManager.GetSection("VKApi")).Token
            });

            return client;
        }
    }
}
