feat(commission): add per-package filtering to commission pages
- CommissionDtos: add PackageId + PackageTitle to CommissionPayoutDto and WeeklyBalanceDto - CommissionService: add packageId parameter to GetMyCommissionPayoutsAsync and GetMyWeeklyBalanceAsync - CommissionDashboardPage: add package filter dropdown + package column in desktop/mobile views - WeeklyBalancePage: add package filter dropdown + package chip in balance info section - Update NuGet Foursat.CMSMicroservice.Protobuf to v0.0.187
This commit is contained in:
@@ -8,8 +8,10 @@ namespace FrontOffice.Main.Pages.Commission;
|
||||
public partial class CommissionDashboardPage : ComponentBase
|
||||
{
|
||||
[Inject] private CommissionService CommissionService { get; set; } = default!;
|
||||
[Inject] private PackageService PackageService { get; set; } = default!;
|
||||
|
||||
private List<CommissionPayoutDto> _payouts = new();
|
||||
private List<PackageDto> _packages = new();
|
||||
private int _totalCount;
|
||||
private long _totalAmount;
|
||||
private int _pageNumber = 1;
|
||||
@@ -19,12 +21,26 @@ public partial class CommissionDashboardPage : ComponentBase
|
||||
private WeekSelector? _weekSelector;
|
||||
private WeekDefinitionDto? _selectedWeekDefinition;
|
||||
private string _filterStatus = string.Empty;
|
||||
private long? _filterPackageId;
|
||||
|
||||
protected override async Task OnInitializedAsync()
|
||||
{
|
||||
await LoadPackagesAsync();
|
||||
await LoadPayoutsAsync();
|
||||
}
|
||||
|
||||
private async Task LoadPackagesAsync()
|
||||
{
|
||||
try
|
||||
{
|
||||
_packages = await PackageService.GetAllPackagesAsync();
|
||||
}
|
||||
catch
|
||||
{
|
||||
_packages = new List<PackageDto>();
|
||||
}
|
||||
}
|
||||
|
||||
private async Task LoadPayoutsAsync()
|
||||
{
|
||||
try
|
||||
@@ -35,7 +51,8 @@ public partial class CommissionDashboardPage : ComponentBase
|
||||
weekDefinitionId,
|
||||
_filterStatus,
|
||||
_pageNumber,
|
||||
_pageSize
|
||||
_pageSize,
|
||||
_filterPackageId
|
||||
);
|
||||
_payouts = result.Payouts;
|
||||
_totalCount = result.TotalCount;
|
||||
@@ -61,6 +78,7 @@ public partial class CommissionDashboardPage : ComponentBase
|
||||
{
|
||||
_selectedWeekDefinition = null;
|
||||
_filterStatus = string.Empty;
|
||||
_filterPackageId = null;
|
||||
_pageNumber = 1;
|
||||
await LoadPayoutsAsync();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user