Merge branch 'kub-stage' into production
Build and Deploy to Production / build-and-deploy (push) Successful in 2m23s

This commit is contained in:
masoodafar-web
2025-12-29 00:43:04 +03:30
3 changed files with 73 additions and 22 deletions
+1 -1
View File
@@ -23,7 +23,7 @@
<NotFound>
<PageTitle>یافت نشد</PageTitle>
<LayoutView Layout="@typeof(MainLayout)">
<p role="alert">آدرس مورد نظر یافت نشد</p>
<p role="alert">آدرس مورد نظر یافت نشد</p>
</LayoutView>
</NotFound>
</Router>
+1 -1
View File
@@ -114,7 +114,7 @@
<PackageReference Include="Blazored.LocalStorage" Version="4.5.0"/>
<PackageReference Include="Foursat.BackOffice.BFF.Category.Protobuf" Version="0.0.5"/>
<PackageReference Include="Foursat.BackOffice.BFF.ClubMembership.Protobuf" Version="0.0.7"/>
<PackageReference Include="Foursat.BackOffice.BFF.Commission.Protobuf" Version="0.0.13"/>
<PackageReference Include="Foursat.BackOffice.BFF.Commission.Protobuf" Version="0.0.15"/>
<PackageReference Include="Foursat.BackOffice.BFF.Common.Protobuf" Version="0.0.3"/>
<PackageReference Include="Foursat.BackOffice.BFF.Configuration.Protobuf" Version="1.0.20"/>
<PackageReference Include="Foursat.BackOffice.BFF.DiscountCategory.Protobuf" Version="0.0.3"/>
@@ -68,26 +68,62 @@
Filterable="true"
Hover="true">
<Columns>
<PropertyColumn Property="x => x.UserId" Title="شناسه کاربر" />
<PropertyColumn Property="x => x.UserId" Title="شناسه" />
<PropertyColumn Property="x => x.UserFullName" Title="نام کاربر" />
<PropertyColumn Property="x => x.WeekDisplayName" Title="هفته" />
<PropertyColumn Property="x => x.LeftBalance" Title="موجودی چپ">
<TemplateColumn Title="چپ (جدید + قبلی = مجموع)">
<CellTemplate>
<MudChip T="string" Color="Color.Success" Size="Size.Small">
@context.Item.LeftBalance.ToString("N0")
</MudChip>
<MudStack Row="true" Spacing="1" AlignItems="AlignItems.Center">
<MudTooltip Text="اعضای جدید این هفته">
<MudChip T="string" Color="Color.Success" Size="Size.Small">
@context.Item.LeftNewMembers
</MudChip>
</MudTooltip>
<MudText>+</MudText>
<MudTooltip Text="باقیمانده از هفته قبل">
<MudChip T="string" Color="Color.Default" Size="Size.Small">
@context.Item.LeftCarryover
</MudChip>
</MudTooltip>
<MudText>=</MudText>
<MudTooltip Text="مجموع موجودی چپ">
<MudChip T="string" Color="Color.Primary" Size="Size.Small">
<strong>@context.Item.LeftTotal</strong>
</MudChip>
</MudTooltip>
</MudStack>
</CellTemplate>
</PropertyColumn>
<PropertyColumn Property="x => x.RightBalance" Title="موجودی راست">
</TemplateColumn>
<TemplateColumn Title="راست (جدید + قبلی = مجموع)">
<CellTemplate>
<MudChip T="string" Color="Color.Warning" Size="Size.Small">
@context.Item.RightBalance.ToString("N0")
</MudChip>
<MudStack Row="true" Spacing="1" AlignItems="AlignItems.Center">
<MudTooltip Text="اعضای جدید این هفته">
<MudChip T="string" Color="Color.Warning" Size="Size.Small">
@context.Item.RightNewMembers
</MudChip>
</MudTooltip>
<MudText>+</MudText>
<MudTooltip Text="باقیمانده از هفته قبل">
<MudChip T="string" Color="Color.Default" Size="Size.Small">
@context.Item.RightCarryover
</MudChip>
</MudTooltip>
<MudText>=</MudText>
<MudTooltip Text="مجموع موجودی راست">
<MudChip T="string" Color="Color.Primary" Size="Size.Small">
<strong>@context.Item.RightTotal</strong>
</MudChip>
</MudTooltip>
</MudStack>
</CellTemplate>
</PropertyColumn>
<PropertyColumn Property="x => x.MatchedBalance" Title="موجودی تطبیق‌یافته">
</TemplateColumn>
<PropertyColumn Property="x => x.MatchedBalance" Title="تعادل">
<CellTemplate>
<MudChip T="string" Color="Color.Info" Size="Size.Small">
@context.Item.MatchedBalance.ToString("N0")
<strong>@context.Item.MatchedBalance</strong>
</MudChip>
</CellTemplate>
</PropertyColumn>
@@ -99,7 +135,7 @@
<PropertyColumn Property="x => x.IsExpired" Title="وضعیت">
<CellTemplate>
<MudChip T="string" Color="@(context.Item.IsExpired ? Color.Error : Color.Success)" Size="Size.Small">
@(context.Item.IsExpired ? "منقضی شده" : "فعال")
@(context.Item.IsExpired ? "منقضی" : "فعال")
</MudChip>
</CellTemplate>
</PropertyColumn>
@@ -188,9 +224,14 @@ private MudDataGrid <UserWeeklyBalanceModel> _grid { get; set; }
var items = response.Models.Select(b => new UserWeeklyBalanceModel
{
UserId = b.UserId,
UserFullName = b.UserFullName,
WeekDisplayName = b.WeekDisplayName,
LeftBalance = b.LeftLegBalances,
RightBalance = b.RightLegBalances,
LeftNewMembers = b.LeftLegNewMembers,
LeftCarryover = b.LeftLegCarryover,
LeftTotal = b.LeftLegTotal,
RightNewMembers = b.RightLegNewMembers,
RightCarryover = b.RightLegCarryover,
RightTotal = b.RightLegTotal,
MatchedBalance = b.TotalBalances,
PoolContribution = b.WeeklyPoolContribution,
CalculatedAt = b.CalculatedAt?.ToDateTime(),
@@ -228,8 +269,8 @@ private MudDataGrid <UserWeeklyBalanceModel> _grid { get; set; }
private void CalculateTotals(List<UserWeeklyBalanceModel> items)
{
_totalLeftBalance = items.Sum(b => (long)b.LeftBalance);
_totalRightBalance = items.Sum(b => (long)b.RightBalance);
_totalLeftBalance = items.Sum(b => (long)b.LeftTotal);
_totalRightBalance = items.Sum(b => (long)b.RightTotal);
_totalMatchedBalance = items.Sum(b => (long)b.MatchedBalance);
}
@@ -247,9 +288,19 @@ private MudDataGrid <UserWeeklyBalanceModel> _grid { get; set; }
private class UserWeeklyBalanceModel
{
public long UserId { get; set; }
public string UserFullName { get; set; } = string.Empty;
public string WeekDisplayName { get; set; }
public int LeftBalance { get; set; }
public int RightBalance { get; set; }
// چپ
public int LeftNewMembers { get; set; }
public int LeftCarryover { get; set; }
public int LeftTotal { get; set; }
// راست
public int RightNewMembers { get; set; }
public int RightCarryover { get; set; }
public int RightTotal { get; set; }
public int MatchedBalance { get; set; }
public long PoolContribution { get; set; }
public DateTime? CalculatedAt { get; set; }