package cz.moneta.test.dsl.ufo.banka.pages.fop;

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

import static cz.moneta.test.dsl.ufo.banka.pages.fop.CIF070_S001_IdentificationDataPage.*;
import static cz.moneta.test.dsl.ufo.operations.shared.SharedElements.*;

@Wait(value = CIF070_S001_PAGE_LABEL_XPATH, by = Lookup.XPATH, waitSecondsForElement = 60)
@Wait(value = DISABLED_CONTINUE_BUTTON)
public interface CIF070_S001_IdentificationDataPage extends WebFlow<CIF070_S001_IdentificationDataPage> {
    String CIF070_S001_PAGE_LABEL_XPATH = "//div[text()='CIF070_S001']";
    String DISABLED_CONTINUE_BUTTON = "CIF070_S001_X059";

    String CONTINUE_BUTTON = "CIF070_S001_B002";
    String CZECH_FLAG_COUNTRY_OF_BIRTH_BUTTON = "CIF070_S001_B004";
    String UNIFIED_ADDRESS_LOOKUP_BUTTON = "CIF070_S001_B005";
    String CZECH_PERMANENT_RESIDENCY_BUTTON = "CIF070_S001_B006";
    String CZECH_FLAG_SECOND_ID_COUNTRY_ISSUE_BUTTON = "CIF070_S001_B008";
    String ADDRESS_LOOKUP_FLOAT_BUTTON = "CIF070_S001_B011";
    String FOUND_ADDRESS_SELECT_BUTTON = "CIF070_S001_B012";

    String SECOND_OTHER_ID_SELECT = "CIF070_S001_C003";

    String FIRST_NAME_INPUT = "CIF070_S001_E001";
    String LAST_NAME_INPUT = "CIF070_S001_E002";
    String BIRTH_DATE_INPUT = "CIF070_S001_E003";
    String BIRTH_PLACE_INPUT = "CIF070_S001_E004";
    String ID_VALID_TILL_INPUT = "CIF070_S001_E005";
    String ID_NUMBER_INPUT = "CIF070_S001_E006";
    String BIRTH_NUMBER_INPUT = "CIF070_S001_E007";
    String ID_CONTROL_NUMBER_INPUT = "CIF070_S001_E008";
    String SECOND_OTHER_ID_NUMBER_INPUT = "CIF070_S001_E015";
    String SECOND_OTHER_ID_VALID_TILL_INPUT = "CIF070_S001_E016";
    String SEARCH_ADDRESS_INPUT = "CIF070_S001_E017";
    String ACTUAL_RESIDENCY_SINCE_INPUT = "CIF070_S001_E018";

    String FIRST_FOUND_ADDRESS_RADIO = "CIF070_S001_G001-0";
    String GDPR_CHECKBOX = "CIF070_S001_H001_1";

    String MALE_GENDER_RADIO = "CIF070_S001_R001_1";
    String FEMALE_GENDER_RADIO = "CIF070_S001_R001_2";

    @TypeInto(value = FIRST_NAME_INPUT, clear = true)
    CIF070_S001_IdentificationDataPage fillFirstName(String firstName);

    @TypeInto(value = LAST_NAME_INPUT, clear = true)
    CIF070_S001_IdentificationDataPage fillLastName(String lastName);

    @TypeInto(BIRTH_DATE_INPUT)
    CIF070_S001_IdentificationDataPage fillBirthDate(String birthDate);

    @TypeInto(BIRTH_PLACE_INPUT)
    CIF070_S001_IdentificationDataPage fillBirthPlace(String birthPlace);

    @Click(CZECH_FLAG_COUNTRY_OF_BIRTH_BUTTON)
    CIF070_S001_IdentificationDataPage clickCzechCountryOfBirth();

    @TypeInto(ID_VALID_TILL_INPUT)
    CIF070_S001_IdentificationDataPage fillIdValidTill(String idValidTill);

    @TypeInto(ID_NUMBER_INPUT)
    CIF070_S001_IdentificationDataPage fillIdNumber(String idNumber);

    @TypeInto(BIRTH_NUMBER_INPUT)
    CIF070_S001_IdentificationDataPage fillBirthNumber(String birthNumber);

    @TypeInto(ID_CONTROL_NUMBER_INPUT)
    CIF070_S001_IdentificationDataPage fillIdControlNumber(String idControlNumber);

    @Click(UNIFIED_ADDRESS_LOOKUP_BUTTON)
    CIF070_S001_IdentificationDataPage clickMagnifyingGlass();

    @Wait(explicitWaitSeconds = 2)
    @TypeInto(value = SEARCH_ADDRESS_INPUT, clear = true)
    CIF070_S001_IdentificationDataPage typeAddress(String searchAddress);

    @Click(value = ADDRESS_LOOKUP_FLOAT_BUTTON, andWait = @Wait(value = FIRST_FOUND_ADDRESS_RADIO, until = Until.VISIBLE))
    CIF070_S001_IdentificationDataPage clickSearchForAddress();

    @Click(FIRST_FOUND_ADDRESS_RADIO)
    @Click(value = FOUND_ADDRESS_SELECT_BUTTON, andWait = @Wait(value = LOAD_IMG_DIV_CLASS, by = Lookup.CLASSNAME, until = Until.GONE))
    CIF070_S001_IdentificationDataPage clickFirstFoundAddressAndConfirm();

    @Click(CZECH_PERMANENT_RESIDENCY_BUTTON)
    CIF070_S001_IdentificationDataPage clickCzechFlagPermanentResidency();

    @TypeInto(ACTUAL_RESIDENCY_SINCE_INPUT)
    CIF070_S001_IdentificationDataPage fillActualResidencySince(String actualResidencySince);

    @Click(value = MALE_GENDER_RADIO, jsClick = true)
    CIF070_S001_IdentificationDataPage clickMaleGender();

    @Click(value = FEMALE_GENDER_RADIO, jsClick = true)
    CIF070_S001_IdentificationDataPage clickFemaleGender();

    @Select(SECOND_OTHER_ID_SELECT)
    CIF070_S001_IdentificationDataPage selectSecondId(String secondId);

    @TypeInto(SECOND_OTHER_ID_NUMBER_INPUT)
    CIF070_S001_IdentificationDataPage fillSecondIdNumber(String secondIdNumber);

    @TypeInto(SECOND_OTHER_ID_VALID_TILL_INPUT)
    CIF070_S001_IdentificationDataPage fillSecondIdValidTill(String secondIdValidTill);

    @Click(CZECH_FLAG_SECOND_ID_COUNTRY_ISSUE_BUTTON)
    CIF070_S001_IdentificationDataPage clickCzechFlagSecondId();

    @Click(value = GDPR_CHECKBOX, jsClick = true)
    CIF070_S001_IdentificationDataPage clickGdprCheckbox();

    @Click(CONTINUE_BUTTON)
    CIF071_S001_PersonalAndContactDataPage continueToPersonalAndContactDataPage();
}
