package com.airlock.iam.flow.application.configuration.selection;

import com.airlock.iam.flow.api.application.configuration.selection.SelectionFlowStepConfig;
import com.airlock.iam.flow.api.application.configuration.step.FlowStepConfig;
import java.util.List;

public interface CommonSelectionStepConfig extends SelectionFlowStepConfig {
   String AVIALABLE_OPTIONS_DESCRIPTION = "All available options for this selection. For each option, a condition can be configured that determines if it is available in a specific situation and for a particular user. If no option is available and a \"Fallback Flow\" is configured, it is executed, otherwise the step fails. If exactly one option is available, it could be selected automatically (see \"Auto Select One Option\" flag). If more than one option is available, the user is asked to interactively select one.";
   String FALLBACK_FLOW_DESCRIPTION = "Fallback flow that is executed if none of the other options are available. If no fallback flow is configured and no option is fulfilled, the selection fails. To do nothing as a fallback, a flow with a \"No Operation Step\" can be configured.";
   String FALLBACK_FLOW_PROPERTY = "fallbackFlow";

   boolean isAutoSelectOnlyOption();

   default List<FlowStepConfig> getFallbackFlow() {
      return List.of();
   }

   default boolean hasFallbackFlow() {
      return !this.getFallbackFlow().isEmpty();
   }
}
