package cn.axzo.msg.center.service;

import cn.axzo.msg.center.service.enums.ButtonStyleEnum;
import cn.axzo.msg.center.service.enums.PresetButtonType;
import cn.axzo.msg.center.service.enums.RouterButtonSourceEnum;
import cn.axzo.msg.center.service.enums.RouterCategoryEnum;
import cn.axzo.msg.center.service.pending.response.MessageButton;

import java.util.List;

/**
 * @author yanglin
 */
public interface ButtonV3 extends MessageButton {

    String getName();

    String getCode();

    String getActionPerformedName();

    PresetButtonType getPresetBtnType();

    Boolean getPendingShow();

    Boolean getExecutorShow();

    RouterCategoryEnum getCategory();

    RouterButtonSourceEnum getSource();

    List<ButtonStyleEnum> getStyles();

    default boolean determineIsPendingShow() {
        return getPendingShow() != null && getPendingShow();
    }

    default boolean isPerformActionAvailable() {
        return determineIsPendingShow() || getCategory() == RouterCategoryEnum.PRESET_BUTTON;
    }

}