package cz.moneta.test.dsl.ufo.banka.pages.products.sme;

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

import static cz.moneta.test.dsl.ufo.banka.pages.products.sme.KUL010_S001_FinancialSignpostPage.*;
import static cz.moneta.test.dsl.ufo.operations.shared.SharedElements.LOAD_IMG_DIV_CLASS;

@Wait(value = KUL010_S001_PAGE_LABEL_XPATH, by = Lookup.XPATH, waitSecondsForElement = 60)
@Wait(CONTINUE_BUTTON)
public interface KUL010_S001_FinancialSignpostPage extends WebFlow<KUL010_S001_FinancialSignpostPage> {
    String KUL010_S001_PAGE_LABEL_XPATH = "//div[text()='KUL010_S001']";
    String DP_LAST_YEAR_CONTINUE_BUTTON = "KUL010_S001_B005";
    String DP_YEAR_BEFORE_LAST_CONTINUE_BUTTON = "KUL010_S001_B006";
    String CONTINUE_BUTTON = "KUL010_S001_B019";
    String YEAR_BEFORE_LAST_INCOME_SELECT = "KUL010_S001_C001";
    String LAST_YEAR_INCOME_SELECT = "KUL010_S001_C002";
    String NUMBER_OF_MAIN_CUSTOMERS_INPUT = "KUL010_S001_E002";
    String BUSINESS_LOAN_OUTSIDE_MMB_INPUT = "KUL010_S001_E003";
    String MONTHLY_PAYMENTS_OUTSIDE_MMB_INPUT = "KUL010_S001_E020";
    String NETTO_INCOME_HOUSEHOLD_INPUT = "KUL010_S001_E004";
    String LAST_YEAR_INPUT = "KUL010_S001_E005";
    String INCOME_FROM_BUSINESS_INPUT = "KUL010_S001_E006";
    String GROSS_INCOME_INPUT = "KUL010_S001_E007";
    String TOTAL_ASSETS_INPUT = "KUL010_S001_E008";
    String PROFIT_INPUT = "KUL010_S001_E009";
    String YEAR_BEFORE_LAST_INPUT = "KUL010_S001_E010";
    String DEBTORS_COUNT_INPUT = "KUL010_S001_E018";
    String AMOUNT_OWED_SUMMARY_INPUT = "KUL010_S001_E001";
    String APPROXIMATE_BALANCES_ON_ALL_BANK_ACCOUNTS_INPUT = "KUL010_S001_E019";
    String OTHER_LIVING_COSTS_INPUT = "KUL010_S001_E015";
    String OTHER_MONTHLY_PAYMENTS_INPUT = "KUL010_S001_E016";
    String NO_PSD2_DATA_RADIO_XPATH = "//*[@id=\"KUL010_S001_R001\"]/tbody/tr/td[2]";
    String MAIN_CUSTOMER_NO_MORE_THAN_HALF_RADIO_XPATH = "//*[@id=\"KUL010_S001_R002\"]/tbody/tr/td[2]/span";
    String MAIN_CONTRACTOR_NO_MORE_THAT_HALF_RADIO_XPATH = "//*[@id=\"KUL010_S001_R003\"]/tbody/tr/td[2]/span";
    String YES_CLIENT_PROPERTY_RADIO_XPATH = "//*[@id=\"KUL010_S001_R004\"]/tbody/tr/td[1]/span";
    String YES_TAX_ADVISOR_RADIO_XPATH = "//*[@id=\"KUL010_S001_R005\"]/tbody/tr/td[1]/span";
    String YES_PSD2_DATA_RADIO = "KUL010_S001_R001_1";
    String YEAR_BEFORE_LAST_DP_XPATH = "//*[@id=\"KUL010_S001_G004_UfoTable\"]/tbody/tr/td[contains(text(),'%s')]";
    String LAST_YEAR_DP_XPATH = "//*[@id=\"KUL010_S001_G001_UfoTable\"]/tbody/tr/td[contains(text(),'%s')]";

    @Click(value = NO_PSD2_DATA_RADIO_XPATH, by = Lookup.XPATH)
    KUL010_S001_FinancialSignpostPage clickNoPsd2Data();

    @Click(YES_PSD2_DATA_RADIO)
    KUL010_S001_FinancialSignpostPage clickYesPsd2Data();

    @TypeInto(LAST_YEAR_INPUT)
    KUL010_S001_FinancialSignpostPage fillLastYear(String lastYear);

    @Select(LAST_YEAR_INCOME_SELECT)
    KUL010_S001_FinancialSignpostPage selectLastYearIncome(String lastYearIncome);

    @TypeInto(INCOME_FROM_BUSINESS_INPUT)
    KUL010_S001_FinancialSignpostPage fillIncomeFromBusiness(String incomeFromBusiness);

