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

import cz.moneta.test.dsl.ufo.banka.pages.fon.DMS070_S001_ScanDocumentsPage;
import cz.moneta.test.harness.support.web.*;

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

@Wait(value = CIF069_S001_PAGE_LABEL_XPATH, by = Lookup.XPATH)
@Wait(DISABLED_CONTINUE_BUTTON)
public interface CIF069_S001_CreateNewAcceleratedCifPage extends WebFlow<CIF069_S001_CreateNewAcceleratedCifPage> {
    String CIF069_S001_PAGE_LABEL_XPATH = "//div[text()='CIF069_S001']";
    String DISABLED_CONTINUE_BUTTON = "CIF069_S001_X051";

    String CZECH_FLAG_ADDRESS_BUTTON = "CIF069_S001_B001";
    String CONTINUE_BUTTON = "CIF069_S001_B003";
    String CZECH_FLAG_ESTABLISHMENT_BUTTON = "CIF069_S001_B004";
    String CZECH_FLAG_TAX_RESIDENCY_BUTTON = "CIF069_S001_B005";
    String ADDRESS_LOOKUP_FLOAT_BUTTON = "CIF069_S001_B006";
    String UNIFIED_ADDRESS_LOOKUP_BUTTON = "CIF069_S001_B008";
    String FOUND_ADDRESS_SELECT_BUTTON = "CIF069_S001_B012";

    String RESIDENCY_COUNTRY_SELECT = "CIF069_S001_C001";
    String ECONOMICAL_SECTOR_SELECT = "CIF069_S001_C009";
    String NUMBER_OF_EMPLOYEES_SELECT = "CIF069_S001_C010";

    String SEARCH_ADDRESS_INPUT = "CIF069_S001_E001";
    String COMPANY_NAME_INPUT = "CIF069_S001_E005";
    String STREET_INPUT = "CIF069_S001_E010";
    String DESCRIPTIVE_NUMBER_INPUT = "CIF069_S001_E013";
    String BUSINESS_FOUNDED_DATE_INPUT = "CIF069_S001_E017";
    String LEGAL_FORM_INPUT = "CIF069_S001_E018";
    String OKEC_CODE_INPUT = "CIF069_S001_E020";

    String FIRST_FOUND_ADDRESS_RADIO = "CIF069_S001_G001-0";

    @TypeInto(COMPANY_NAME_INPUT)
    CIF069_S001_CreateNewAcceleratedCifPage fillCompanyName(String companyName);

    @TypeInto(STREET_INPUT)
    CIF069_S001_CreateNewAcceleratedCifPage fillStreet(String street);

    @TypeInto(DESCRIPTIVE_NUMBER_INPUT)
    CIF069_S001_CreateNewAcceleratedCifPage fillDescriptiveNumber(String descriptiveNumber);

    @Click(ADDRESS_LOOKUP_FLOAT_BUTTON)
    CIF069_S001_CreateNewAcceleratedCifPage clickMagnifyingGlass();

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

    @Click(value = UNIFIED_ADDRESS_LOOKUP_BUTTON, andWait = @Wait(value = FIRST_FOUND_ADDRESS_RADIO, until = Until.VISIBLE))
    CIF069_S001_CreateNewAcceleratedCifPage 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))
    CIF069_S001_CreateNewAcceleratedCifPage clickFirstFoundAddressAndConfirm();

    @Click(value = CZECH_FLAG_ADDRESS_BUTTON, jsClick = true)
    CIF069_S001_CreateNewAcceleratedCifPage clickCzechFlagForBusinessAddress();

    @TypeInto(BUSINESS_FOUNDED_DATE_INPUT)
    CIF069_S001_CreateNewAcceleratedCifPage fillBusinessFoundedDate(String businessFoundedDate);

    @TypeInto(LEGAL_FORM_INPUT)
    CIF069_S001_CreateNewAcceleratedCifPage fillLegalForm(String legalForm);

    @TypeInto(OKEC_CODE_INPUT)
    CIF069_S001_CreateNewAcceleratedCifPage fillOkecCode(String okecCode);

    @Select(ECONOMICAL_SECTOR_SELECT)
    CIF069_S001_CreateNewAcceleratedCifPage selectEconomicalSector(String economicalSector);

    @Click(value = CZECH_FLAG_TAX_RESIDENCY_BUTTON, jsClick = true)
    CIF069_S001_CreateNewAcceleratedCifPage clickCzechFlagTaxResidency();

    @Click(value = CZECH_FLAG_ESTABLISHMENT_BUTTON, jsClick = true)
    CIF069_S001_CreateNewAcceleratedCifPage clickCzechFlagEstablishment();

    @Select(NUMBER_OF_EMPLOYEES_SELECT)
    CIF069_S001_CreateNewAcceleratedCifPage selectNumberOfEmployees(String numberOfEmployees);

    @Click(CONTINUE_BUTTON)
    DMS070_S001_ScanDocumentsPage continueToScanDocumentsPage();
}
