package cz.moneta.test.dsl.payment_engine.parts_of_menu.menu_search;

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

public interface PaymentEngineSearchTransactionRecordDetail extends WebFlow<PaymentEngineSearchTransactionRecordDetail> {

    String REF_TRANSACTION_KEY = "REFERENCE_KEY";
    String REF_TRANSACTION_XPATH = "//tr[td/div[text()='Ref transakce']]//div[@class='x-grid3-cell-inner x-grid3-col-3']";
    String RECORD_DETAIL_EXIT_BUTTON = "//button[text()='Zavřít']";
    String RECORD_DETAIL_CREDITOR_BIC = "//tr[td/div[text()='CP_AGENT_BIC']]//div[text()='%s']";
    String RECORD_DETAIL_CLEARING_PARTNER = "//tr[td/div[text()='OR_AGENT_CORR_BIC']]//div[text()='%s']";
    String RECORD_DETAIL_CP_AGENT_CORR = "//tr[td/div[text()='CP_AGENT_CORR_1_BIC']]//div[text()='%s']";
    String RECORD_DETAIL_INTERMEDIARY_BIC = "//tr[td/div[text()='INTRMY_1_BIC']]//div[text()='%s']";
    String DISTRIBUTION_DATE = "//tr[td/div[text()='DIST_DATE']]//div[@class= 'x-grid3-cell-inner x-grid3-col-4'][text()='%s']";
    String DEBIT_POSTING = "//tr[td/div[text()='Účtování do debetu']]//div[@class='x-grid3-cell-inner x-grid3-col-4'][text()='%s']";
    String INITIATOR = "//tr[td/div[text()='Iniciátor']]//div[@class='x-grid3-cell-inner x-grid3-col-4'][text()='%s']";
    String ICBS_PROFILE = "//tr[td/div[text()='ICBS profil']]//div[@class='x-grid3-cell-inner x-grid3-col-4'][text()='%s']";
    String SETTLEMENT_DATE = "//tr[td/div[text()='SETT_DATE']]//div[@class='x-grid3-cell-inner x-grid3-col-4']";
    String SETTLEMENT_DATE_KEY = "SETTLEMENT_DATE_KEY";

    @CheckElementsPresent({@CheckElementPresent(value = RECORD_DETAIL_CREDITOR_BIC, isStringDynamicXpath = true),
            @CheckElementPresent(value = RECORD_DETAIL_CLEARING_PARTNER, isStringDynamicXpath = true),
            @CheckElementPresent(value = RECORD_DETAIL_CP_AGENT_CORR, isStringDynamicXpath = true),
            @CheckElementPresent(value = RECORD_DETAIL_INTERMEDIARY_BIC, isStringDynamicXpath = true)})
    PaymentEngineSearchTransactionRecordDetail checkXctRecordDetailElements(String creditorBic, String clearingPartner,
                                                                            String corrCreditor, String intermediaryBic);

    @CheckElementPresent(value = DISTRIBUTION_DATE, isStringDynamicXpath = true)
    PaymentEngineSearchTransactionRecordDetail checkDistributionDate(String distributionDate);

    @CheckElementPresent(value = DEBIT_POSTING, isStringDynamicXpath = true)
    PaymentEngineSearchTransactionRecordDetail checkDebitPostingValue(String debitPostingValue);

    @CheckElementPresent(value = INITIATOR, isStringDynamicXpath = true)
    PaymentEngineSearchTransactionRecordDetail checkInitiatorValue(String initiatorValue);

    @CheckElementPresent(value = ICBS_PROFILE, isStringDynamicXpath = true)
    PaymentEngineSearchTransactionRecordDetail checkIcbsProfileValue(String icbsProfileValue);

    @StoreElementContent(storeKey = REF_TRANSACTION_KEY, value = REF_TRANSACTION_XPATH, by = Lookup.XPATH)
    PaymentEngineSearchTransactionRecordDetail storeRefTransaction();

    @StoreElementContent(storeKey = SETTLEMENT_DATE_KEY, value = SETTLEMENT_DATE, by = Lookup.XPATH)
    PaymentEngineSearchTransactionRecordDetail storeSettlementDate();

    @Click(RECORD_DETAIL_EXIT_BUTTON)
    PaymentEngineSearchTransactionDetail clickExitFromRecordDetail();
}
