feat: expand network membership response with additional fields
All checks were successful
Build and Deploy / build (push) Successful in 2m12s

This commit is contained in:
masoodafar-web
2025-12-12 07:52:55 +03:30
parent fe56b8f139
commit 19a717fc87
6 changed files with 158 additions and 81 deletions

View File

@@ -2,73 +2,66 @@ namespace BackOffice.BFF.Application.NetworkMembershipCQ.Queries.GetUserNetworkI
public class GetUserNetworkInfoResponseDto public class GetUserNetworkInfoResponseDto
{ {
/// <summary> // اطلاعات اصلی کاربر
/// شناسه عضویت شبکه
/// </summary>
public long Id { get; set; } public long Id { get; set; }
/// <summary>
/// شناسه کاربر
/// </summary>
public long UserId { get; set; } public long UserId { get; set; }
/// <summary>
/// نام کاربر
/// </summary>
public string UserName { get; set; } = string.Empty; public string UserName { get; set; } = string.Empty;
public string Mobile { get; set; } = string.Empty;
/// <summary> public string Email { get; set; } = string.Empty;
/// شناسه والد در شبکه public string NationalCode { get; set; } = string.Empty;
/// </summary>
public long? ParentId { get; set; }
/// <summary>
/// نام والد
/// </summary>
public string ParentName { get; set; } = string.Empty;
/// <summary>
/// موقعیت در شبکه (0=Left, 1=Right)
/// </summary>
public int NetworkLeg { get; set; }
/// <summary>
/// شناسه فرزند چپ
/// </summary>
public long? LeftChildId { get; set; }
/// <summary>
/// نام فرزند چپ
/// </summary>
public string LeftChildName { get; set; } = string.Empty;
/// <summary>
/// شناسه فرزند راست
/// </summary>
public long? RightChildId { get; set; }
/// <summary>
/// نام فرزند راست
/// </summary>
public string RightChildName { get; set; } = string.Empty;
/// <summary>
/// سطح در شبکه
/// </summary>
public int NetworkLevel { get; set; }
/// <summary>
/// کد معرف
/// </summary>
public string ReferralCode { get; set; } = string.Empty; public string ReferralCode { get; set; } = string.Empty;
public bool IsMobileVerified { get; set; }
/// <summary> public DateTime? BirthDate { get; set; }
/// تاریخ عضویت در شبکه
/// </summary>
public DateTime JoinedAt { get; set; } public DateTime JoinedAt { get; set; }
/// <summary> // اطلاعات والد
/// تاریخ ایجاد public long? ParentId { get; set; }
/// </summary> public string ParentName { get; set; } = string.Empty;
public string ParentMobile { get; set; } = string.Empty;
// موقعیت در شبکه
public int NetworkLeg { get; set; }
public int NetworkLevel { get; set; }
public bool IsInNetwork { get; set; }
// اطلاعات فرزند چپ
public long? LeftChildId { get; set; }
public string LeftChildName { get; set; } = string.Empty;
public string LeftChildMobile { get; set; } = string.Empty;
public DateTime? LeftChildJoinedAt { get; set; }
// اطلاعات فرزند راست
public long? RightChildId { get; set; }
public string RightChildName { get; set; } = string.Empty;
public string RightChildMobile { get; set; } = string.Empty;
public DateTime? RightChildJoinedAt { get; set; }
// آمار فرزندان مستقیم
public int TotalChildren { get; set; }
public int LeftChildCount { get; set; }
public int RightChildCount { get; set; }
// آمار کل شبکه
public int TotalLeftLegMembers { get; set; }
public int TotalRightLegMembers { get; set; }
public int TotalNetworkSize { get; set; }
public int MaxNetworkDepth { get; set; }
// اطلاعات پکیج و دایا
public bool HasReceivedDayaCredit { get; set; }
public DateTime? DayaCreditReceivedAt { get; set; }
public int PackagePurchaseMethod { get; set; }
public bool HasPurchasedGoldenPackage { get; set; }
// آمار مالی
public double TotalEarnedCommission { get; set; }
public double TotalPaidCommission { get; set; }
public double PendingCommission { get; set; }
public int TotalBalancesEarned { get; set; }
// آمار فعالیت
public int ActiveMembersInNetwork { get; set; }
public int InactiveMembersInNetwork { get; set; }
public DateTime CreatedAt { get; set; } public DateTime CreatedAt { get; set; }
} }

