package com.erp.approval.enums;

import lombok.Getter;
import lombok.RequiredArgsConstructor;

/**
 * 审核动作类型枚举
 */
@Getter
@RequiredArgsConstructor
public enum ActionType {
    
    PASS("pass", "自动通过"),
    REJECT("reject", "自动驳回"),
    NOTIFY("notify", "发送通知"),
    ESCALATE("escalate", "升级处理");
    
    private final String code;
    private final String description;
    
    public static ActionType fromCode(String code) {
        for (ActionType action : values()) {
            if (action.code.equals(code)) {
                return action;
            }
        }
        throw new IllegalArgumentException("未知的动作类型: " + code);
    }
}
