package com.lesingle.edu.common.enums;

import lombok.Getter;

/**
 * 租户套餐状态枚举
 */
@Getter
public enum TenantPackageStatus {

    ACTIVE("ACTIVE", "激活"),
    EXPIRED("EXPIRED", "已过期");

    private final String code;
    private final String description;

    TenantPackageStatus(String code, String description) {
        this.code = code;
        this.description = description;
    }

    /**
     * 根据 code 获取枚举
     */
    public static TenantPackageStatus fromCode(String code) {
        for (TenantPackageStatus status : values()) {
            if (status.getCode().equals(code)) {
                return status;
            }
        }
        return ACTIVE;
    }

}
