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.KUL003_S001_FlexiBusinessProductDetail.*;
import static cz.moneta.test.dsl.ufo.operations.shared.SharedElements.LOAD_IMG_DIV_CLASS;

@Wait(value = KUL003_S001_PAGE_LABEL_XPATH, by = Lookup.XPATH, waitSecondsForElement = 60)
@Wait(CONTINUE_BUTTON)
public interface KUL003_S001_FlexiBusinessProductDetail extends WebFlow<KUL003_S001_FlexiBusinessProductDetail> {
    String KUL003_S001_PAGE_LABEL_XPATH = "//div[text()='KUL003_S001']";

    String CONTINUE_BUTTON = "KUL003_S001_B001";
    String LOAD_TURNOVERS_BUTTON = "KUL003_S001_B004";

    String CURRENT_ACCOUNT_SELECT = "KUL003_S001_C001";
    String FIRST_CURRENT_ACCOUNT = " //*[@id='KUL003_S001_C001']/option[2]";
    String OTHER_BANK_STATEMENTS_SELECT = "KUL003_S001_C002";
    String NEAREST_MONTH_XPATH_SELECT = "//*[@id=\"KUL003_S001_C003\"]/option[3]";

    String REQUIRED_LOAN_AMOUNT_INPUT = "KUL003_S001_E001";
    String NUMBER_OF_ASSOCIATION_MEMBERS_INPUT = "KUL003_S001_E007";
    String YEAR_INPUT = "KUL003_S001_E025";
    String ACCOUNT_NUMBER_INPUT = "KUL003_S001_E026";
    String BANK_CODE_INPUT = "KUL003_S001_E027";
    String FIRST_TURNOVER_INPUT = "KUL003_S001_E028";
    String SECOND_TURNOVER_INPUT = "KUL003_S001_E029";
    String THIRD_TURNOVER_INPUT = "KUL003_S001_E030";

    String NO_FOP_ASSOCIATION_RADIO = "KUL003_S001_R002_0";
    String YES_FOP_ASSOCIATION_RADIO = "KUL003_S001_R002_1";

    @TypeInto(value = REQUIRED_LOAN_AMOUNT_INPUT, andWait = @Wait(value = LOAD_IMG_DIV_CLASS, by = Lookup.CLASSNAME, until = Until.GONE, waitSecondsForElement = 60))
    KUL003_S001_FlexiBusinessProductDetail fillRequiredLoanAmount(String requiredLoanAmount);

    @Click(value = NO_FOP_ASSOCIATION_RADIO, andWait = @Wait(value = LOAD_IMG_DIV_CLASS, by = Lookup.CLASSNAME, until = Until.GONE, waitSecondsForElement = 60))
    KUL003_S001_FlexiBusinessProductDetail clickNoFopAssociation();

    @Click(value = YES_FOP_ASSOCIATION_RADIO, andWait = @Wait(value = LOAD_IMG_DIV_CLASS, by = Lookup.CLASSNAME, until = Until.GONE, waitSecondsForElement = 60))
    KUL003_S001_FlexiBusinessProductDetail clickYesFopAssociation();

    @TypeInto(NUMBER_OF_ASSOCIATION_MEMBERS_INPUT)
    KUL003_S001_FlexiBusinessProductDetail fillNumberOfAssociationMembers(String numberOfAssociationMembers);

    @Click(value = CURRENT_ACCOUNT_SELECT, andWait = @Wait(value = LOAD_IMG_DIV_CLASS, by = Lookup.CLASSNAME, until = Until.GONE, waitSecondsForElement = 60))
    @Click(value = FIRST_CURRENT_ACCOUNT, by = Lookup.XPATH)
    KUL003_S001_FlexiBusinessProductDetail selectFirstCurrentAccount();

    @Select(value = OTHER_BANK_STATEMENTS_SELECT, andWait = @Wait(value = LOAD_IMG_DIV_CLASS, by = Lookup.CLASSNAME, until = Until.GONE, waitSecondsForElement = 60))
    KUL003_S001_FlexiBusinessProductDetail selectOtherBankStatements(String otherBankStatements);

    @Click(value = NEAREST_MONTH_XPATH_SELECT, by = Lookup.XPATH, andWait = @Wait(value = LOAD_IMG_DIV_CLASS, by = Lookup.CLASSNAME, until = Until.GONE, waitSecondsForElement = 60))
    KUL003_S001_FlexiBusinessProductDetail selectMonth();

    @TypeInto(YEAR_INPUT)
    KUL003_S001_FlexiBusinessProductDetail fillTurnoverYear();

    @TypeInto(FIRST_TURNOVER_INPUT)
    KUL003_S001_FlexiBusinessProductDetail fillFirstTurnover(String firstTurnover);

    @TypeInto(SECOND_TURNOVER_INPUT)
    KUL003_S001_FlexiBusinessProductDetail fillSecondTurnover(String secondTurnover);

    @TypeInto(THIRD_TURNOVER_INPUT)
    KUL003_S001_FlexiBusinessProductDetail fillThirdTurnover(String thirdTurnover);

    @TypeInto(ACCOUNT_NUMBER_INPUT)
    KUL003_S001_FlexiBusinessProductDetail fillAccountNumber(String accountNumber);

    @TypeInto(BANK_CODE_INPUT)
    KUL003_S001_FlexiBusinessProductDetail fillBankCode(String bankCode);

    @Click(value = LOAD_TURNOVERS_BUTTON, jsClick = true, andWait = @Wait(value = LOAD_IMG_DIV_CLASS, by = Lookup.CLASSNAME, until = Until.GONE, waitSecondsForElement = 60))
    KUL003_S001_FlexiBusinessProductDetail clickLoadTurnovers();

    @Click(value = CONTINUE_BUTTON, jsClick = true)
    KUL003_S001_FlexiBusinessProductDetailTransitions clickContinue();
}
