Refactor inventory commands and queries for improved clarity and consistency
Build and Deploy / build (push) Failing after 2m12s
Build and Deploy / build (push) Failing after 2m12s
- Updated ProductType enum values to be more descriptive (RegularProduct, DiscountProduct). - Removed unnecessary Success and Message properties from response DTOs in AddStock and AdjustStock commands. - Renamed Note property to Reason in AdjustStock and RecordLoss commands, and added ReferenceNumber. - Changed InventoryItemId to Id in UpdateInventorySettingsCommand for consistency. - Updated pagination properties in various queries (PageIndex to Page). - Enhanced GetAllInventoryItemsQuery and GetLowStockItemsQuery to include sorting options. - Updated InventoryProfile mappings to reflect changes in DTOs and Protobuf definitions. - Adjusted Protobuf definitions to align with new property names and structures.
This commit is contained in:
+9
-5
@@ -1,3 +1,4 @@
|
||||
using BackOffice.BFF.Application.InventoryCQ.Queries.GetAllInventoryItems;
|
||||
using CMSMicroservice.Protobuf.Protos.Inventory;
|
||||
|
||||
namespace BackOffice.BFF.Application.InventoryCQ.Queries.GetLowStockItems;
|
||||
@@ -15,8 +16,8 @@ public class GetLowStockItemsQueryHandler : IRequestHandler<GetLowStockItemsQuer
|
||||
{
|
||||
var protoRequest = new GetLowStockItemsRequest
|
||||
{
|
||||
Page = 1,
|
||||
PageSize = request.Count
|
||||
Page = request.Page,
|
||||
PageSize = request.PageSize
|
||||
};
|
||||
|
||||
if (request.WarehouseId.HasValue)
|
||||
@@ -30,20 +31,23 @@ public class GetLowStockItemsQueryHandler : IRequestHandler<GetLowStockItemsQuer
|
||||
return new GetLowStockItemsResponseDto
|
||||
{
|
||||
TotalCount = response.TotalCount,
|
||||
Items = response.Items.Select(i => new LowStockItemDto
|
||||
Items = response.Items.Select(i => new GetAllInventoryItems.InventoryItemDto
|
||||
{
|
||||
Id = i.Id,
|
||||
ProductId = i.ProductId,
|
||||
DiscountProductId = i.DiscountProductId,
|
||||
ProductType = (int)i.ProductType,
|
||||
ProductName = i.ProductTitle,
|
||||
ProductTitle = i.ProductTitle,
|
||||
ProductPrice = i.ProductPrice,
|
||||
Quantity = i.Quantity,
|
||||
ReservedQuantity = i.ReservedQuantity,
|
||||
AvailableQuantity = i.AvailableQuantity,
|
||||
LowStockThreshold = i.LowStockThreshold,
|
||||
ReorderPoint = i.ReorderPoint,
|
||||
MaxStockLevel = i.MaxStockLevel,
|
||||
WarehouseId = i.WarehouseId,
|
||||
WarehouseName = i.WarehouseName
|
||||
WarehouseName = i.WarehouseName,
|
||||
IsLowStock = true
|
||||
}).ToList()
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user