package cz.moneta.test.dsl.ib.insurance.accident;

import cz.moneta.test.dsl.ib.IbPageFlow;
import cz.moneta.test.dsl.ib.components.MainMenu;
import cz.moneta.test.harness.support.web.Click;
import cz.moneta.test.harness.support.web.TypeInto;
import cz.moneta.test.harness.support.web.Wait;

import static cz.moneta.test.dsl.ib.insurance.accident.AccidentInsuranceCreatePage.CONTINUE_BUTTON;

@Wait(CONTINUE_BUTTON)
public interface AccidentInsuranceCreatePage extends IbPageFlow<AccidentInsuranceCreatePage>, MainMenu {

    String ACCOUNT_SELECT = "//select[@name='accountNumber']";
    String JUNIOR_INSURANCE_SELECT = "//select[@name='insuranceType']/option[@value='7713002']";
    String ADULT_INSURANCE_SELECT = "//select[@name='insuranceType']/option[@value='7713005']";
    String FAMILY_INSURANCE_SELECT = "//select[@name='insuranceType']/option[@value='7713006']";
    String FIRST_NAME_INPUT = "//input[@name='firstName']";
    String LAST_NAME_INPUT = "//input[@name='lastName']";
    String IDENTIFICATION_NUMBER_INPUT = "//input[@name='personalNumber']";
    String DISABLEMENT_AGREEMENT_CHECKBOX = "//input[@id='invalidityYes']";
    String CHILDREN_AGREEMENT_CHECKBOX = "//input[@id='childrenYes']";
    String LICENCE_AGREEMENT_CHECKBOX = "//input[@name='licenceAgreement1']";
    String INSURANCE_AGREEMENT_CHECKBOX = "//input[@name='licenceAgreement2']";
    String CONTINUE_BUTTON = "//a[@id='btnContinue']";
    String SMS_CODE_INPUT = "//input[@name='mobileKey']";
    String SEND_BUTTON = "//a[@id='btnVerify']";

    @Click(ACCOUNT_SELECT)
    AccidentInsuranceCreatePage clickAccountSelect();

    @Click(JUNIOR_INSURANCE_SELECT)
    AccidentInsuranceCreatePage clickInsuranceSelectJunior();

    @Click(ADULT_INSURANCE_SELECT)
    AccidentInsuranceCreatePage clickInsuranceSelectAdult();

    @Click(FAMILY_INSURANCE_SELECT)
    AccidentInsuranceCreatePage clickInsuranceSelectFamily();

    @TypeInto(FIRST_NAME_INPUT)
    AccidentInsuranceCreatePage fillToFirstName(String firstName);

    @TypeInto(LAST_NAME_INPUT)
    AccidentInsuranceCreatePage fillToLastName(String lastName);

    @TypeInto(IDENTIFICATION_NUMBER_INPUT)
    AccidentInsuranceCreatePage fillToIdentificationNumberName(String identificationNumber);

    @Click(CHILDREN_AGREEMENT_CHECKBOX)
    AccidentInsuranceCreatePage clickChildrenAgreement();

    @Click(DISABLEMENT_AGREEMENT_CHECKBOX)
    AccidentInsuranceCreatePage clickInvalidityAgreement();

    @Click(LICENCE_AGREEMENT_CHECKBOX)
    AccidentInsuranceCreatePage clickLicenceAgreement();

    @Click(INSURANCE_AGREEMENT_CHECKBOX)
    AccidentInsuranceCreatePage clickInsuranceAgreement();

    @Click(CONTINUE_BUTTON)
    AccidentInsuranceCreatePage clickContinueButton();

    @TypeInto(SMS_CODE_INPUT)
    AccidentInsuranceCreatePage typeSmsCode(String smsCode);

    @Click(SEND_BUTTON)
    AccidentInsuranceConfirmationPage clickSend();
}
