package com.writeoff.security;

public enum AuthScope {
    TENANT,
    PLATFORM;

    public static AuthScope fromClaim(String raw) {
        if (raw == null || raw.trim().isEmpty()) {
            return TENANT;
        }
        String normalized = raw.trim().toUpperCase();
        for (AuthScope value : values()) {
            if (value.name().equals(normalized)) {
                return value;
            }
        }
        throw new IllegalArgumentException("invalid auth scope: " + raw);
    }
}