View File

@@ -7,7 +7,7 @@
<ItemGroup> <ItemGroup>
<PackageReference Include="Afrino.FMSMicroservice.Protobuf" Version="0.0.122" /> <PackageReference Include="Afrino.FMSMicroservice.Protobuf" Version="0.0.122" />
<PackageReference Include="Foursat.CMSMicroservice.Protobuf" Version="0.0.147" /> <PackageReference Include="Foursat.CMSMicroservice.Protobuf" Version="0.0.148" />
<PackageReference Include="Google.Protobuf" Version="3.23.3" /> <PackageReference Include="Google.Protobuf" Version="3.23.3" />
<PackageReference Include="Grpc.Net.ClientFactory" Version="2.54.0" /> <PackageReference Include="Grpc.Net.ClientFactory" Version="2.54.0" />

View File

@@ -49,16 +49,52 @@ public class NetworkMembershipProfile : IRegister
Id = src.Id, Id = src.Id,
UserId = src.UserId, UserId = src.UserId,
UserName = src.UserName, UserName = src.UserName,
Mobile = src.Mobile,
Email = src.Email,
NationalCode = src.NationalCode,
ReferralCode = src.ReferralCode,
IsMobileVerified = src.IsMobileVerified,
BirthDate = src.BirthDate.HasValue
? Timestamp.FromDateTime(DateTime.SpecifyKind(src.BirthDate.Value, DateTimeKind.Utc))
: null,
JoinedAt = Timestamp.FromDateTime(DateTime.SpecifyKind(src.JoinedAt, DateTimeKind.Utc)),
ParentId = src.ParentId, ParentId = src.ParentId,
ParentName = src.ParentName, ParentName = src.ParentName,
ParentMobile = src.ParentMobile,
NetworkLeg = src.NetworkLeg, NetworkLeg = src.NetworkLeg,
NetworkLevel = src.NetworkLevel,
IsInNetwork = src.IsInNetwork,
LeftChildId = src.LeftChildId, LeftChildId = src.LeftChildId,
LeftChildName = src.LeftChildName, LeftChildName = src.LeftChildName,
LeftChildMobile = src.LeftChildMobile,
LeftChildJoinedAt = src.LeftChildJoinedAt.HasValue
? Timestamp.FromDateTime(DateTime.SpecifyKind(src.LeftChildJoinedAt.Value, DateTimeKind.Utc))
: null,
RightChildId = src.RightChildId, RightChildId = src.RightChildId,
RightChildName = src.RightChildName, RightChildName = src.RightChildName,
NetworkLevel = src.NetworkLevel, RightChildMobile = src.RightChildMobile,
ReferralCode = src.ReferralCode, RightChildJoinedAt = src.RightChildJoinedAt.HasValue
JoinedAt = Timestamp.FromDateTime(DateTime.SpecifyKind(src.JoinedAt, DateTimeKind.Utc)), ? Timestamp.FromDateTime(DateTime.SpecifyKind(src.RightChildJoinedAt.Value, DateTimeKind.Utc))
: null,
TotalChildren = src.TotalChildren,
LeftChildCount = src.LeftChildCount,
RightChildCount = src.RightChildCount,
TotalLeftLegMembers = src.TotalLeftLegMembers,
TotalRightLegMembers = src.TotalRightLegMembers,
TotalNetworkSize = src.TotalNetworkSize,
MaxNetworkDepth = src.MaxNetworkDepth,
HasReceivedDayaCredit = src.HasReceivedDayaCredit,
DayaCreditReceivedAt = src.DayaCreditReceivedAt.HasValue
? Timestamp.FromDateTime(DateTime.SpecifyKind(src.DayaCreditReceivedAt.Value, DateTimeKind.Utc))
: null,
PackagePurchaseMethod = src.PackagePurchaseMethod,
HasPurchasedGoldenPackage = src.HasPurchasedGoldenPackage,
TotalEarnedCommission = src.TotalEarnedCommission,
TotalPaidCommission = src.TotalPaidCommission,
PendingCommission = src.PendingCommission,
TotalBalancesEarned = src.TotalBalancesEarned,
ActiveMembersInNetwork = src.ActiveMembersInNetwork,
InactiveMembersInNetwork = src.InactiveMembersInNetwork,
Created = Timestamp.FromDateTime(DateTime.SpecifyKind(src.CreatedAt, DateTimeKind.Utc)) Created = Timestamp.FromDateTime(DateTime.SpecifyKind(src.CreatedAt, DateTimeKind.Utc))
}); });

