feat: update package version and enhance network membership DTOs

- Updated the version of the Foursat.CMSMicroservice.Protobuf package from 0.0.197 to 0.0.199.
- Added a new property `PackageName` to `NetworkNodeDto` and `FlatNetworkNodeDto` for better representation of membership packages.
- Updated mapping in `NetworkMembershipService` to include the new `PackageName` property.
- Enhanced the org chart display by adding a badge for the package name in the UI.

These changes improve the clarity and functionality of the network membership features.
This commit is contained in:
masoodafar-web
2026-06-11 23:33:40 +03:30
parent c2fd8790b6
commit 34c5c508e0
6 changed files with 298 additions and 3 deletions
+1 -1
View File
@@ -11,7 +11,7 @@
<ItemGroup>
<PackageReference Include="DateTimeConverterCL" Version="1.0.0" />
<!-- Replace all FrontOffice.BFF protobuf packages with CMS protobuf -->
<PackageReference Include="Foursat.CMSMicroservice.Protobuf" Version="0.0.197" />
<PackageReference Include="Foursat.CMSMicroservice.Protobuf" Version="0.0.199" />
<!-- <ProjectReference Include="../../../CMS/src/CMSMicroservice.Protobuf/CMSMicroservice.Protobuf.csproj" />-->
<PackageReference Include="MudBlazor" Version="8.14.0" />
<PackageReference Include="Blazored.LocalStorage" Version="4.5.0" />
@@ -21,6 +21,11 @@ public class NetworkNodeDto
/// کد معرف کاربر
/// </summary>
public string? ReferralCode { get; set; }
/// <summary>
/// نام پکیج موثر (مثلاً پکیج طلایی / نقره‌ای)
/// </summary>
public string? PackageName { get; set; }
}
/// <summary>
@@ -43,6 +48,11 @@ public class FlatNetworkNodeDto
/// کد معرف کاربر - فقط برای کاربران فعال در باشگاه نمایش داده شود
/// </summary>
public string? ReferralCode { get; set; }
/// <summary>
/// نام پکیج موثر (مثلاً پکیج طلایی / نقره‌ای)
/// </summary>
public string? PackageName { get; set; }
}
/// <summary>
@@ -81,7 +91,8 @@ public class NetworkTreeDto
IsClubActive = node.IsClubActive,
ActivationWeekNumber = node.ActivationWeekNumber,
JoinedAt = node.JoinedAt,
ReferralCode = node.ReferralCode
ReferralCode = node.ReferralCode,
PackageName = node.PackageName
};
result.Add(flatNode);
@@ -137,6 +137,7 @@ public class NetworkMembershipService
IsActive = node.IsActive,
IsClubActive = node.IsClubActive,
ReferralCode = node.ReferralCode,
PackageName = string.IsNullOrWhiteSpace(node.PackageName) ? null : node.PackageName,
ActivationWeekNumber = node.ActivationWeekDefinitionId?.ToString(),
JoinedAt = node.JoinedAt?.ToDateTime(),
LeftChild = MapNodeFromProto(node.LeftChild),
@@ -124,6 +124,23 @@
margin-top: 1px;
}
.org-node-card .package-name-badge {
display: inline-flex;
align-items: center;
height: 14px;
padding: 0 6px;
margin-top: 2px;
border-radius: 7px;
font-size: 9px;
color: #546e7a;
background: #eceff1;
border: 1px solid #b0bec5;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
max-width: 120px;
}
/* Referral Code - only for club active members */
.node-referral {
display: flex;
+7 -1
View File
@@ -38,7 +38,7 @@ window.OrgChart = {
.container('#' + containerId)
.data(data)
.nodeWidth((d) => 140)
.nodeHeight((d) => 70)
.nodeHeight((d) => 85)
.childrenMargin((d) => 50)
.compactMarginBetween((d) => 15)
.compactMarginPair((d) => 15)
@@ -66,6 +66,11 @@ window.OrgChart = {
// Avatar - first letter of name
const firstChar = data.fullName ? data.fullName.charAt(0) : '?';
const packageName = data.packageName || data.PackageName || '';
const packageBadge = packageName
? `<div class="package-name-badge">${packageName}</div>`
: '';
// نمایش کد معرف فقط برای کاربران فعال در باشگاه
const referralCodeHtml = data.isClubActive && data.referralCode
@@ -82,6 +87,7 @@ window.OrgChart = {
<div class="node-info">
<div class="node-name-sm">${data.fullName || 'بدون نام'}</div>
<div class="node-level-sm">L${data.level || 0}${!isRoot ? ' • ' + (data.position === 'Left' ? 'چپ' : 'راست') : ''}</div>
${packageBadge}
${referralCodeHtml}
</div>
</div>