package cz.moneta.test.dsl.ib.cards.application;

import cz.moneta.test.dsl.ib.IbPageFlow;
import cz.moneta.test.harness.support.web.Click;
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.cards.application.CardDetailsPage.CONTINUE_TO_PERSONAL_DETAIL_BUTTON;

@Wait(CONTINUE_TO_PERSONAL_DETAIL_BUTTON)
public interface CardDetailsPage extends IbPageFlow<CardDetailsPage> {
    
    String CONTINUE_TO_PERSONAL_DETAIL_BUTTON = "//*[@id=\"btnContinueStep2\"]";
    String LIMITS_CREDIT = "//*[@id=\"VyseUveru\"]";
    String DAILY_LIMITS_PURCHASES = "//*[@id=\"AutorizacniLimit_Bezhotovostni\"]";
    String DAILY_LIMITS_WITHDRAWS = "//*[@id=\"AutorizacniLimit_Hotovost\"]";
    String OFFER_TRAVEL_AND_SPORT = "//*[@id=\"053\"]";
    String STATEMENTS_DISTRIBUTION_DROPDOWN = "//*[@id=\"DistribuceVypisu\"]";
    String DUE_DATE = "//*[@id=\"ZuctovaciObdobi\"]";
    String PAYMENT_METHOD = "//*[@id=\"ZpusobUhrady\"]";
    String ACTIVATION_PASSWORD = "//*[@id=\"Heslo\"]";
    String WITHOUT_INSURANCE = "//*[@id=\"_tr_Pojisteni\"]/td[2]/table/tbody/tr[2]/td[1]/label/span";
    String AGREE_WITH_USING_PERSONAL_INFO = "//*[@id=\"_tr_ccNewS4\"]/td[2]/table/tbody/tr/td[1]/table/tbody/tr/td[1]";

    @TypeInto(value = LIMITS_CREDIT, clear = true)
    CardDetailsPage fillCreditLimit(String limit);

    @Click(OFFER_TRAVEL_AND_SPORT)
    CardDetailsPage selectTravelAndSportOffer();

    @TypeInto(DAILY_LIMITS_PURCHASES)
    CardDetailsPage fillDailyPurchasesLimit(String limit);

    @TypeInto(DAILY_LIMITS_WITHDRAWS)
    CardDetailsPage fillDailyWithdrawsLimit(String limit);

    @Select(STATEMENTS_DISTRIBUTION_DROPDOWN)
    CardDetailsPage selectStatementType(String statementType);

    @TypeInto(ACTIVATION_PASSWORD)
    CardDetailsPage fillActivationPassword(String activationPassword);

    @TypeInto(DUE_DATE)
    CardDetailsPage selectDueDate(String range);

    @Select(PAYMENT_METHOD)
    CardDetailsPage selectPaymentMethod(String paymentMethod);

    @Click(WITHOUT_INSURANCE)
    CardDetailsPage selectWithoutInsuranceOption();

    @Click(AGREE_WITH_USING_PERSONAL_INFO)
    @Click(CONTINUE_TO_PERSONAL_DETAIL_BUTTON)
    PersonalDetailsPage agreeAndContinue();
}
