package cz.moneta.test.dsl.ufo.operations.shared.topmenu;

import cz.moneta.test.harness.context.StoreAccessor;
import cz.moneta.test.harness.support.web.CheckElementContent;
import cz.moneta.test.harness.support.web.CheckElementPresent;
import cz.moneta.test.harness.support.web.Wait;
import cz.moneta.test.harness.support.web.WebFlow;

public interface XXX702_Applications<T extends WebFlow<T>> extends WebFlow<T>, StoreAccessor {

    String APPLICATIONS_RADIO = "XXX702_T001_R008_1";

    String LOAD_BUTTON = "XXX702_T001_B026";
    String LOAD_ALL_BUTTON = "XXX702_T001_B027";
    String APPLICATION_COPY_BUTTON = "XXX702_T001_B034";
    String FINISH_APPLICATION_BUTTON = "XXX702_T001_B029";
    String APPLICATION_DECISION_BUTTON = "XXX702_T001_B030";
    String STORNO_APPLICATION_BUTTON = "XXX702_T001_B028";

    String FIRST_APPLICATION_DETAIL_BUTTON = "XXX702_T001_P045-1";
    String FIRST_APPLICATION_STATE_LABEL = "XXX702_T001_L285-1";
    String FIRST_APPLICATION_REQUESTED_PRODUCT_CODE_LABEL = "XXX702_T001_L303-1";
    String FIRST_APPLICATION_REQUESTED_AMOUNT_LABEL = "XXX702_T001_L305-1";
    String FIRST_APPLICATION_APPROVED_AMOUNT_LABEL = "XXX702_T001_L306-1";
    String FIRST_APPLICATION_CHANNEL_LABEL = "XXX702_T001_L310-1";

    @CheckElementPresent(APPLICATIONS_RADIO)
    T checkApplicationsRadioPresence();

    @CheckElementPresent(LOAD_BUTTON)
    T checkApplicationsLoadButtonPresence();

    @CheckElementPresent(LOAD_ALL_BUTTON)
    T checkApplicationsLoadAllButtonPresence();

    @CheckElementPresent(APPLICATION_COPY_BUTTON)
    T checkApplicationCopyButtonPresence();

    @CheckElementPresent(FINISH_APPLICATION_BUTTON)
    T checkApplicationFinishButtonPresence();

    @CheckElementPresent(APPLICATION_DECISION_BUTTON)
    T checkApplicationDecisionButtonPresence();

    @CheckElementPresent(STORNO_APPLICATION_BUTTON)
    T checkApplicationStornoButtonPresence();


    @CheckElementPresent(FIRST_APPLICATION_DETAIL_BUTTON)
    T checkApplicationsFirstDetailButtonPresence();

    @Wait(explicitWaitSeconds = 1) // There is a moment when list is full of some random items, can't think of better way to track it
    @CheckElementContent(FIRST_APPLICATION_STATE_LABEL)
    T assertFirstApplicationState(String firstApplicationState);

    @CheckElementContent(FIRST_APPLICATION_REQUESTED_PRODUCT_CODE_LABEL)
    T assertFirstApplicationProductCode(String expectedProductCode);

    @CheckElementContent(FIRST_APPLICATION_REQUESTED_AMOUNT_LABEL)
    T assertFirstApplicationRequestedAmount(String expectedAmount);

    @CheckElementContent(FIRST_APPLICATION_APPROVED_AMOUNT_LABEL)
    T assertFirstApplicationApprovedAmount(String expectedAmount);

    @CheckElementContent(FIRST_APPLICATION_CHANNEL_LABEL)
    T assertFirstApplicationChannel(String channel);
}