feat: update commission status handling and UI; enhance status representation with computed properties and improve filtering logic
Build and Deploy / build (push) Successful in 2m20s
Build and Deploy / build (push) Successful in 2m20s
This commit is contained in:
@@ -28,10 +28,11 @@
|
||||
Style="max-width: 150px;" />
|
||||
<MudSelect T="string" @bind-Value="_filterStatus" Label="وضعیت" Variant="Variant.Outlined" Style="max-width: 200px;">
|
||||
<MudSelectItem T="string" Value="@string.Empty">همه</MudSelectItem>
|
||||
<MudSelectItem T="string" Value="@("Created")">ایجاد شده</MudSelectItem>
|
||||
<MudSelectItem T="string" Value="@("Pending")">در انتظار</MudSelectItem>
|
||||
<MudSelectItem T="string" Value="@("Paid")">پرداخت شده</MudSelectItem>
|
||||
<MudSelectItem T="string" Value="@("WithdrawalRequested")">درخواست برداشت</MudSelectItem>
|
||||
<MudSelectItem T="string" Value="@("Withdrawn")">برداشت شده</MudSelectItem>
|
||||
<MudSelectItem T="string" Value="@("PaymentFailed")">شکست خورده</MudSelectItem>
|
||||
<MudSelectItem T="string" Value="@("Cancelled")">لغو شده</MudSelectItem>
|
||||
</MudSelect>
|
||||
<MudButton Variant="Variant.Filled" Color="Color.Primary" OnClick="ApplyFiltersAsync" StartIcon="@Icons.Material.Filled.FilterList">
|
||||
@@ -65,8 +66,8 @@
|
||||
<MudText Color="Color.Success"><strong>@context.AmountFormatted</strong></MudText>
|
||||
</MudTd>
|
||||
<MudTd>
|
||||
<MudChip T="string" Color="@GetStatusColor(context.StatusBadgeColor)" Size="Size.Small" Variant="Variant.Outlined">
|
||||
@context.Status
|
||||
<MudChip T="string" Color="@GetStatusColor(context.StatusColor)" Size="Size.Small" Variant="Variant.Outlined">
|
||||
@context.StatusText
|
||||
</MudChip>
|
||||
</MudTd>
|
||||
<MudTd>@context.DatePersian</MudTd>
|
||||
@@ -91,8 +92,8 @@
|
||||
<MudStack Spacing="1">
|
||||
<MudStack Row="true" Justify="Justify.SpaceBetween" AlignItems="AlignItems.Center">
|
||||
<MudChip T="string" Color="Color.Default" Size="Size.Small">@payout.WeekDisplayName</MudChip>
|
||||
<MudChip T="string" Color="@GetStatusColor(payout.StatusBadgeColor)" Size="Size.Small" Variant="Variant.Outlined">
|
||||
@payout.Status
|
||||
<MudChip T="string" Color="@GetStatusColor(payout.StatusColor)" Size="Size.Small" Variant="Variant.Outlined">
|
||||
@payout.StatusText
|
||||
</MudChip>
|
||||
</MudStack>
|
||||
<MudText Typo="Typo.h6" Color="Color.Success">@payout.AmountFormatted</MudText>
|
||||
|
||||
@@ -61,8 +61,8 @@
|
||||
<MudText Color="Color.Success" Typo="Typo.body1"><strong>@context.AmountFormatted</strong></MudText>
|
||||
</MudTd>
|
||||
<MudTd DataLabel="وضعیت">
|
||||
<MudChip T="string" Color="@GetStatusColor(context.StatusBadgeColor)" Size="Size.Small">
|
||||
@context.Status
|
||||
<MudChip T="string" Color="@GetStatusColor(context.StatusColor)" Size="Size.Small">
|
||||
@context.StatusText
|
||||
</MudChip>
|
||||
</MudTd>
|
||||
<MudTd DataLabel="تاریخ">
|
||||
|
||||
@@ -39,16 +39,18 @@ public partial class WeeklyBalancePage : ComponentBase
|
||||
{
|
||||
await _weekSelector.EnsureLoadedAsync();
|
||||
|
||||
// Handle query parameter ?week=46 (WeekOrder) or ?week=123 (Id)
|
||||
// Handle query parameter ?week=2 (WeekDefinitionId)
|
||||
if (!string.IsNullOrEmpty(QueryWeekNumber))
|
||||
{
|
||||
// Try to parse as integer (first try as WeekOrder, then as Id)
|
||||
if (int.TryParse(QueryWeekNumber, out int weekOrder))
|
||||
// Try to parse as WeekDefinitionId first (most common from dashboard links)
|
||||
if (long.TryParse(QueryWeekNumber, out long id))
|
||||
{
|
||||
_selectedWeekDefinition = _weekSelector.FindByWeekOrder(weekOrder);
|
||||
if (_selectedWeekDefinition == null && long.TryParse(QueryWeekNumber, out long id))
|
||||
_selectedWeekDefinition = _weekSelector.FindById(id);
|
||||
|
||||
// Fallback: try as WeekOrder if not found by Id
|
||||
if (_selectedWeekDefinition == null && int.TryParse(QueryWeekNumber, out int weekOrder))
|
||||
{
|
||||
_selectedWeekDefinition = _weekSelector.FindById(id);
|
||||
_selectedWeekDefinition = _weekSelector.FindByWeekOrder(weekOrder);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user