Files
CMS/src/CMSMicroservice.Application/NetworkMembershipCQ/Queries/GetNetworkStatistics/GetNetworkStatisticsResponseDto.cs
T
masoodafar-web 78d1fee89a
Build and Deploy to Kubernetes / build-and-deploy (push) Successful in 7m14s
refactor(network): improve network statistics calculations and update related DTOs
- Refactored GetNetworkStatisticsQueryHandler to enhance logic for counting active members in left and right legs.
- Updated GetNetworkStatisticsResponseDto to include new properties for LeftLegCount and RightLegCount.
- Modified Protobuf definitions to align with the updated response structure for network statistics.
- Enhanced SQL script to differentiate between all subtree counts and active club member counts.
2026-09-04 04:12:31 +03:30

54 lines
2.4 KiB
C#

namespace CMSMicroservice.Application.NetworkMembershipCQ.Queries.GetNetworkStatistics;
public class GetNetworkStatisticsResponseDto
{
/// <summary>مجموع اعضای فعال باشگاه در پای چپ و راست (= LeftLegCount + RightLegCount)</summary>
public int TotalMembers { get; set; }
/// <summary>همان TotalMembers — اعضای فعال باشگاه در شبکه کاربر</summary>
public int ActiveMembers { get; set; }
/// <summary>تعداد اعضای فعال باشگاه در زیردرخت پای چپ</summary>
public int LeftLegCount { get; set; }
/// <summary>تعداد اعضای فعال باشگاه در زیردرخت پای راست</summary>
public int RightLegCount { get; set; }
public double LeftPercentage { get; set; }
public double RightPercentage { get; set; }
public double AverageDepth { get; set; }
public int MaxDepth { get; set; }
public List<LevelDistributionModel> LevelDistribution { get; set; } = new();
public List<MonthlyGrowthModel> MonthlyGrowth { get; set; } = new();
public List<TopNetworkUserModel> TopUsers { get; set; } = new();
/// <summary>تعداد اعضای فعال باشگاه با پکیج طلایی جاری در پای چپ</summary>
public int GoldLeftLegTotal { get; set; }
/// <summary>تعداد اعضای فعال باشگاه با پکیج طلایی جاری در پای راست</summary>
public int GoldRightLegTotal { get; set; }
/// <summary>تعداد اعضای فعال باشگاه با پکیج نقره‌ای جاری در پای چپ</summary>
public int SilverLeftLegTotal { get; set; }
/// <summary>تعداد اعضای فعال باشگاه با پکیج نقره‌ای جاری در پای راست</summary>
public int SilverRightLegTotal { get; set; }
public string WeakerLeg => LeftLegCount <= RightLegCount ? "Left" : "Right";
}
public class LevelDistributionModel
{
public int Level { get; set; }
public int Count { get; set; }
}
public class MonthlyGrowthModel
{
public string Month { get; set; } = string.Empty;
public int NewMembers { get; set; }
}
public class TopNetworkUserModel
{
public int Rank { get; set; }
public long UserId { get; set; }
public string UserName { get; set; } = string.Empty;
public int TotalChildren { get; set; }
public int LeftCount { get; set; }
public int RightCount { get; set; }
}