feat: Implement bulk update for product prices and stock, and add low stock products query and toggle product status functionality

This commit is contained in:
masoodafar-web
2025-12-04 02:56:03 +03:30
parent f0f48118e7
commit 84f642e900
4 changed files with 234 additions and 3 deletions

View File

@@ -56,13 +56,18 @@ public class GetLowStockProductsQueryHandler : IRequestHandler<GetLowStockProduc
"Found {Count} low stock products (threshold: {Threshold}, page: {Page})",
totalCount, request.Threshold, request.PageIndex);
var totalPages = (int)Math.Ceiling(totalCount / (double)request.PageSize);
return new GetLowStockProductsResponseDto
{
MetaData = new MetaData
{
CurrentPage = request.PageIndex,
TotalPage = totalPages,
PageSize = request.PageSize,
TotalCount = totalCount
TotalCount = totalCount,
HasNext = request.PageIndex < totalPages,
HasPrevious = request.PageIndex > 1
},
Products = products
};