feat: implement Kavenegar SMS service and refactor system configurations to use static constants
Build and Deploy to Kubernetes / build-and-deploy (push) Successful in 1m38s
Build and Deploy to Kubernetes / build-and-deploy (push) Successful in 1m38s
This commit is contained in:
@@ -0,0 +1,176 @@
|
||||
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>
|
||||
/// مبلغ هدیه حق عضویت باشگاه (ریال) - این مبلغ از کیف پول کم نمیشود
|
||||
/// </summary>
|
||||
public const long ClubMembershipGiftValue = 25_200_000;
|
||||
|
||||
/// <summary>
|
||||
/// هزینه فعالسازی عضویت باشگاه (ریال)
|
||||
/// </summary>
|
||||
public const long ClubActivationFee = 25_200_000;
|
||||
|
||||
#endregion
|
||||
|
||||
#region Package Settings
|
||||
|
||||
/// <summary>
|
||||
/// مبلغ پکیج طلایی / پایه (ریال) - 56 میلیون تومان
|
||||
/// شامل: هدیه باشگاه + هزینه فعالسازی + مزایای دیگر
|
||||
/// </summary>
|
||||
public const long BasePackageAmount = 56_000_000;
|
||||
|
||||
/// <summary>
|
||||
/// مبلغ وام دایا (ریال) - همان مبلغ پکیج طلایی
|
||||
/// </summary>
|
||||
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
|
||||
/// </summary>
|
||||
public const int CommissionMaxWeeklyBalancesPerLeg = 300;
|
||||
|
||||
/// <summary>
|
||||
/// حداکثر عمق شبکه برای محاسبه کمیسیون (تعداد لول زیرمجموعه)
|
||||
/// </summary>
|
||||
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 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
|
||||
/// </summary>
|
||||
public static Dictionary<string, object> GetAllAsDict()
|
||||
{
|
||||
return new Dictionary<string, object>
|
||||
{
|
||||
// Network
|
||||
["Network.AllowOrphanNodes"] = NetworkAllowOrphanNodes,
|
||||
["Network.MaxChildrenPerLeg"] = NetworkMaxChildrenPerLeg,
|
||||
|
||||
// Club
|
||||
["Club.MembershipGiftValue"] = ClubMembershipGiftValue,
|
||||
["Club.ActivationFee"] = ClubActivationFee,
|
||||
|
||||
// Commission
|
||||
["Commission.CashWithdrawalEnabled"] = CommissionCashWithdrawalEnabled,
|
||||
["Commission.MinWithdrawalAmount"] = CommissionMinWithdrawalAmount,
|
||||
["Commission.MaxWeeklyBalancesPerLeg"] = CommissionMaxWeeklyBalancesPerLeg,
|
||||
["Commission.MaxNetworkLevel"] = CommissionMaxNetworkLevel,
|
||||
["Commission.CalculationStrategy"] = CommissionCalculationStrategy,
|
||||
|
||||
// System
|
||||
["System.MaintenanceMode"] = SystemMaintenanceMode,
|
||||
["System.EnableAuditLog"] = SystemEnableAuditLog,
|
||||
|
||||
// Shop
|
||||
["Shop.VAT"] = ShopVAT,
|
||||
["Shop.VATEnabled"] = ShopVATEnabled
|
||||
};
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// دریافت لیست تنظیمات با توضیحات
|
||||
/// </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, "حداکثر تعداد فرزند مستقیم در هر پا"),
|
||||
|
||||
// Club
|
||||
("Club.MembershipGiftValue", ClubMembershipGiftValue, "مبلغ هدیه حق عضویت باشگاه (ریال)"),
|
||||
("Club.ActivationFee", ClubActivationFee, "هزینه فعالسازی عضویت باشگاه (ریال)"),
|
||||
|
||||
// Commission
|
||||
("Commission.CashWithdrawalEnabled", CommissionCashWithdrawalEnabled, "امکان برداشت نقدی فعال باشد"),
|
||||
("Commission.MinWithdrawalAmount", CommissionMinWithdrawalAmount, "حداقل مبلغ برداشت (ریال)"),
|
||||
("Commission.MaxWeeklyBalancesPerLeg", CommissionMaxWeeklyBalancesPerLeg, "سقف تعادل هفتگی برای هر دست"),
|
||||
("Commission.MaxNetworkLevel", CommissionMaxNetworkLevel, "حداکثر عمق شبکه برای محاسبه کمیسیون"),
|
||||
("Commission.CalculationStrategy", CommissionCalculationStrategy, "روش محاسبه (ORM/SP)"),
|
||||
|
||||
// System
|
||||
("System.MaintenanceMode", SystemMaintenanceMode, "حالت تعمیر و نگهداری سیستم"),
|
||||
("System.EnableAuditLog", SystemEnableAuditLog, "فعالسازی لاگ تغییرات"),
|
||||
|
||||
// Shop
|
||||
("Shop.VAT", ShopVAT, "مالیات بر ارزش افزوده"),
|
||||
("Shop.VATEnabled", ShopVATEnabled, "مالیات فعال است؟")
|
||||
};
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
@@ -1,42 +0,0 @@
|
||||
namespace CMSMicroservice.Domain.Entities.Configuration;
|
||||
|
||||
/// <summary>
|
||||
/// تنظیمات پویای سیستم - قابل تغییر بدون Deployment
|
||||
/// </summary>
|
||||
public class SystemConfiguration : BaseAuditableEntity
|
||||
{
|
||||
/// <summary>
|
||||
/// محدوده تنظیمات (System, Network, Club, Commission)
|
||||
/// </summary>
|
||||
public ConfigurationScope Scope { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// کلید تنظیم (مثلاً "MaxWeeklyBalancesPerUser")
|
||||
/// </summary>
|
||||
public string Key { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// مقدار بهصورت رشته (تفسیر در Application Layer)
|
||||
/// </summary>
|
||||
public string Value { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// نوع داده برای Validation و UI (Int/Decimal/Bool/String/Json)
|
||||
/// </summary>
|
||||
public string? DataType { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// توضیحات برای ادمین
|
||||
/// </summary>
|
||||
public string? Description { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// فعال یا غیرفعال
|
||||
/// </summary>
|
||||
public bool IsActive { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// SystemConfigurationHistory Collection Navigation Reference
|
||||
/// </summary>
|
||||
public virtual ICollection<SystemConfigurationHistory>? SystemConfigurationHistories { get; set; }
|
||||
}
|
||||
@@ -1,47 +0,0 @@
|
||||
namespace CMSMicroservice.Domain.Entities.History;
|
||||
|
||||
/// <summary>
|
||||
/// تاریخچه تغییرات تنظیمات سیستم (برای Audit)
|
||||
/// </summary>
|
||||
public class SystemConfigurationHistory : BaseAuditableEntity
|
||||
{
|
||||
/// <summary>
|
||||
/// شناسه تنظیم
|
||||
/// </summary>
|
||||
public long ConfigurationId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// SystemConfiguration Navigation Property
|
||||
/// </summary>
|
||||
public virtual SystemConfiguration? Configuration { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// محدوده تنظیمات
|
||||
/// </summary>
|
||||
public ConfigurationScope Scope { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// کلید تنظیم
|
||||
/// </summary>
|
||||
public string Key { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// مقدار قبل از تغییر
|
||||
/// </summary>
|
||||
public string OldValue { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// مقدار بعد از تغییر
|
||||
/// </summary>
|
||||
public string NewValue { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// دلیل تغییر (اختیاری)
|
||||
/// </summary>
|
||||
public string? Reason { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// چه کسی انجام داده (UserId یا "System")
|
||||
/// </summary>
|
||||
public string? PerformedBy { get; set; }
|
||||
}
|
||||
@@ -1,32 +0,0 @@
|
||||
namespace CMSMicroservice.Domain.Enums;
|
||||
|
||||
/// <summary>
|
||||
/// محدوده تنظیمات سیستم (Scope)
|
||||
/// </summary>
|
||||
public enum ConfigurationScope
|
||||
{
|
||||
/// <summary>
|
||||
/// تنظیمات کلی سیستم
|
||||
/// </summary>
|
||||
System = 0,
|
||||
|
||||
/// <summary>
|
||||
/// تنظیمات شبکه باینری
|
||||
/// </summary>
|
||||
Network = 1,
|
||||
|
||||
/// <summary>
|
||||
/// تنظیمات باشگاه مشتریان
|
||||
/// </summary>
|
||||
Club = 2,
|
||||
|
||||
/// <summary>
|
||||
/// تنظیمات کمیسیون
|
||||
/// </summary>
|
||||
Commission = 3,
|
||||
|
||||
/// <summary>
|
||||
/// تنظیمات مالیات بر ارزش افزوده
|
||||
/// </summary>
|
||||
VAT = 4
|
||||
}
|
||||
Reference in New Issue
Block a user