package cz.moneta.test.dsl.ufo.banka.pages.main;

import cz.moneta.test.harness.support.web.*;

import static cz.moneta.test.dsl.ufo.banka.pages.main.BAL001_S008_SummaryStartDocumentsPage.*;

@Wait(value = BAL001_S008_PAGE_LABEL_XPATH, by = Lookup.XPATH, waitSecondsForElement = 100)
@Wait(value = {CONTINUE_BUTTON, PRODUCTS_TABLE}, waitSecondsForElement = 100)
public interface BAL001_S008_SummaryStartDocumentsPage extends WebFlow<BAL001_S008_SummaryStartDocumentsPage> {
    String BAL001_S008_PAGE_LABEL_XPATH = "//div[text()='BAL001_S008']";
    String CONTINUE_BUTTON = "BAL001_S008_B004";
    String NEW_CURRENT_ACCOUNT_NUMBER_XPATH = "//table[@id='BAL001_S008_G002_UfoTable']//td[text()='BÚ']/parent::tr/td[4]";
    String NEW_SAVING_ACCOUNT_NUMBER_XPATH = "//table[@id='BAL001_S008_G002_UfoTable']//td[text()='SÚ Genius']/parent::tr/td[4]";
    String FIRST_NEW_PRODUCT_TITLE_XPATH = "//table[@id='BAL001_S008_G002_UfoTable']//td[1]";
    String NEW_SAVING_ACCOUNT_GOLD_NUMBER_XPATH = "//table[@id='BAL001_S008_G002_UfoTable']//td[text()='SÚ']/parent::tr/td[4]";
    String NEW_MUTUAL_FUNDS_NUMBER_XPATH = "//table[@id='BAL001_S008_G002_UfoTable']//td[text()='Podílové fondy']/parent::tr/td[4]";
    String NEW_MUTUAL_FUNDS_NUMBER = "BAL001_S008_B004";
    String NEW_ONE_TIME_TERM_DEPOSIT_NUMBER_XPATH = "//table[@id='BAL001_S008_G002_UfoTable']//td[text()='JTV']/parent::tr/td[4]";
    String NEW_ONE_TIME_TERM_DEPOSIT_NUMBER = "";
    String NEW_BANKKLIENT_NUMBER_XPATH = "//table[@id='BAL001_S008_G002_UfoTable']//td[text()='BKK']/parent::tr/td[4]";
    String NEW_BANKKLIENT_NUMBER = "BAL001_S008_B004";
    String PRODUCTS_TABLE = "BAL001_S008_G002_UfoTable";

    String ACCOUNT_NUMBER_KEY = "ACCOUNT_NUMBER";

    @GetElementContent(NEW_CURRENT_ACCOUNT_NUMBER_XPATH)
    String getBu();

    @StoreElementContent(storeKey = ACCOUNT_NUMBER_KEY, value = NEW_CURRENT_ACCOUNT_NUMBER_XPATH, by = Lookup.XPATH)
    @Log(value = NEW_CURRENT_ACCOUNT_NUMBER_XPATH, template = "Client current account number is {}", by = Lookup.XPATH)
    BAL001_S008_SummaryStartDocumentsPage storeCurrentAccountNumber();

    @Click(CONTINUE_BUTTON)
    BAL001_S008_SummaryStartDocumentsPageTransitions clickContinue();

    @Log(value = NEW_CURRENT_ACCOUNT_NUMBER_XPATH, by = Lookup.XPATH, template = "New current account number is {}")
    @StoreElementContent(storeKey = ACCOUNT_NUMBER_KEY, value = NEW_CURRENT_ACCOUNT_NUMBER_XPATH, by = Lookup.XPATH)
    BAL001_S008_SummaryStartDocumentsPage logAccountNumber();

    @Log(value = NEW_SAVING_ACCOUNT_NUMBER_XPATH, by = Lookup.XPATH, template = "New saving account number is {}")
    BAL001_S008_SummaryStartDocumentsPage logSavingAccountNumber();

    @CheckElementContent(value = FIRST_NEW_PRODUCT_TITLE_XPATH, by = Lookup.XPATH)
    BAL001_S008_SummaryStartDocumentsPage checkFirstNewProdcutTitle(String expectedTitle);

    @Log(value = NEW_SAVING_ACCOUNT_GOLD_NUMBER_XPATH, by = Lookup.XPATH, template = "New saving account number is {}")
    BAL001_S008_SummaryStartDocumentsPage logSavingAccountGoldNumber();

    @StoreElementContent(storeKey = NEW_MUTUAL_FUNDS_NUMBER, value = NEW_MUTUAL_FUNDS_NUMBER_XPATH, by = Lookup.XPATH)
    @Log(value = NEW_MUTUAL_FUNDS_NUMBER_XPATH, template = "Client mutual funds number is {}", by = Lookup.XPATH)
    BAL001_S008_SummaryStartDocumentsPage storeMutualFundsNumber();

    @StoreElementContent(storeKey = NEW_ONE_TIME_TERM_DEPOSIT_NUMBER, value = NEW_ONE_TIME_TERM_DEPOSIT_NUMBER_XPATH, by = Lookup.XPATH)
    @Log(value = NEW_ONE_TIME_TERM_DEPOSIT_NUMBER_XPATH, template = "Client one time term deposit number is {}", by = Lookup.XPATH)
    BAL001_S008_SummaryStartDocumentsPage storeOneTimeTermDepositNumber();

    @StoreElementContent(storeKey = NEW_BANKKLIENT_NUMBER, value = NEW_BANKKLIENT_NUMBER_XPATH, by = Lookup.XPATH)
    @Log(value = NEW_BANKKLIENT_NUMBER_XPATH, template = "Client bankklient number is {}", by = Lookup.XPATH)
    BAL001_S008_SummaryStartDocumentsPage storeBankklientNumber();
}
