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.CIF001_S003_CreateNewCompanyCifPage.*;
import static cz.moneta.test.dsl.ufo.operations.shared.SharedElements.*;

@Wait(value = CIF001_S003_PAGE_LABEL_XPATH, by = Lookup.XPATH, waitSecondsForElement = 60)
@Wait(value = {BUSINESS_NAME_INPUT, SUBMIT_BUTTON}, until = Until.VISIBLE, waitSecondsForElement = 60)
public interface CIF001_S003_CreateNewCompanyCifPage extends WebFlow<CIF001_S003_CreateNewCompanyCifPage> {

    String CIF001_S003_PAGE_LABEL_XPATH = "//div[text()='CIF001_S003']";

    String BUSINESS_NAME_INPUT = "CIF001_S003_E018";
    String FIRST_NAME_INPUT = "CIF001_S003_E019";
    String TIN_INPUT = "CIF001_S003_E003";
    String STREET_NAME_INPUT = "CIF001_S003_E004";
    String LAND_REGISTRATION_INPUT = "CIF001_S003_E006";
    String STREET_NUM_INPUT = "CIF001_S003_E022";
    String CITY_NAME_INPUT = "CIF001_S003_E023";
    String ZIP_CODE_INPUT = "CIF001_S003_E024";
    String EMAIL_INPUT = "CIF001_S003_E014";
    String MOBILE_PHONE_INPUT = "CIF001_S003_E015";
    String ABBREVIATED_NAME_INPUT = "CIF001_S003_E019";
    String OKEC_CODE_INPUT = "CIF001_S003_E021";
    String CITY_DISTRICT_INPUT = "CIF001_S003_E026";
    String LEGAL_FORM_INPUT = "CIF001_S003_E020";
    String COURT_DEPARTMENT_INPUT = "CIF001_S003_E010";
    String COURT_INSERT_INPUT = "CIF001_S003_E011";
    String START_DATE_INPUT = "CIF001_S003_E027";
    String ADDRESS_LOOKUP_INPUT = "CIF001_S003_E005";
    String ECONOMY_SECTOR_SELECT = "CIF001_S003_C006";
    String OKEC_TITLE_SELECT = "CIF001_S003_C005";
    String COURT_SEAT_SELECT = "CIF001_S003_C001";
    String ECONOMY_SECTOR_SELECT_COMPANY = "CIF001_S003_C003";
    String EMPLOYEE_COUNT_SELECT = "CIF001_S003_C007";
    String LEGAL_FORM_SELECT = "CIF001_S003_C004";
    String CZECH_CITIZENSHIP_BUTTON = "CIF001_S003_B003";
    String SUBMIT_BUTTON = "CIF001_S003_B009";
    String ADDRESS_LOOKUP_FLOAT_BUTTON = "CIF001_S003_B002";
    String CZECH_COUNTRY_OF_ESTABLISHMENT_BUTTON = "CIF001_S003_B018";
    String CZECH_COUNTRY_OF_FOUNDATION_BUTTON = "CIF001_S003_B006";
    String UNIFIED_ADDRESS_LOOKUP_BUTTON = "CIF001_S003_B004";
    String FIRST_FOUND_ADDRESS_INPUT = "CIF001_S003_G001-0";
    String CHOOSE_ADRESS_BUTTON = "CIF001_S003_B005";

    @TypeInto(value = BUSINESS_NAME_INPUT, clear = true)
    CIF001_S003_CreateNewCompanyCifPage fillCompanyName(String companyName);

    @TypeInto(FIRST_NAME_INPUT)
    CIF001_S003_CreateNewCompanyCifPage fillFirstName(String firstName);

    @TypeInto(value = ABBREVIATED_NAME_INPUT, clear = true)
    CIF001_S003_CreateNewCompanyCifPage fillAbbreviatedName(String abbreviatedName);

    @TypeInto(TIN_INPUT)
    CIF001_S003_CreateNewCompanyCifPage fillDic(String dicCode);

    @TypeInto(STREET_NAME_INPUT)
    CIF001_S003_CreateNewCompanyCifPage fillStreet(String addressStreet);

    @TypeInto(LAND_REGISTRATION_INPUT)
    CIF001_S003_CreateNewCompanyCifPage fillLandRegistration(String addressCp);

    @TypeInto(STREET_NUM_INPUT)
    CIF001_S003_CreateNewCompanyCifPage fillStreetNumber(String addressCo);

    @TypeInto(value = CITY_NAME_INPUT, clear = true)
    CIF001_S003_CreateNewCompanyCifPage fillCityName(String addressCity);

