package cz.moneta.test.dsl.monetaportal.components;

import cz.moneta.test.dsl.monetaportal.HomePage;
import cz.moneta.test.dsl.monetaportal.accounts.CurrentAccountPage;
import cz.moneta.test.dsl.monetaportal.accounts.SavingAccountPage;
import cz.moneta.test.dsl.monetaportal.loans.*;
import cz.moneta.test.dsl.monetaportal.more.ExchangeRatesPage;
import cz.moneta.test.dsl.monetaportal.mortgages.MortgagePage;
import cz.moneta.test.dsl.monetaportal.products.CreditAccountPage;
import cz.moneta.test.dsl.monetaportal.products.CreditCardPage;
import cz.moneta.test.dsl.monetaportal.products.ProductsPage;
import cz.moneta.test.dsl.monetaportal.savings.BuildingSavingsPage;
import cz.moneta.test.dsl.monetaportal.savings.HoldingFundsPage;
import cz.moneta.test.dsl.monetaportal.savings.SupplementaryRetirementSchemesPage;
import cz.moneta.test.harness.support.web.Builder;
import cz.moneta.test.harness.support.web.Click;
import cz.moneta.test.harness.support.web.Wait;

import static cz.moneta.test.dsl.monetaportal.components.MainMenu.SHORTCUTS_LOANS;

@Wait(SHORTCUTS_LOANS)
public interface MainMenu extends Builder {
    //Main menu
    String SHORTCUTS_ACCOUNTS = "//div[@class='menu_wrapper']//li[@class='nav__item nav--full']//a[@href='/ucty-a-karty']";
    String SHORTCUTS_LOANS = "//div[@class='navbar-nav navbar-nav--images']//span[text()='Půjčky']";
    String SHORTCUTS_MORTGAGE_LOANS = "//div[@class='menu_wrapper']//li[@class='nav__item nav--full']//a[@href='/hypoteky']";
    String SHORTCUTS_SAVINGS = "//div[@class='menu_wrapper']//li[@class='nav__item nav--full']//a[@href='/sporeni-a-investice']";
    String SHORTCUTS_MORE = "//div[@class='menu_wrapper']//li[@class='nav__item nav--is_more']//a[@href='/vice']";
    //Submenu Accounts and cards
    String SHORTCUTS_CURRENT_ACCOUNT = "//div[@class='list_items__item__title']/a[@href='/ucty-a-karty/bezny-ucet']";
    //Submenu Loans
    String SHORTCUTS_EXPRESS_LOANS = "//div[contains(@class,'tab-panel-item') and not(contains(@class,'d-none'))]//ul[@id='xsellCards3']//a[@href='/pujcky-a-uvery/pujcka-na-cokoliv' ]";
    String REDUCE_OBLIGATIONS = "//div[@class='list_items__item__title']/a[@href='/pujcky-a-uvery/slouceni-pujcek']";
    String SHORTCUTS_LOANS_BUSINESS = "//div[@class='list_items__item__title']/a[@href='/pujcky-a-uvery/business-uver-nezajisteny']";
    String SHORTCUTS_LOANS_BUILDING_SAVINGS = "//div[@class='list_items__item__title']/a[@href='/pujcky-a-uvery/uver-ze-stavebniho-sporeni']";
    String SHORTCUTS_LOANS_BRIDGING = "//div[@id='xsellCards3']/a[@href='/pujcky-a-uvery/pujcka-pro-bydleni']";
    String SHORTCUTS_CREDIT_CARD = "//div[@class='list_items__item__title']/a[@href='/ucty-a-karty/kreditni-karta']";
    String SHORTCUTS_CREDIT_ACCOUNT = "//div[@class='list_items__item__title']/a[@href='/pujcky-a-uvery/kreditni-ucet']";
    //Submenu Mortgage loans
    String SHORTCUTS_MORTGAGE = "//div[@class='list_items__item__title']/a[@href='/hypoteky/hypoteka']";
    //Submenu Savings
    String SHORTCUTS_SAVING_ACCOUNT = "//a[@class='list_items__item-link' and @href='/sporeni-a-investice/sporici-ucet']";
    String SHORTCUTS_BUILDINGS_SAVINGS = "//a[@class='list_items__item-link' and @href='/sporeni-a-investice/stavebni-sporeni']";
    String SHORTCUTS_HOLDING_FUNDS = "//div[@class='list_items__item__title']/a[@href='/sporeni-a-investice/podilove-fondy']/span";
    String SHORTCUTS_SUPPLEMENTARY_RETIREMENT_SCHEMES = "//a[@class='list_items__item-link' and @href='/sporeni-a-investice/doplnkove-penzijni-sporeni']";
    //Submenu Others
    String SHORTCUTS_EXCHANGE_RATE = "//div[@class='list_items__item__title']/a[@class='page-name' and @href='/kurzovni-listek']/span";
    //Není naše -----------------------------------------------------------------
    String SHORTCUTS_ACCOUNTS_AND_CARDS = "//nav[@role='navigation']/ul/li[@class='nav__item nav--full '][1]";

