package cz.moneta.test.dsl.ib.loans.expressloan.dataCheckPart;

import cz.moneta.test.dsl.ib.IbPageFlow;
import cz.moneta.test.dsl.ib.loans.expressloan.loanSummary.IbSummaryExpressLoanPage;
import cz.moneta.test.harness.support.web.Click;
import cz.moneta.test.harness.support.web.Lookup;
import cz.moneta.test.harness.support.web.Select;
import cz.moneta.test.harness.support.web.TypeInto;
import cz.moneta.test.harness.support.web.Wait;

import static cz.moneta.test.dsl.ib.loans.expressloan.dataCheckPart.IbExpressLoanEmploymentAndIncomeExpenses.EMPLOYER_DESCRIPTIVE_NUMBER;
import static cz.moneta.test.dsl.ib.loans.expressloan.dataCheckPart.IbExpressLoanEmploymentAndIncomeExpenses.EMPLOYER_ID;
import static cz.moneta.test.dsl.ib.loans.expressloan.dataCheckPart.IbExpressLoanEmploymentAndIncomeExpenses.EMPLOYER_NAME;
import static cz.moneta.test.dsl.ib.loans.expressloan.dataCheckPart.IbExpressLoanEmploymentAndIncomeExpenses.EMPLOYER_ORIENTATION_NUMBER;
import static cz.moneta.test.dsl.ib.loans.expressloan.dataCheckPart.IbExpressLoanEmploymentAndIncomeExpenses.EMPLOYER_STREET;
import static cz.moneta.test.dsl.ib.loans.expressloan.dataCheckPart.IbExpressLoanEmploymentAndIncomeExpenses.EMPLOYER_TOWN;
import static cz.moneta.test.dsl.ib.loans.expressloan.dataCheckPart.IbExpressLoanEmploymentAndIncomeExpenses.EMPLOYER_ZIP;
import static cz.moneta.test.dsl.ib.loans.expressloan.dataCheckPart.IbExpressLoanEmploymentAndIncomeExpenses.EMPLOYMENT_SINCE;
import static cz.moneta.test.dsl.ib.loans.expressloan.dataCheckPart.IbExpressLoanEmploymentAndIncomeExpenses.EMPLOYMENT_TYPE_SELECT;
import static cz.moneta.test.dsl.ib.loans.expressloan.dataCheckPart.IbExpressLoanEmploymentAndIncomeExpenses.OCCUPATION_SELECT;
import static cz.moneta.test.dsl.ib.loans.expressloan.dataCheckPart.IbExpressLoanEmploymentAndIncomeExpenses.OTHER_LOANS;
import static cz.moneta.test.dsl.ib.loans.expressloan.dataCheckPart.IbExpressLoanEmploymentAndIncomeExpenses.WORK_PHONE;

@Wait(value = {EMPLOYMENT_TYPE_SELECT, OCCUPATION_SELECT, EMPLOYMENT_SINCE, EMPLOYER_NAME, EMPLOYER_ID, EMPLOYER_STREET, EMPLOYER_DESCRIPTIVE_NUMBER, EMPLOYER_ORIENTATION_NUMBER, EMPLOYER_TOWN, EMPLOYER_ZIP, WORK_PHONE, OTHER_LOANS}, by = Lookup.ID)
public interface IbExpressLoanEmploymentAndIncomeExpenses extends IbPageFlow<IbExpressLoanEmploymentAndIncomeExpenses> {
    String EMPLOYMENT_TYPE_SELECT = "employmentType";
    String OCCUPATION_SELECT = "occupation";
    String EMPLOYMENT_SINCE = "employmentSince";
    String EMPLOYER_NAME = "employerName";
    String EMPLOYER_ID = "employerId";
    String EMPLOYER_STREET = "employerStreet";
    String EMPLOYER_DESCRIPTIVE_NUMBER = "employerDescriptiveNumber";
    String EMPLOYER_ORIENTATION_NUMBER = "employerOrientationNumber";
    String EMPLOYER_ZIP = "employerZip";
    String EMPLOYER_TOWN = "employerTown";
    String EMPLOYER_COUNTRY_SELECT = "employerCountry";
    String WORK_PHONE = "workPhone";
    String EMPLOYMENT_COUNT = "employmentCount";
    String AVERAGE_INCOME = "averageIncome";
    String AVERAGE_HOME_INCOME = "averageHomeIncome";
    String OTHER_LOANS = "otherLoans";
    String OTHER_COSTS = "otherCosts";
    String WAGES_DEDUCTION = "wagesDeduction";
    String CONTINUE_CHECKBOX_1 = "continueCheckBox_1";
    String CONTINUE_BUTTON = "continueButton";

