feat: club UserAutoComplete + member filter + wallet user name display
Build and Deploy to Kubernetes / build-and-deploy (push) Successful in 7m59s

- ActivateClubDialog: replaced numeric UserId input with UserAutoComplete
- ClubMembers: added UserAutoComplete filter in toolbar, wired to proto user_id
- WalletManagementPage: display user name + ID instead of just UserId
- Updated proto NuGet to 0.0.183 (user_name field)
This commit is contained in:
masoodafar-web
2026-02-22 22:03:27 +03:30
parent 8f29fbaf71
commit 0386a2b1aa
5 changed files with 26 additions and 10 deletions
+1 -1
View File
@@ -138,7 +138,7 @@
<!-- CMS Protobuf NuGet package (used for both local dev and Docker builds) -->
<ItemGroup>
<PackageReference Include="Foursat.CMSMicroservice.Protobuf" Version="0.0.180" />
<PackageReference Include="Foursat.CMSMicroservice.Protobuf" Version="0.0.183" />
</ItemGroup>
<!-- ============================================================ -->
+3 -1
View File
@@ -3,6 +3,7 @@
@using Google.Protobuf.WellKnownTypes
@using BackOffice.Pages.Club.Components
@using BackOffice.Pages.AutoComplete
@using CMSMicroservice.Protobuf.Protos.ClubMembership
<div>
@@ -16,7 +17,8 @@
<ToolBarContent>
<MudText Typo="Typo.h6">لیست اعضا</MudText>
<MudSpacer />
<MudStack Row="true" Spacing="2">
<MudStack Row="true" Spacing="2" AlignItems="AlignItems.Center">
<UserAutoComplete Label="جستجوی کاربر" @bind-SelectedUserId="_filterUserId" />
<MudSwitch T="bool" @bind-Value="_filterIsActive"
Color="Color.Success"
Label="فقط فعال‌ها" />
@@ -16,6 +16,7 @@ public partial class ClubMembers
private MudDataGrid<ClubMembershipModel> _gridData;
private bool _filterIsActive = true;
private long? _filterUserId;
private async Task<GridData<ClubMembershipModel>> ServerReload(GridState<ClubMembershipModel> state)
{
@@ -30,6 +31,9 @@ public partial class ClubMembers
// Always use the filter value since it's now a bool (not nullable)
request.IsActive = _filterIsActive;
if (_filterUserId.HasValue && _filterUserId.Value > 0)
request.UserId = _filterUserId.Value;
var result = await ClubContract.GetAllClubMembershipsAsync(request);
if (result?.Models != null && result.Models.Any())
@@ -1,14 +1,11 @@
@using CMSMicroservice.Protobuf.Protos.ClubMembership
@using BackOffice.Pages.AutoComplete
<MudDialog>
<DialogContent>
<MudForm @ref="_form" @bind-IsValid="_formValid">
<MudStack Spacing="3">
<MudNumericField @bind-Value="_model.UserId"
Label="شناسه کاربر"
Required="true"
RequiredError="شناسه کاربر الزامی است"
Variant="Variant.Outlined" />
<UserAutoComplete Label="انتخاب کاربر" @bind-SelectedUserId="_model.UserId" />
<MudNumericField @bind-Value="_model.PackageId"
Label="شناسه پکیج"
@@ -67,12 +64,18 @@
await _form.Validate();
if (!_formValid) return;
if (!_model.UserId.HasValue || _model.UserId.Value <= 0)
{
Snackbar.Add("لطفاً کاربر را انتخاب کنید.", Severity.Warning);
return;
}
_isSubmitting = true;
try
{
var request = new ActivateClubMembershipRequest
{
UserId = _model.UserId,
UserId = _model.UserId.Value,
PackageId = _model.PackageId,
DurationMonths = _model.DurationMonths
};
@@ -94,7 +97,7 @@
private class ActivateModel
{
public long UserId { get; set; }
public long? UserId { get; set; }
public long PackageId { get; set; }
public int DurationMonths { get; set; } = 1;
}
@@ -30,7 +30,14 @@
</ToolBarContent>
<Columns>
<PropertyColumn Property="x => x.Id" Title="شناسه" />
<PropertyColumn Property="x => x.UserId" Title="کاربر" />
<PropertyColumn Property="x => x.UserId" Title="کاربر">
<CellTemplate>
<MudStack Spacing="0">
<MudText Typo="Typo.body2"><strong>@context.Item.UserName</strong></MudText>
<MudText Typo="Typo.caption" Color="Color.Secondary">ID: @context.Item.UserId</MudText>
</MudStack>
</CellTemplate>
</PropertyColumn>
<TemplateColumn Title="موجودی اصلی">
<CellTemplate>
<MudText Color="Color.Primary"><strong>@context.Item.Balance.ToString("N0")</strong> تومان</MudText>