namespace Meezi.Core.Constants;

/// <summary>Preset food/drink category icons (dashboard + POS). <see cref="IconStyle"/> is the visual variant.</summary>
public static class CategoryIconPresets
{
    public static class IconStyle
    {
        public const string Flat = "flat";
        public const string Modern = "modern";
        public const string Real = "real";
        public const string Minimal = "minimal";
        public const string Outline = "outline";
        public const string Soft = "soft";
        public const string Bold = "bold";
        public const string Gradient = "gradient";
        public const string Pastel = "pastel";
        public const string Duotone = "duotone";

        public static readonly IReadOnlySet<string> All = new HashSet<string>(StringComparer.Ordinal)
        {
            Flat, Modern, Real, Minimal, Outline, Soft, Bold, Gradient, Pastel, Duotone
        };
    }

    public static class PresetId
    {
        public const string DrinksHot = "drinks-hot";
        public const string DrinksCold = "drinks-cold";
        public const string DrinksTea = "drinks-tea";
        public const string DrinksJuice = "drinks-juice";
        public const string DrinksMilkshake = "drinks-milkshake";
        public const string DrinksAlcohol = "drinks-alcohol";
        public const string DrinksBeer = "drinks-beer";
        public const string Breakfast = "breakfast";
        public const string FoodMains = "food-mains";
        public const string FoodFastfood = "food-fastfood";
        public const string FoodRice = "food-rice";
        public const string PastaPizza = "pasta-pizza";
        public const string Dessert = "dessert";
        public const string IceCream = "ice-cream";
        public const string Bakery = "bakery";
        public const string Salad = "salad";
        public const string Grill = "grill";
        public const string Seafood = "seafood";
        public const string Snacks = "snacks";
        public const string SnacksSweet = "snacks-sweet";
        public const string Appetizers = "appetizers";
        public const string Vegan = "vegan";
        public const string Fruits = "fruits";
        public const string Specials = "specials";
        public const string ChefSpecial = "chef-special";
        public const string Generic = "generic";

        public static readonly IReadOnlySet<string> All = new HashSet<string>(StringComparer.Ordinal)
        {
            DrinksHot, DrinksCold, DrinksTea, DrinksJuice, DrinksMilkshake, DrinksAlcohol, DrinksBeer,
            Breakfast, FoodMains, FoodFastfood, FoodRice, PastaPizza, Dessert, IceCream, Bakery, Salad,
            Grill, Seafood, Snacks, SnacksSweet, Appetizers, Vegan, Fruits, Specials, ChefSpecial, Generic
        };
    }

    public static bool IsValidStyle(string? style) =>
        !string.IsNullOrWhiteSpace(style) && IconStyle.All.Contains(style.Trim());

    public static bool IsValidPreset(string? presetId) =>
        !string.IsNullOrWhiteSpace(presetId) && PresetId.All.Contains(presetId.Trim());

    public static string? NormalizeStyle(string? style) =>
        string.IsNullOrWhiteSpace(style) ? null : style.Trim().ToLowerInvariant();

    public static string? NormalizePreset(string? presetId) =>
        string.IsNullOrWhiteSpace(presetId) ? null : presetId.Trim().ToLowerInvariant();
}
