package com.erp.approval.enums;

import lombok.Getter;
import lombok.RequiredArgsConstructor;

/**
 * 审核规则类型枚举
 */
@Getter
@RequiredArgsConstructor
public enum RuleType {
    
    ORDER("order", "订单审核"),
    REFUND("refund", "退款审核");
    
    private final String code;
    private final String description;
    
    public static RuleType fromCode(String code) {
        for (RuleType type : values()) {
            if (type.code.equals(code)) {
                return type;
            }
        }
        throw new IllegalArgumentException("未知的规则类型: " + code);
    }
}
