feat: add session capacity waitlist
Deploy Telegram Bot / build-and-push (push) Failing after 4m42s
Deploy Telegram Bot / deploy (push) Has been skipped

This commit is contained in:
2026-04-24 13:28:01 +03:00
parent 675ac1226e
commit 9c91057798
34 changed files with 915 additions and 110 deletions
@@ -0,0 +1,26 @@
namespace GmRelay.Shared.Domain;
public static class SessionCapacityRules
{
public static string DecideJoinStatus(int? maxPlayers, int activeParticipants)
{
if (!maxPlayers.HasValue)
{
return ParticipantRegistrationStatus.Active;
}
return activeParticipants < maxPlayers.Value
? ParticipantRegistrationStatus.Active
: ParticipantRegistrationStatus.Waitlisted;
}
public static bool CanPromoteWaitlistedPlayer(int? maxPlayers, int activeParticipants, int waitlistedParticipants)
{
if (waitlistedParticipants <= 0)
{
return false;
}
return !maxPlayers.HasValue || activeParticipants < maxPlayers.Value;
}
}