Enhance user plan management and update related endpoints
- Added new configuration options for user plans in `.env.example`, including `Plans__MaxCustomConfigCount` and `Plans__MinCustomConfigCount`. - Introduced `MapPlanEndpoints` in `Program.cs` to handle plan-related API routes. - Implemented `SetUserPlan` endpoint in `RoleEndpoints` to allow admins to assign plans to users. - Removed deprecated role request approval endpoints from `AdminSupportEndpoints`. - Updated `ITelegramNotifier` and related classes to reflect changes in role request handling and payment notifications. - Refactored role management commands to remove `MaxConfigs` and focus on `MaxIpLimit` and billing settings. - Enhanced billing request handling to accommodate plan changes instead of role changes. - Updated various interfaces and command handlers to support new plan management features.
This commit is contained in:
@@ -3,17 +3,15 @@ using PnvPanel.Application.Common.Models;
|
||||
|
||||
namespace PnvPanel.Infrastructure.Identity;
|
||||
|
||||
/// <summary>Роль с квотой на число конфигов и лимитом одновременных IP на клиента. У пользователя ровно одна роль.</summary>
|
||||
/// <summary>Роль с лимитом одновременных IP на клиента, доступом к инбаундам и флагом биллинга.
|
||||
/// Квота конфигов больше не на роли — см. AppUser.ConfigQuota/Plan. У пользователя ровно одна роль.</summary>
|
||||
public class AppRole : IdentityRole<Guid>
|
||||
{
|
||||
public const int UnlimitedMaxConfigs = RoleQuota.Unlimited;
|
||||
public const int UnlimitedMaxIpLimit = RoleQuota.Unlimited;
|
||||
|
||||
public int MaxConfigs { get; set; }
|
||||
|
||||
/// <summary>Лимит одновременных IP на клиента в 3x-ui (`limitIp`); -1 — без лимита. Применяется
|
||||
/// только к новым клиентам, создаваемым в 3x-ui (см. IXuiPanelGateway.AddClientAsync) — при смене
|
||||
/// роли/лимита существующие клиенты в панели не трогаются (как и квота MaxConfigs).</summary>
|
||||
/// роли/лимита существующие клиенты в панели не трогаются (как и квота ConfigQuota).</summary>
|
||||
public int MaxIpLimit { get; set; }
|
||||
|
||||
public bool IsSystem { get; set; }
|
||||
|
||||
Reference in New Issue
Block a user