feat: add club membership filters and activation details to network tree
Build and Deploy to Kubernetes / build-and-deploy (push) Successful in 2m13s

This commit is contained in:
masoodafar-web
2025-12-14 02:56:04 +03:30
parent 6ae1b0cd70
commit cf75f14003
6 changed files with 199 additions and 14 deletions
@@ -12,7 +12,9 @@ public class NetworkMembershipProfile : IRegister
// Request mapping
config.NewConfig<GetNetworkTreeRequest, GetNetworkTreeQuery>()
.Map(dest => dest.UserId, src => src.UserId)
.Map(dest => dest.MaxDepth, src => src.MaxDepth != null && src.MaxDepth.Value > 0 ? src.MaxDepth.Value : 3);
.Map(dest => dest.MaxDepth, src => src.MaxDepth != null && src.MaxDepth.Value > 0 ? src.MaxDepth.Value : 3)
.Map(dest => dest.IsClubActive, src => src.IsClubActive)
.Map(dest => dest.ActivationWeekNumber, src => src.ActivationWeekNumber);
// Response mapping: تبدیل درخت به لیست مسطح
config.NewConfig<NetworkTreeDto, GetNetworkTreeResponse>()
@@ -81,7 +83,9 @@ public class NetworkMembershipProfile : IRegister
UserName = $"{node.FirstName} {node.LastName}".Trim(),
NetworkLeg = (int)(node.LegPosition ?? NetworkLeg.Left),
NetworkLevel = node.CurrentDepth,
IsActive = true
IsActive = true,
IsClubActive = node.IsClubActive,
ActivationWeekNumber = node.ActivationWeekNumber ?? string.Empty
};
if (parentId.HasValue)
@@ -89,6 +93,16 @@ public class NetworkMembershipProfile : IRegister
protoNode.ParentId = parentId.Value;
}
// تبدیل تاریخ فعال‌سازی باشگاه
if (node.ClubActivatedAt.HasValue)
{
protoNode.ClubActivatedAt = Timestamp.FromDateTime(
DateTime.SpecifyKind(node.ClubActivatedAt.Value, DateTimeKind.Utc));
}
// تبدیل تاریخ ایجاد کاربر
protoNode.UserCreated = Timestamp.FromDateTimeOffset(node.UserCreated);
nodesList.Add(protoNode);
// بازگشتی برای فرزندان