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

import cz.moneta.test.dsl.ufo.banka.pages.cards.debit.OBR003_S001_ClientContractSignPage;
import cz.moneta.test.harness.context.StoreAccessor;
import cz.moneta.test.harness.endpoints.ufo.UfoEndpoint;
import cz.moneta.test.harness.support.web.CustomAction;
import cz.moneta.test.harness.support.web.WebFlow;
import cz.moneta.test.dsl.ufo.banka.pages.common.pages.OBR001_S001_PrintInstructionPage;


public interface SMA002_S001_SMEAutomatsApplicationsOverviewTransitions extends WebFlow<SMA002_S001_SMEAutomatsApplicationsOverviewTransitions>, StoreAccessor {
    OBR001_S001_PrintInstructionPage onPrintInstructionPage();

    KUL012_S001_RequestedDocumentsPage onRequestedDocumentsPage();

    SMA017_S001_DrawDownFeePage onDrawDownFee();

    KUL043_S001_ChangeSelectedParametersPage onChangeSelectedParametersExpresBusinessPage();

    @CustomAction
    default KUL043_S001_ChangeSelectedParametersPage onChangeSelectedParametersExpresBusinessPageAndAcceptAlertIfPresent() {
        UfoEndpoint endpoint = getEndpoint(UfoEndpoint.class);
        if ((endpoint.isAlertPresent(3)) &&
                (endpoint.getAlertText(1).equals("Bankéř nemá příslušnou certifikaci pro sjednání pojištění!"))) {
            endpoint.acceptAlert(1);
        }
        return null;
    }

    @CustomAction
    default KUL043_S002_ChangeSelectedParametersPage onChangeSelectedParametersFlexiBusinessPageAndAcceptAlertIfPresent() {
        UfoEndpoint endpoint = getEndpoint(UfoEndpoint.class);
        if (endpoint.isAlertPresent(3)) {
            endpoint.acceptAlert(1);
        }
        return null;
    }

    CHK001_S001_WaitingForModulationPage onWaitingForModulationPage();

    SMA002_S001_SMEAutomatsApplicationOverview onSMEAutomatsApplicationOverview();

    OBR003_S001_ClientContractSignPage onClientWarning();
}