View File

@@ -11,8 +11,8 @@
}, },
"GrpcChannelOptions": { "GrpcChannelOptions": {
"FMSMSAddress": "https://dl.afrino.co", "FMSMSAddress": "https://dl.afrino.co",
// "CMSMSAddress": "http://cms-svc:80" "CMSMSAddress": "http://cms-svc:80"
"CMSMSAddress": "https://cms.foursat.afrino.co" // "CMSMSAddress": "https://cms.foursat.afrino.co"
// "CMSMSAddress": "https://localhost:32846" // "CMSMSAddress": "https://localhost:32846"
}, },
"Authentication": { "Authentication": {

View File

@@ -6,7 +6,7 @@
<Nullable>enable</Nullable> <Nullable>enable</Nullable>
<IsPackable>true</IsPackable> <IsPackable>true</IsPackable>
<PackageId>Foursat.BackOffice.BFF.NetworkMembership.Protobuf</PackageId> <PackageId>Foursat.BackOffice.BFF.NetworkMembership.Protobuf</PackageId>
<Version>0.0.6</Version> <Version>0.0.7</Version>
<Authors>FourSat</Authors> <Authors>FourSat</Authors>
<Company>FourSat</Company> <Company>FourSat</Company>
<Product>Foursat.BackOffice.BFF.NetworkMembership.Protobuf</Product> <Product>Foursat.BackOffice.BFF.NetworkMembership.Protobuf</Product>

View File

@@ -85,20 +85,68 @@ message GetUserNetworkRequest
message GetUserNetworkResponse message GetUserNetworkResponse
{ {
// اطلاعات اصلی کاربر
int64 id = 1; int64 id = 1;
int64 user_id = 2; int64 user_id = 2;
string user_name = 3; string user_name = 3;
google.protobuf.Int64Value parent_id = 4; string mobile = 4;
string parent_name = 5; string email = 5;
int32 network_leg = 6; // NetworkLeg enum string national_code = 6;
google.protobuf.Int64Value left_child_id = 7; string referral_code = 7;
string left_child_name = 8; bool is_mobile_verified = 8;
google.protobuf.Int64Value right_child_id = 9; google.protobuf.Timestamp birth_date = 9;
string right_child_name = 10; google.protobuf.Timestamp joined_at = 10;
int32 network_level = 11;
string referral_code = 12; // اطلاعات والد
google.protobuf.Timestamp joined_at = 13; google.protobuf.Int64Value parent_id = 11;
google.protobuf.Timestamp created = 14; string parent_name = 12;
string parent_mobile = 13;
// موقعیت در شبکه
int32 network_leg = 14; // NetworkLeg enum
int32 network_level = 15;
bool is_in_network = 16;
// اطلاعات فرزند چپ
google.protobuf.Int64Value left_child_id = 17;
string left_child_name = 18;
string left_child_mobile = 19;
google.protobuf.Timestamp left_child_joined_at = 20;
// اطلاعات فرزند راست
google.protobuf.Int64Value right_child_id = 21;
string right_child_name = 22;
string right_child_mobile = 23;
google.protobuf.Timestamp right_child_joined_at = 24;
// آمار فرزندان مستقیم
int32 total_children = 25;
int32 left_child_count = 26;
int32 right_child_count = 27;
// آمار کل شبکه
int32 total_left_leg_members = 28;
int32 total_right_leg_members = 29;
int32 total_network_size = 30;
int32 max_network_depth = 31;
// اطلاعات پکیج و دایا
bool has_received_daya_credit = 32;
google.protobuf.Timestamp daya_credit_received_at = 33;
int32 package_purchase_method = 34;
bool has_purchased_golden_package = 35;
// آمار مالی
double total_earned_commission = 36;
double total_paid_commission = 37;
double pending_commission = 38;
int32 total_balances_earned = 39;
// آمار فعالیت
int32 active_members_in_network = 40;
int32 inactive_members_in_network = 41;
google.protobuf.Timestamp created = 42;
} }
// GetNetworkTree Query // GetNetworkTree Query