namespace UniVerse.Domain.Services; public static class EnrollmentSlotPolicy { private static readonly IReadOnlyList SlotRules = [ new(1, 3), new(3, 5), new(4, 7) ]; public static IReadOnlyList Rules => SlotRules; public static int GetLimitForLevel(int level) => SlotRules .Where(rule => rule.Level <= level) .OrderBy(rule => rule.Level) .LastOrDefault()?.Slots ?? SlotRules[0].Slots; } public sealed record EnrollmentSlotRule(int Level, int Slots);