    @Wait(SHORTCUTS_ACCOUNTS)
    @Click(SHORTCUTS_ACCOUNTS)
    HomePage openAccountsMenu();

    @Wait(SHORTCUTS_LOANS)
    @Click(SHORTCUTS_LOANS)
    HomePage openLoansMenu();

    @Wait(SHORTCUTS_MORTGAGE_LOANS)
    @Click(SHORTCUTS_MORTGAGE_LOANS)
    HomePage openMortgageLoansMenu();

    @Wait(SHORTCUTS_SAVINGS)
    @Click(SHORTCUTS_SAVINGS)
    HomePage openSavingsMenu();

    @Wait(SHORTCUTS_MORE)
    @Click(SHORTCUTS_MORE)
    HomePage openMoreMenu();
    //---------------------------------------------------------------------------
    @Wait(SHORTCUTS_CURRENT_ACCOUNT)
    @Click(SHORTCUTS_CURRENT_ACCOUNT)
    CurrentAccountPage openCurrentAccountPage();
    //---------------------------------------------------------------------------
    @Wait(SHORTCUTS_EXPRESS_LOANS)
    @Click(SHORTCUTS_EXPRESS_LOANS)
    ExpressLoanPage openExpressLoanPage();

    @Wait(REDUCE_OBLIGATIONS)
    @Click(REDUCE_OBLIGATIONS)
    UDCExpressLoanPage openUdcLoan();

    @Wait(SHORTCUTS_LOANS_BUSINESS)
    @Click(SHORTCUTS_LOANS_BUSINESS)
    BusinessLoanPage openExpressBusinessLoanPage();

    @Wait(SHORTCUTS_LOANS_BUILDING_SAVINGS)
    @Click(SHORTCUTS_LOANS_BUILDING_SAVINGS)
    BuildingSavingsLoanPage openBuildingSavingsLoanPage();

    @Wait(SHORTCUTS_LOANS_BRIDGING)
    @Click(SHORTCUTS_LOANS_BRIDGING)
    BridgingLoanPage openBridgingLoanPage();

    @Wait(SHORTCUTS_CREDIT_CARD)
    @Click(SHORTCUTS_CREDIT_CARD)
    CreditCardPage openCreditCardPage();

    @Wait(SHORTCUTS_CREDIT_ACCOUNT)
    @Click(SHORTCUTS_CREDIT_ACCOUNT)
    CreditAccountPage openCreditAccountPage();
    //---------------------------------------------------------------------------
    @Wait(SHORTCUTS_MORTGAGE)
    @Click(SHORTCUTS_MORTGAGE)
    MortgagePage openMortgagePage();
    //---------------------------------------------------------------------------
    @Wait(SHORTCUTS_SAVING_ACCOUNT)
    @Click(SHORTCUTS_SAVING_ACCOUNT)
    SavingAccountPage openSavingAccountPage();

    @Wait(SHORTCUTS_BUILDINGS_SAVINGS)
    @Click(SHORTCUTS_BUILDINGS_SAVINGS)
    BuildingSavingsPage openBuildingSavingsPage();

    @Wait(SHORTCUTS_HOLDING_FUNDS)
    @Click(SHORTCUTS_HOLDING_FUNDS)
    HoldingFundsPage openHoldingFundsPage();

    @Wait(SHORTCUTS_SUPPLEMENTARY_RETIREMENT_SCHEMES)
    @Click(SHORTCUTS_SUPPLEMENTARY_RETIREMENT_SCHEMES)
    SupplementaryRetirementSchemesPage openSupplementaryRetirementSchemesPage();
    //---------------------------------------------------------------------------
    @Wait(SHORTCUTS_EXCHANGE_RATE)
    @Click(SHORTCUTS_EXCHANGE_RATE)
    ExchangeRatesPage openExchangeRates();
    //Není naše -----------------------------------------------------------------
    @Click(SHORTCUTS_ACCOUNTS_AND_CARDS)
    ProductsPage goToAccountAndCards();
}