From aa97d25302ee1d516c2c70f4c53bffee31975d79 Mon Sep 17 00:00:00 2001 From: masoodafar-web Date: Sun, 9 Aug 2026 00:40:36 +0330 Subject: [PATCH] feat(report): optimize customer package purchases report by removing pagination and enhancing filter application - Simplified the data retrieval process by eliminating pagination, allowing for all matching records to be fetched in a single request. - Improved filter application logic to streamline the report generation process. - Updated the handling of the result set to ensure compatibility with the new data retrieval method. --- .../CustomerPackagePurchasesReport.razor | 34 ++++++------------- 1 file changed, 11 insertions(+), 23 deletions(-) diff --git a/src/BackOffice/Pages/Club/Reports/CustomerPackagePurchasesReport.razor b/src/BackOffice/Pages/Club/Reports/CustomerPackagePurchasesReport.razor index 66ed35e..f77910b 100644 --- a/src/BackOffice/Pages/Club/Reports/CustomerPackagePurchasesReport.razor +++ b/src/BackOffice/Pages/Club/Reports/CustomerPackagePurchasesReport.razor @@ -205,31 +205,19 @@ _exporting = true; try { - var filter = BuildFilter(); - var all = new List(); - const int pageSize = 500; - var page = 1; - long totalCount; - - do - { - var result = await PurchaseClient.GetCustomerPackagePurchaseRollupAsync( - new GetCustomerPackagePurchaseRollupRequest + // PageSize=0 → همهٔ ردیف‌های مطابق فیلتر، مستقل از صفحه‌بندی گرید + var result = await PurchaseClient.GetCustomerPackagePurchaseRollupAsync( + new GetCustomerPackagePurchaseRollupRequest + { + PaginationState = new CMSMicroservice.Protobuf.Protos.PaginationState { - PaginationState = new CMSMicroservice.Protobuf.Protos.PaginationState - { - PageNumber = page, - PageSize = pageSize - }, - Filter = filter - }); - - var batch = result?.Models?.ToList() ?? new(); - all.AddRange(batch); - totalCount = result?.MetaData?.TotalCount ?? 0; - page++; - } while (all.Count < totalCount && page <= 50); + PageNumber = 1, + PageSize = 0 + }, + Filter = BuildFilter() + }); + var all = result?.Models?.ToList() ?? new(); if (all.Count == 0) { Snackbar.Add("داده‌ای برای خروجی با فیلتر فعلی وجود ندارد.", Severity.Info);