    @TypeInto(ZIP_CODE_INPUT)
    CIF001_S003_CreateNewCompanyCifPage fillZipCode(String addressPsc);

    @TypeInto(EMAIL_INPUT)
    CIF001_S003_CreateNewCompanyCifPage fillEmail(String email);

    @TypeInto(MOBILE_PHONE_INPUT)
    CIF001_S003_CreateNewCompanyCifPage fillMobilePhone(String mobilePhone);

    @TypeInto(OKEC_CODE_INPUT)
    @Click(BUSINESS_NAME_INPUT)
        // to lookup value
    CIF001_S003_CreateNewCompanyCifPage fillOkecCode(String naceNumber);

    @TypeInto(CITY_DISTRICT_INPUT)
    CIF001_S003_CreateNewCompanyCifPage fillCityDistrict(String addressCityDistrict);

    @TypeInto(value = LEGAL_FORM_INPUT, clear = true)
    @Click(BUSINESS_NAME_INPUT)
        // to lookup value
    CIF001_S003_CreateNewCompanyCifPage fillLegalFormCode(String legalFormCode);

    @TypeInto(value = START_DATE_INPUT, clear = true)
    CIF001_S003_CreateNewCompanyCifPage fillStartDate(String busStartDate);

    @Wait(explicitWaitSeconds = 2)
    @TypeInto(value = ADDRESS_LOOKUP_INPUT, clear = true)
    CIF001_S003_CreateNewCompanyCifPage fillAddressLookup(String partialAddress);

    @TypeInto(COURT_DEPARTMENT_INPUT)
    CIF001_S003_CreateNewCompanyCifPage fillCourtDepartment(String courtDepartment);

    @TypeInto(COURT_INSERT_INPUT)
    CIF001_S003_CreateNewCompanyCifPage fillCourtInsert(String courtInsert);

    @Click(CZECH_CITIZENSHIP_BUTTON)
    CIF001_S003_CreateNewCompanyCifPage clickCzechCitizenship();

    @TypeInto(LEGAL_FORM_SELECT)
    CIF001_S003_CreateNewCompanyCifPage selectLegalForm(String legalForm);

    @TypeInto(OKEC_TITLE_SELECT)
    CIF001_S003_CreateNewCompanyCifPage selectOkecTitle(String okecTitle);

    @Select(ECONOMY_SECTOR_SELECT)
    CIF001_S003_CreateNewCompanyCifPage selectEconomySectorFop(int sectorId);

    @Select(COURT_SEAT_SELECT)
    CIF001_S003_CreateNewCompanyCifPage selectCourtSeat(String courtSeat);

    @TypeInto(ECONOMY_SECTOR_SELECT_COMPANY)
    CIF001_S003_CreateNewCompanyCifPage selectEconomySectorPo(String economySector);

    @Select(EMPLOYEE_COUNT_SELECT)
    CIF001_S003_CreateNewCompanyCifPage selectEmployeeCount(String employeeCount);

    @Click(ADDRESS_LOOKUP_FLOAT_BUTTON)
    CIF001_S003_CreateNewCompanyCifPage clickAddressLookupMagnifyGlass();

    @Click(value = UNIFIED_ADDRESS_LOOKUP_BUTTON, andWait = @Wait(value = FIRST_FOUND_ADDRESS_INPUT, by = Lookup.ID, until = Until.VISIBLE, waitSecondsForElement = 60))
    CIF001_S003_CreateNewCompanyCifPage clickDoAddressSearch();

    @Click(value = FIRST_FOUND_ADDRESS_INPUT, jsClick = true, andWait = @Wait(value = LOAD_IMG_DIV_CLASS, by = Lookup.CLASSNAME, until = Until.GONE, waitSecondsForElement = 60))
    CIF001_S003_CreateNewCompanyCifPage clickFirstFoundAddress();

    @Click(value = CHOOSE_ADRESS_BUTTON, andWait = @Wait(value = LOAD_IMG_DIV_CLASS, by = Lookup.CLASSNAME, until = Until.GONE, waitSecondsForElement = 10))
    CIF001_S003_CreateNewCompanyCifPage clickChooseAdress();

    @Click(CZECH_COUNTRY_OF_ESTABLISHMENT_BUTTON)
    CIF001_S003_CreateNewCompanyCifPage clickCzechCountryOfEstablishment();

    @Click(CZECH_COUNTRY_OF_FOUNDATION_BUTTON)
    CIF001_S003_CreateNewCompanyCifPage clickCzechCountryOfFoundation();

    @Click(SUBMIT_BUTTON)
    CIF001_S003_CreateNewCompanyCifPageTransitions clickSubmit();
}
