package net.siegeln.cameleer.saas.license;

import net.siegeln.cameleer.saas.tenant.Tier;

import java.util.Map;

public final class LicenseDefaults {

    private LicenseDefaults() {}

    public static Map<String, Object> featuresForTier(Tier tier) {
        return switch (tier) {
            case LOW -> Map.of(
                    "topology", true, "lineage", false,
                    "correlation", false, "debugger", false, "replay", false);
            case MID -> Map.of(
                    "topology", true, "lineage", true,
                    "correlation", true, "debugger", false, "replay", false);
            case HIGH -> Map.of(
                    "topology", true, "lineage", true,
                    "correlation", true, "debugger", true, "replay", true);
            case BUSINESS -> Map.of(
                    "topology", true, "lineage", true,
                    "correlation", true, "debugger", true, "replay", true);
        };
    }

    public static Map<String, Object> limitsForTier(Tier tier) {
        return switch (tier) {
            case LOW -> Map.of(
                    "max_agents", 3, "retention_days", 7,
                    "max_environments", 1);
            case MID -> Map.of(
                    "max_agents", 10, "retention_days", 30,
                    "max_environments", 2);
            case HIGH -> Map.of(
                    "max_agents", 50, "retention_days", 90,
                    "max_environments", -1);
            case BUSINESS -> Map.of(
                    "max_agents", -1, "retention_days", 365,
                    "max_environments", -1);
        };
    }
}
