469d97bb60
- Delete orphaned PurchasePackageCommand handler (no RPC dispatch, no callers) - Fix doc-comments: طلایی → پکیج in enums, entities, handlers - Remove stale 56M inline comments - Clean SystemConstants deprecated field docs
204 lines
7.8 KiB
C#
204 lines
7.8 KiB
C#
namespace CMSMicroservice.Domain.Common;
|
|
|
|
/// <summary>
|
|
/// تنظیمات ثابت سیستم - Static و در مموری
|
|
/// این مقادیر هرگز تغییر نمیکنند و نیازی به جدول ندارند
|
|
/// </summary>
|
|
public static class SystemConstants
|
|
{
|
|
#region Network Settings
|
|
|
|
/// <summary>
|
|
/// اجازه حذف والدین که فرزند دارند
|
|
/// </summary>
|
|
public const bool NetworkAllowOrphanNodes = false;
|
|
|
|
/// <summary>
|
|
/// حداکثر تعداد فرزند مستقیم در هر پا
|
|
/// </summary>
|
|
public const int NetworkMaxChildrenPerLeg = 1;
|
|
|
|
#endregion
|
|
|
|
#region Club Settings
|
|
|
|
/// <summary>
|
|
/// مبلغ هدیه حق عضویت باشگاه (ریال) - این مبلغ از کیف پول کم نمیشود
|
|
/// [DEPRECATED] از Package.Price استفاده کنید
|
|
/// </summary>
|
|
[Obsolete("Moved to Package entity. Use package.Price or package.ActivationFee instead.")]
|
|
public const long ClubMembershipGiftValue = 25_200_000;
|
|
|
|
/// <summary>
|
|
/// هزینه فعالسازی عضویت باشگاه (ریال)
|
|
/// [DEPRECATED] از Package.ActivationFee استفاده کنید
|
|
/// </summary>
|
|
[Obsolete("Moved to Package.ActivationFee. Read from Package entity instead.")]
|
|
public const long ClubActivationFee = 25_200_000;
|
|
|
|
#endregion
|
|
|
|
#region Package Settings
|
|
|
|
/// <summary>
|
|
/// مبلغ پکیج پایه (ریال)
|
|
/// [DEPRECATED] از Package.Price استفاده کنید
|
|
/// </summary>
|
|
[Obsolete("Moved to Package.Price. Read from Package entity instead.")]
|
|
public const long BasePackageAmount = 56_000_000;
|
|
|
|
/// <summary>
|
|
/// مبلغ وام دایا (ریال)
|
|
/// [DEPRECATED] از Package.Price استفاده کنید
|
|
/// </summary>
|
|
[Obsolete("Moved to Package.Price. Read from Package entity with SupportsDayaPurchase=true.")]
|
|
public const long DayaLoanAmount = 56_000_000;
|
|
|
|
#endregion
|
|
|
|
#region Commission Settings
|
|
|
|
/// <summary>
|
|
/// امکان برداشت نقدی فعال باشد
|
|
/// </summary>
|
|
public const bool CommissionCashWithdrawalEnabled = true;
|
|
|
|
/// <summary>
|
|
/// حداقل مبلغ برداشت (ریال)
|
|
/// </summary>
|
|
public const long CommissionMinWithdrawalAmount = 1_000_000;
|
|
|
|
/// <summary>
|
|
/// سقف تعادل هفتگی برای هر دست (چپ یا راست) - حداکثر کل = 600
|
|
/// [DEPRECATED] از Package.MaxBalancesPerLeg استفاده کنید
|
|
/// </summary>
|
|
[Obsolete("Moved to Package.MaxBalancesPerLeg. Read from Package entity instead.")]
|
|
public const int CommissionMaxWeeklyBalancesPerLeg = 300;
|
|
|
|
/// <summary>
|
|
/// حداکثر عمق شبکه برای محاسبه کمیسیون (تعداد لول زیرمجموعه)
|
|
/// [DEPRECATED] از Package.MaxNetworkLevel استفاده کنید
|
|
/// </summary>
|
|
[Obsolete("Moved to Package.MaxNetworkLevel. Read from Package entity instead.")]
|
|
public const int CommissionMaxNetworkLevel = 15;
|
|
|
|
/// <summary>
|
|
/// روش محاسبه (ORM یا SP)
|
|
/// </summary>
|
|
public const string CommissionCalculationStrategy = "SP";
|
|
|
|
#endregion
|
|
|
|
#region System Settings
|
|
|
|
/// <summary>
|
|
/// حالت تعمیر و نگهداری سیستم
|
|
/// </summary>
|
|
public const bool SystemMaintenanceMode = false;
|
|
|
|
/// <summary>
|
|
/// فعالسازی لاگ تغییرات
|
|
/// </summary>
|
|
public const bool SystemEnableAuditLog = true;
|
|
|
|
#endregion
|
|
|
|
#region Magic Wallet Settings
|
|
|
|
/// <summary>
|
|
/// ضریب شارژ کیفپول جادویی — واریز × 2.5 = اعتبار
|
|
/// [DEPRECATED] از Package.MagicWalletMultiplier استفاده کنید
|
|
/// </summary>
|
|
[Obsolete("Moved to Package.MagicWalletMultiplier. Read from Package entity instead.")]
|
|
public const decimal MagicWalletMultiplier = 2.5m;
|
|
|
|
/// <summary>
|
|
/// سقف واریز در هر دور جادویی (ریال) — 100M تومان
|
|
/// [DEPRECATED] از Package.MagicWalletMaxDeposit استفاده کنید
|
|
/// </summary>
|
|
[Obsolete("Moved to Package.MagicWalletMaxDeposit. Read from Package entity instead.")]
|
|
public const long MagicWalletMaxDeposit = 1_000_000_000;
|
|
|
|
/// <summary>
|
|
/// سقف اعتبار در هر دور جادویی (ریال) — 250M تومان
|
|
/// [DEPRECATED] از Package.MagicWalletMaxCredit استفاده کنید
|
|
/// </summary>
|
|
[Obsolete("Moved to Package.MagicWalletMaxCredit. Read from Package entity instead.")]
|
|
public const long MagicWalletMaxCredit = 2_500_000_000;
|
|
|
|
#endregion
|
|
|
|
#region Shop Settings
|
|
|
|
/// <summary>
|
|
/// مالیات بر ارزش افزوده (10%)
|
|
/// </summary>
|
|
public const decimal ShopVAT = 0.1m;
|
|
|
|
/// <summary>
|
|
/// مالیات فعال است؟
|
|
/// </summary>
|
|
public const bool ShopVATEnabled = true;
|
|
|
|
#endregion
|
|
|
|
#region Helper Methods
|
|
|
|
/// <summary>
|
|
/// دریافت مقدار به صورت دیکشنری برای نمایش در Admin Panel
|
|
/// Note: Per-package values (Price, MaxBalancesPerLeg, etc.) are now read from Package entity
|
|
/// via ConfigurationService — only static/global constants remain here.
|
|
/// </summary>
|
|
public static Dictionary<string, object> GetAllAsDict()
|
|
{
|
|
return new Dictionary<string, object>
|
|
{
|
|
// Network
|
|
["Network.AllowOrphanNodes"] = NetworkAllowOrphanNodes,
|
|
["Network.MaxChildrenPerLeg"] = NetworkMaxChildrenPerLeg,
|
|
|
|
// Commission (global settings only — per-package limits are in Package entity)
|
|
["Commission.CashWithdrawalEnabled"] = CommissionCashWithdrawalEnabled,
|
|
["Commission.MinWithdrawalAmount"] = CommissionMinWithdrawalAmount,
|
|
["Commission.CalculationStrategy"] = CommissionCalculationStrategy,
|
|
|
|
// System
|
|
["System.MaintenanceMode"] = SystemMaintenanceMode,
|
|
["System.EnableAuditLog"] = SystemEnableAuditLog,
|
|
|
|
// Shop
|
|
["Shop.VAT"] = ShopVAT,
|
|
["Shop.VATEnabled"] = ShopVATEnabled
|
|
};
|
|
}
|
|
|
|
/// <summary>
|
|
/// دریافت لیست تنظیمات با توضیحات
|
|
/// Note: Per-package values are served from Package entity via ConfigurationService.
|
|
/// </summary>
|
|
public static List<(string Key, object Value, string Description)> GetAllWithDescriptions()
|
|
{
|
|
return new List<(string Key, object Value, string Description)>
|
|
{
|
|
// Network
|
|
("Network.AllowOrphanNodes", NetworkAllowOrphanNodes, "اجازه حذف والدین که فرزند دارند"),
|
|
("Network.MaxChildrenPerLeg", NetworkMaxChildrenPerLeg, "حداکثر تعداد فرزند مستقیم در هر پا"),
|
|
|
|
// Commission (global settings only)
|
|
("Commission.CashWithdrawalEnabled", CommissionCashWithdrawalEnabled, "امکان برداشت نقدی فعال باشد"),
|
|
("Commission.MinWithdrawalAmount", CommissionMinWithdrawalAmount, "حداقل مبلغ برداشت (ریال)"),
|
|
("Commission.CalculationStrategy", CommissionCalculationStrategy, "روش محاسبه (ORM/SP)"),
|
|
|
|
// System
|
|
("System.MaintenanceMode", SystemMaintenanceMode, "حالت تعمیر و نگهداری سیستم"),
|
|
("System.EnableAuditLog", SystemEnableAuditLog, "فعالسازی لاگ تغییرات"),
|
|
|
|
// Shop
|
|
("Shop.VAT", ShopVAT, "مالیات بر ارزش افزوده"),
|
|
("Shop.VATEnabled", ShopVATEnabled, "مالیات فعال است؟")
|
|
};
|
|
}
|
|
|
|
#endregion
|
|
}
|