package com.reading.platform.common.enums;

import lombok.Getter;

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

    ACTIVE("active", "Active"),
    EXPIRED("expired", "Expired"),
    DISABLED("disabled", "Disabled");

    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().equals(code)) {
                return status;
            }
        }
        return ACTIVE;
    }

}
