feat: добавил ограничение записи на лекции
Backend CI / build-and-test (push) Failing after 32s
Frontend CI / build-and-check (push) Failing after 5m5s
🚀 Create and publish a Docker image / Detect changes in backend and frontend (push) Successful in 6s
🚀 Create and publish a Docker image / Build & publish backend image (push) Failing after 1m28s
🚀 Create and publish a Docker image / Build & publish frontend image (push) Failing after 19s
🚀 Create and publish a Docker image / Update stack on Portainer (push) Has been skipped
Backend CI / build-and-test (push) Failing after 32s
Frontend CI / build-and-check (push) Failing after 5m5s
🚀 Create and publish a Docker image / Detect changes in backend and frontend (push) Successful in 6s
🚀 Create and publish a Docker image / Build & publish backend image (push) Failing after 1m28s
🚀 Create and publish a Docker image / Build & publish frontend image (push) Failing after 19s
🚀 Create and publish a Docker image / Update stack on Portainer (push) Has been skipped
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
namespace UniVerse.Domain.Services;
|
||||
|
||||
public static class EnrollmentSlotPolicy
|
||||
{
|
||||
private static readonly IReadOnlyList<EnrollmentSlotRule> SlotRules =
|
||||
[
|
||||
new(1, 3),
|
||||
new(3, 5),
|
||||
new(4, 7)
|
||||
];
|
||||
|
||||
public static IReadOnlyList<EnrollmentSlotRule> 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);
|
||||
Reference in New Issue
Block a user