    String NOTICE_PERIOD_NONE = "//tr[@id = '_tr_noticePeriodNone']//input";

    String BACK_BUTTON = "//a[text() = 'ZPĚT']";

    @Wait(value = OCCUPATION_SELECT, by = Lookup.ID)
    @Select(value = OCCUPATION_SELECT, by = Lookup.ID)
    IbExpressLoanEmploymentAndIncomeExpenses secOccupationType(String occupationType);

    @Wait(value = EMPLOYMENT_SINCE, by = Lookup.ID)
    @TypeInto(value = EMPLOYMENT_SINCE, by = Lookup.ID, clear = true)
    IbExpressLoanEmploymentAndIncomeExpenses setEmploymentSince(String employmentFrom);

    @Wait(value = EMPLOYMENT_COUNT, by = Lookup.ID)
    @Select(value = EMPLOYMENT_COUNT, by = Lookup.ID)
    IbExpressLoanEmploymentAndIncomeExpenses setEmploymentCount(String employmentCount);

    @Wait(value = AVERAGE_INCOME, by = Lookup.ID)
    @TypeInto(value = AVERAGE_INCOME, by = Lookup.ID, clear = true)
    IbExpressLoanEmploymentAndIncomeExpenses typeAverageIncome(String averageIncome);

    @Wait(value = AVERAGE_HOME_INCOME, by = Lookup.ID)
    @TypeInto(value = AVERAGE_HOME_INCOME, by = Lookup.ID, clear = true)
    IbExpressLoanEmploymentAndIncomeExpenses typeAverageHomeIncome(String averageHomeIncome);

    @Wait(value = OTHER_LOANS, by = Lookup.ID)
    @TypeInto(value = OTHER_LOANS, by = Lookup.ID, clear = true)
    IbExpressLoanEmploymentAndIncomeExpenses typeOtherLoans(String otherLoans);

    @Wait(value = OTHER_COSTS, by = Lookup.ID)
    @TypeInto(value = OTHER_COSTS, by = Lookup.ID, clear = true)
    IbExpressLoanEmploymentAndIncomeExpenses typeOtherCosts(String otherCosts);

    @Wait(value = WAGES_DEDUCTION, by = Lookup.ID)
    @TypeInto(value = WAGES_DEDUCTION, by = Lookup.ID, clear = true)
    IbExpressLoanEmploymentAndIncomeExpenses typeWagesDeduction(String wagesDeduction);

    @Wait(NOTICE_PERIOD_NONE)
    @Click(NOTICE_PERIOD_NONE)
    IbExpressLoanEmploymentAndIncomeExpenses setNoneNoticePeriod();

    @Wait(BACK_BUTTON)
    @Click(value = BACK_BUTTON, jsClick = true)
    IbExpressLoanPermanentResidenceAndContactAddressPage backToPermanentResidenceAndContactAddress();

    @Wait(value = CONTINUE_CHECKBOX_1, by = Lookup.ID)
    @Click(value = CONTINUE_CHECKBOX_1, by = Lookup.ID, jsClick = true)
    @Click(value = CONTINUE_BUTTON, by = Lookup.ID)
    IbSummaryExpressLoanPage agreementCheckboxAndContinue();
}