package com.qqchen.deploy.backend.notification.enums;

import lombok.Getter;

/**
 * 通知渠道状态枚举
 *
 * @author qqchen
 * @since 2025-10-22
 */
@Getter
public enum NotificationChannelStatusEnum {
    
    /**
     * 启用
     */
    ENABLED("ENABLED", "启用"),
    
    /**
     * 禁用
     */
    DISABLED("DISABLED", "禁用");
    
    /**
     * 状态编码
     */
    private final String code;
    
    /**
     * 状态描述
     */
    private final String description;
    
    NotificationChannelStatusEnum(String code, String description) {
        this.code = code;
        this.description = description;
    }
    
    /**
     * 根据编码获取枚举
     *
     * @param code 编码
     * @return 枚举实例
     */
    public static NotificationChannelStatusEnum fromCode(String code) {
        for (NotificationChannelStatusEnum status : values()) {
            if (status.getCode().equals(code)) {
                return status;
            }
        }
        throw new IllegalArgumentException("Invalid notification channel status code: " + code);
    }
}

