package cz.moneta.test.dsl.ufo.banka.pages.products.sme;

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

import static cz.moneta.test.dsl.ufo.banka.pages.products.sme.KUL053_S002_EditCommitmentPage.*;
import static cz.moneta.test.dsl.ufo.operations.shared.SharedElements.LOAD_IMG_DIV_CLASS;

@Wait(value = KUL053_S002_PAGE_LABEL_XPATH, by = Lookup.XPATH, waitSecondsForElement = 60)
@Wait(value = LOAD_IMG_DIV_CLASS, by = Lookup.CLASSNAME, until = Until.GONE, waitSecondsForElement = 60)
public interface KUL053_S002_EditCommitmentPage extends WebFlow<KUL053_S002_EditCommitmentPage> {
    String KUL053_S002_PAGE_LABEL_XPATH = "//div[text()='KUL053_S002']";

    String SAVE_IN_CONTROL_WINDOW_BUTTON = "KUL053_S002_B001";
    String SAVE_BUTTON = "KUL053_S002_B004";

    String PAYMENT_PERIOD_SELECT = "KUL053_S002_C003";
    String COMMIT_EXISTING_DOC_SELECT = "KUL053_S002_C005";
    String COMMIT_PAYMENT_DOC_SELECT = "KUL053_S002_C006";

    String CREDIT_CONTRACT_NUMBER_INPUT = "KUL053_S002_E001";
    String PAYMENT_ACCOUNT_INPUT = "KUL053_S002_E002";
    String BANK_CODE_INPUT = "KUL053_S002_E003";
    String VARIABLE_SYMBOL_INPUT = "KUL053_S002_E005";
    String SPECIFIC_SYMBOL_INPUT = "KUL053_S002_E006";
    String ORIGINAL_LOAN_AMOUNT_INPUT = "KUL053_S002_E007";
    String PAYMENTS_NUMBER_INPUT = "KUL053_S002_E008";
    String INSTALLMENT_AMOUNT_INPUT = "KUL053_S002_E009";
    String ESTABLISH_DATE_INPUT = "KUL053_S002_E010";
    String ANNUAL_INTEREST_RATE_INPUT = "KUL053_S002_E011";
    String FIRST_PAYMENT_DATE_INPUT = "KUL053_S002_E012";
    String CREDIT_CONTRACT_NUMBER_CONTROL_INPUT = "KUL053_S002_E022";

    @Select(value = COMMIT_EXISTING_DOC_SELECT, andWait = @Wait(value = LOAD_IMG_DIV_CLASS, by = Lookup.CLASSNAME, until = Until.GONE))
    KUL053_S002_EditCommitmentPage selectCommitmentExistingDocument(String commitExistingDocument);

    @Select(value = COMMIT_PAYMENT_DOC_SELECT, andWait = @Wait(value = LOAD_IMG_DIV_CLASS, by = Lookup.CLASSNAME, until = Until.GONE))
    KUL053_S002_EditCommitmentPage selectCommitmentPaymentDocument(String commitPaymentDocument);

    @TypeInto(BANK_CODE_INPUT)
    KUL053_S002_EditCommitmentPage fillBankCode(String bankCode);

    @TypeInto(CREDIT_CONTRACT_NUMBER_INPUT)
    KUL053_S002_EditCommitmentPage fillCreditContractNumber(String creditContractNumber);

    @TypeInto(PAYMENT_ACCOUNT_INPUT)
    KUL053_S002_EditCommitmentPage fillPaymentAccountNumber(String paymentAccountNumber);

    @TypeInto(ORIGINAL_LOAN_AMOUNT_INPUT)
    KUL053_S002_EditCommitmentPage fillOriginalLoanAmount(String originalLoanAmount);

    @TypeInto(PAYMENTS_NUMBER_INPUT)
    KUL053_S002_EditCommitmentPage fillPaymentsNumber(String paymentsNumber);

    @TypeInto(INSTALLMENT_AMOUNT_INPUT)
    KUL053_S002_EditCommitmentPage fillInstallmentAmount(String installmentAmount);

    @TypeInto(ESTABLISH_DATE_INPUT)
    KUL053_S002_EditCommitmentPage fillEstablishDate(String establishDate);

    @Select(PAYMENT_PERIOD_SELECT)
    KUL053_S002_EditCommitmentPage selectPaymentPeriod(String paymentPeriod);

    @TypeInto(ANNUAL_INTEREST_RATE_INPUT)
    KUL053_S002_EditCommitmentPage fillAnnualInterestRate(String annualInterestRate);

    @TypeInto(FIRST_PAYMENT_DATE_INPUT)
    KUL053_S002_EditCommitmentPage fillFirstPaymentDate(String firstPaymentDate);

    @Click(SAVE_BUTTON)
    KUL053_S002_EditCommitmentPage clickSaveCommitment();

    @TypeInto(CREDIT_CONTRACT_NUMBER_CONTROL_INPUT)
    KUL053_S002_EditCommitmentPage fillCreditContractNumberInControl(String creditContractNumber);

    @Click(SAVE_IN_CONTROL_WINDOW_BUTTON)
    KUL053_S001_CompleteCommitmentsPage clickSave();

    @TypeInto(VARIABLE_SYMBOL_INPUT)
    KUL053_S002_EditCommitmentPage fillVariableSymbol(String variableSymbol);

    @TypeInto(value = SPECIFIC_SYMBOL_INPUT, clear = true)
    KUL053_S002_EditCommitmentPage fillSpecificSymbol(String specificSymbol);
}
