Files
CMS/src/CMSMicroservice.Domain/Entities/Network/NetworkWeeklyBalance.cs

112 lines
3.5 KiB
C#
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
namespace CMSMicroservice.Domain.Entities.Network;
/// <summary>
/// تعادل‌های هفتگی شبکه باینری
/// </summary>
public class NetworkWeeklyBalance : BaseAuditableEntity
{
/// <summary>
/// شناسه کاربر
/// </summary>
public long UserId { get; set; }
/// <summary>
/// User Navigation Property
/// </summary>
public virtual User User { get; set; }
/// <summary>
/// شماره هفته (مثال: "2025-W48")
/// </summary>
public string WeekNumber { get; set; }
/// <summary>
/// تعداد اعضای جدید شاخه چپ در این هفته
/// </summary>
public int LeftLegNewMembers { get; set; }
/// <summary>
/// تعداد اعضای جدید شاخه راست در این هفته
/// </summary>
public int RightLegNewMembers { get; set; }
/// <summary>
/// باقیمانده شاخه چپ از هفته قبل (Carryover)
/// </summary>
public int LeftLegCarryover { get; set; }
/// <summary>
/// باقیمانده شاخه راست از هفته قبل (Carryover)
/// </summary>
public int RightLegCarryover { get; set; }
/// <summary>
/// مجموع شاخه چپ: LeftLegNewMembers + LeftLegCarryover
/// </summary>
public int LeftLegTotal { get; set; }
/// <summary>
/// مجموع شاخه راست: RightLegNewMembers + RightLegCarryover
/// </summary>
public int RightLegTotal { get; set; }
/// <summary>
/// تعداد تعادل (امتیاز): MIN(LeftLegTotal, RightLegTotal)
/// </summary>
public int TotalBalances { get; set; }
/// <summary>
/// باقیمانده شاخه چپ برای هفته بعد
/// </summary>
public int LeftLegRemainder { get; set; }
/// <summary>
/// باقیمانده شاخه راست برای هفته بعد
/// </summary>
public int RightLegRemainder { get; set; }
/// <summary>
/// مقدار فلش هر طرف (بعد از اعمال Cap): TotalBalances - CappedBalances
/// </summary>
public int FlushedPerSide { get; set; }
/// <summary>
/// مجموع فلش از دو طرف: FlushedPerSide × 2
/// این مقدار از دست می‌رود (نه به هفته بعد، نه به کمیسیون)
/// </summary>
public int TotalFlushed { get; set; }
/// <summary>
/// مجموع تعادل زیرمجموعه این کاربر (تا 15 لول پایین‌تر)
/// این مقدار در CalculateWeeklyBalances محاسبه و ذخیره می‌شود
/// </summary>
public int SubordinateBalances { get; set; }
/// <summary>
/// [DEPRECATED] تعداد تعادل شاخه چپ - استفاده نشود
/// </summary>
[Obsolete("Use LeftLegTotal instead")]
public int LeftLegBalances { get; set; }
/// <summary>
/// [DEPRECATED] تعداد تعادل شاخه راست - استفاده نشود
/// </summary>
[Obsolete("Use RightLegTotal instead")]
public int RightLegBalances { get; set; }
/// <summary>
/// مبلغی که از این کاربر به استخر هفتگی اضافه شد (ریال)
/// </summary>
public long WeeklyPoolContribution { get; set; }
/// <summary>
/// زمان محاسبه توسط Worker
/// </summary>
public DateTime? CalculatedAt { get; set; }
/// <summary>
/// آیا منقضی شده (بعد از توزیع کمیسیون)
/// </summary>
public bool IsExpired { get; set; }
}