    @TypeInto(GROSS_INCOME_INPUT)
    KUL010_S001_FinancialSignpostPage fillGrossIncome(String grossIncome);

    @TypeInto(TOTAL_ASSETS_INPUT)
    KUL010_S001_FinancialSignpostPage fillTotalAssets(String totalAssets);

    @TypeInto(PROFIT_INPUT)
    KUL010_S001_FinancialSignpostPage fillProfit(String profit);

    @TypeInto(YEAR_BEFORE_LAST_INPUT)
    KUL010_S001_FinancialSignpostPage fillYearBeforeLast(String yearBeforeLast);

    @TypeInto(DEBTORS_COUNT_INPUT)
    KUL010_S001_FinancialSignpostPage fillDebtorsCount(String debtorsCount);

    @TypeInto(AMOUNT_OWED_SUMMARY_INPUT)
    KUL010_S001_FinancialSignpostPage fillAmountOwedSummary(String amountOwedSummary);

    @TypeInto(APPROXIMATE_BALANCES_ON_ALL_BANK_ACCOUNTS_INPUT)
    KUL010_S001_FinancialSignpostPage fillApproximateBalancesOnAllBankAccounts(String approximateBalancesOnAllBankAccounts);

    @Select(YEAR_BEFORE_LAST_INCOME_SELECT)
    KUL010_S001_FinancialSignpostPage selectYearBeforeLastIncome(String yearBeforeLastIncome);

    @TypeInto(value = NUMBER_OF_MAIN_CUSTOMERS_INPUT, clear = true)
    KUL010_S001_FinancialSignpostPage fillNumberOfMainCustomers(String numberOfMainCustomers);

    @Click(value = MAIN_CUSTOMER_NO_MORE_THAN_HALF_RADIO_XPATH, by = Lookup.XPATH)
    KUL010_S001_FinancialSignpostPage clickNoMoreThanHalfMainCustomer();

    @Click(value = MAIN_CONTRACTOR_NO_MORE_THAT_HALF_RADIO_XPATH, by = Lookup.XPATH)
    KUL010_S001_FinancialSignpostPage clickNoMoreThanHalfMainContractor();

    @TypeInto(BUSINESS_LOAN_OUTSIDE_MMB_INPUT)
    KUL010_S001_FinancialSignpostPage fillBusinessLoanOutsideMmb(String businessLoanOutsideMmb);

    @TypeInto(MONTHLY_PAYMENTS_OUTSIDE_MMB_INPUT)
    KUL010_S001_FinancialSignpostPage fillMonthlyPaymentsOutsideMMB(String monthlyPaymentsOutsideMMB);

    @Click(value = YES_CLIENT_PROPERTY_RADIO_XPATH, by = Lookup.XPATH)
    KUL010_S001_FinancialSignpostPage clickYesClientProperty();

    @Click(value = YES_TAX_ADVISOR_RADIO_XPATH, by = Lookup.XPATH)
    KUL010_S001_FinancialSignpostPage clickYesTaxAdvisor();

    @TypeInto(NETTO_INCOME_HOUSEHOLD_INPUT)
    KUL010_S001_FinancialSignpostPage fillNettoIncomeOfHousehold(String nettoIncomeOfHousehold);

    @TypeInto(OTHER_LIVING_COSTS_INPUT)
    KUL010_S001_FinancialSignpostPage fillOtherLivingCosts(String otherLivingCosts);

    @TypeInto(OTHER_MONTHLY_PAYMENTS_INPUT)
    KUL010_S001_FinancialSignpostPage fillOtherMonthlyPayments(String otherMonthlyPayments);

    @Click(value = LAST_YEAR_DP_XPATH, by = Lookup.XPATH, isStringDynamicXpath = true)
    @Click(value = DP_LAST_YEAR_CONTINUE_BUTTON, andWait = @Wait(value = LOAD_IMG_DIV_CLASS, by = Lookup.CLASSNAME, until = Until.GONE, waitSecondsForElement = 80))
    KUL010_S001_FinancialSignpostPage clickLastYearDp(String lastYear);

    @Click(value = YEAR_BEFORE_LAST_DP_XPATH, by = Lookup.XPATH, isStringDynamicXpath = true)
    @Click(value = DP_YEAR_BEFORE_LAST_CONTINUE_BUTTON, andWait = @Wait(value = LOAD_IMG_DIV_CLASS, by = Lookup.CLASSNAME, until = Until.GONE, waitSecondsForElement = 80))
    KUL010_S001_FinancialSignpostPage clickYearBeforeLastDp(String yearBeforeLast);

    @Click(CONTINUE_BUTTON)
    KUL006_S001_ListOfPersonsOnRequestPage continueToListOfPersonsOnRequestPage();
}
