package com.lesingle.edu.common.enums;

import lombok.Getter;

/**
 * Tenant Status Enum
 */
@Getter
public enum TenantStatus {

    ACTIVE("ACTIVE", "生效中"),
    EXPIRED("EXPIRED", "已过期"),
    SUSPENDED("SUSPENDED", "已暂停");

    private final String code;
    private final String description;

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

    public static TenantStatus fromCode(String code) {
        for (TenantStatus status : values()) {
            if (status.getCode().equalsIgnoreCase(code)) {
                return status;
            }
        }
        return ACTIVE;
    }

}
