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

import cz.moneta.test.dsl.ib.IbPageFlow;
import cz.moneta.test.dsl.ib.loans.expressloan.IbYourExpressLoanInformationComponent;
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.PersonalDataExpressLoanPage.BIRTH_NUMBER;
import static cz.moneta.test.dsl.ib.loans.expressloan.dataCheckPart.PersonalDataExpressLoanPage.FIRST_NAME;
import static cz.moneta.test.dsl.ib.loans.expressloan.dataCheckPart.PersonalDataExpressLoanPage.LAST_NAME;
import static cz.moneta.test.dsl.ib.loans.expressloan.dataCheckPart.PersonalDataExpressLoanPage.PHONE_NUMBER;
import static cz.moneta.test.dsl.ib.loans.expressloan.dataCheckPart.PersonalDataExpressLoanPage.PRIMARY_ID_COUNTRY_SELECT;
import static cz.moneta.test.dsl.ib.loans.expressloan.dataCheckPart.PersonalDataExpressLoanPage.PRIMARY_ID_NUMBER;
import static cz.moneta.test.dsl.ib.loans.expressloan.dataCheckPart.PersonalDataExpressLoanPage.PRIMARY_ID_VALIDITY;

@Wait(value = {FIRST_NAME, LAST_NAME, BIRTH_NUMBER, PRIMARY_ID_NUMBER, PRIMARY_ID_VALIDITY, PRIMARY_ID_COUNTRY_SELECT, PHONE_NUMBER}, by = Lookup.ID)
public interface PersonalDataExpressLoanPage extends IbPageFlow<PersonalDataExpressLoanPage>, IbYourExpressLoanInformationComponent<PersonalDataExpressLoanPage> {

    String FIRST_NAME = "firstName";
    String LAST_NAME = "lastName";
    String BIRTH_NUMBER = "birthNumber";
    String PRIMARY_ID_NUMBER = "primaryIdentificationNumber";
    String PRIMARY_ID_VALIDITY = "primaryIdentificationValidity";
    String PRIMARY_ID_COUNTRY_SELECT = "primaryIdentificationCountry";
    String SECONDARY_ID_TYPE_SELECT = "secondaryIdentificationType";
    String EMAIL = "email";
    String PHONE_NUMBER = "phoneNumber";
    String CONTINUE_BUTTON = "continueButton";

    @Wait(value = SECONDARY_ID_TYPE_SELECT, by = Lookup.ID)
    @Select(value = SECONDARY_ID_TYPE_SELECT, by = Lookup.ID)
    PersonalDataExpressLoanPage selectSecondaryIdType(String documentType);

    @Wait(value = EMAIL, by = Lookup.ID)
    @TypeInto(value = EMAIL, by = Lookup.ID, clear = true)
    PersonalDataExpressLoanPage setEmail(String email);

    @Wait(value = CONTINUE_BUTTON, by = Lookup.ID)
    @Click(value = CONTINUE_BUTTON, by = Lookup.ID)
    IbExpressLoanAdditionalInformationPage continueToAdditionalInformation();

}
