2026-06-03 00:40:37 +03:30
|
|
|
using Meezi.Core.Constants;
|
|
|
|
|
using Meezi.Core.Enums;
|
|
|
|
|
|
2026-05-27 21:33:48 +03:30
|
|
|
namespace Meezi.Core.Platform;
|
|
|
|
|
|
2026-06-03 00:40:37 +03:30
|
|
|
/// <summary>
|
|
|
|
|
/// Serializable per-plan numeric limits, stored as PlatformPlanDefinition.LimitsJson
|
|
|
|
|
/// and editable by admins. Missing fields default to "unlimited" (or 0 for opt-in
|
|
|
|
|
/// quotas) so older stored JSON stays safe. Defaults come from <see cref="PlanLimits"/>.
|
|
|
|
|
/// </summary>
|
2026-05-27 21:33:48 +03:30
|
|
|
public class PlanLimitsData
|
|
|
|
|
{
|
|
|
|
|
public int MaxOrdersPerDay { get; set; } = int.MaxValue;
|
2026-06-03 00:40:37 +03:30
|
|
|
public int MaxTables { get; set; } = int.MaxValue;
|
2026-05-27 21:33:48 +03:30
|
|
|
public int MaxTerminals { get; set; } = int.MaxValue;
|
|
|
|
|
public int MaxCustomers { get; set; } = int.MaxValue;
|
2026-06-03 00:40:37 +03:30
|
|
|
public int MaxSmsPerMonth { get; set; } = 0;
|
2026-05-27 21:33:48 +03:30
|
|
|
public int MaxBranches { get; set; } = int.MaxValue;
|
|
|
|
|
public int MaxReportHistoryDays { get; set; } = int.MaxValue;
|
2026-06-03 00:40:37 +03:30
|
|
|
public int MaxMenuCategories { get; set; } = int.MaxValue;
|
|
|
|
|
public int MaxMenuItems { get; set; } = int.MaxValue;
|
|
|
|
|
public int MaxMenuAi3dPerMonth { get; set; } = 0;
|
2026-05-27 21:33:48 +03:30
|
|
|
|
2026-06-03 00:40:37 +03:30
|
|
|
public static PlanLimitsData ForTier(PlanTier tier) => new()
|
2026-05-27 21:33:48 +03:30
|
|
|
{
|
2026-06-03 00:40:37 +03:30
|
|
|
MaxOrdersPerDay = PlanLimits.MaxOrdersPerDay(tier),
|
|
|
|
|
MaxTables = PlanLimits.MaxTables(tier),
|
|
|
|
|
MaxTerminals = PlanLimits.MaxTerminals(tier),
|
|
|
|
|
MaxCustomers = PlanLimits.MaxCustomers(tier),
|
|
|
|
|
MaxSmsPerMonth = PlanLimits.MaxSmsPerMonth(tier),
|
|
|
|
|
MaxBranches = PlanLimits.MaxBranches(tier),
|
|
|
|
|
MaxReportHistoryDays = PlanLimits.MaxReportHistoryDays(tier),
|
|
|
|
|
MaxMenuCategories = PlanLimits.MaxMenuCategories(tier),
|
|
|
|
|
MaxMenuItems = PlanLimits.MaxMenuItems(tier),
|
|
|
|
|
MaxMenuAi3dPerMonth = PlanLimits.MaxMenuAi3dPerMonth(tier),
|
2026-05-27 21:33:48 +03:30
|
|
|
};
|
|
|
|
|
}
|