Add item reorder level to DTOs
This commit is contained in:
@@ -11,7 +11,8 @@ public record CreateItemRequest(
|
|||||||
Guid? BrandId,
|
Guid? BrandId,
|
||||||
Guid BaseUomId,
|
Guid BaseUomId,
|
||||||
decimal? SalePrice,
|
decimal? SalePrice,
|
||||||
List<UomConversionRequest>? Conversions);
|
List<UomConversionRequest>? Conversions,
|
||||||
|
decimal? ReorderLevel = null);
|
||||||
|
|
||||||
public record UpdateItemRequest(
|
public record UpdateItemRequest(
|
||||||
string Name,
|
string Name,
|
||||||
@@ -21,7 +22,8 @@ public record UpdateItemRequest(
|
|||||||
Guid? BrandId,
|
Guid? BrandId,
|
||||||
Guid BaseUomId,
|
Guid BaseUomId,
|
||||||
decimal? SalePrice,
|
decimal? SalePrice,
|
||||||
bool IsActive = true);
|
bool IsActive = true,
|
||||||
|
decimal? ReorderLevel = null);
|
||||||
|
|
||||||
public record ReplaceConversionsRequest(List<UomConversionRequest> Conversions);
|
public record ReplaceConversionsRequest(List<UomConversionRequest> Conversions);
|
||||||
|
|
||||||
@@ -40,6 +42,7 @@ public record ItemSummaryResponse(
|
|||||||
Guid BaseUomId,
|
Guid BaseUomId,
|
||||||
string BaseUomName,
|
string BaseUomName,
|
||||||
decimal? SalePrice,
|
decimal? SalePrice,
|
||||||
|
decimal? ReorderLevel,
|
||||||
Models.SyncSource SyncSource,
|
Models.SyncSource SyncSource,
|
||||||
bool IsActive,
|
bool IsActive,
|
||||||
DateTime CreatedAt);
|
DateTime CreatedAt);
|
||||||
@@ -58,6 +61,7 @@ public record ItemDetailResponse(
|
|||||||
Guid BaseUomId,
|
Guid BaseUomId,
|
||||||
string BaseUomName,
|
string BaseUomName,
|
||||||
decimal? SalePrice,
|
decimal? SalePrice,
|
||||||
|
decimal? ReorderLevel,
|
||||||
Models.SyncSource SyncSource,
|
Models.SyncSource SyncSource,
|
||||||
bool IsActive,
|
bool IsActive,
|
||||||
DateTime CreatedAt,
|
DateTime CreatedAt,
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ public class ItemService(IItemRepository repo, IUnitOfWork uow)
|
|||||||
i.FK_SubCategoryId, i.SubCategory?.Name,
|
i.FK_SubCategoryId, i.SubCategory?.Name,
|
||||||
i.FK_BrandId, i.Brand?.Name,
|
i.FK_BrandId, i.Brand?.Name,
|
||||||
i.FK_BaseUomId, i.BaseUom.Name,
|
i.FK_BaseUomId, i.BaseUom.Name,
|
||||||
i.SalePrice, i.SyncSource, i.IsActive, i.CreatedAt);
|
i.SalePrice, i.ReorderLevel, i.SyncSource, i.IsActive, i.CreatedAt);
|
||||||
|
|
||||||
private static ItemDetailResponse MapDetail(Models.Item i) =>
|
private static ItemDetailResponse MapDetail(Models.Item i) =>
|
||||||
new(i.Id, i.Sku, i.Name, i.Description,
|
new(i.Id, i.Sku, i.Name, i.Description,
|
||||||
@@ -21,7 +21,7 @@ public class ItemService(IItemRepository repo, IUnitOfWork uow)
|
|||||||
i.FK_SubCategoryId, i.SubCategory?.Name,
|
i.FK_SubCategoryId, i.SubCategory?.Name,
|
||||||
i.FK_BrandId, i.Brand?.Name,
|
i.FK_BrandId, i.Brand?.Name,
|
||||||
i.FK_BaseUomId, i.BaseUom.Name,
|
i.FK_BaseUomId, i.BaseUom.Name,
|
||||||
i.SalePrice, i.SyncSource, i.IsActive, i.CreatedAt,
|
i.SalePrice, i.ReorderLevel, i.SyncSource, i.IsActive, i.CreatedAt,
|
||||||
i.Conversions.Select(MapConversion).ToList());
|
i.Conversions.Select(MapConversion).ToList());
|
||||||
|
|
||||||
public async Task<List<ItemSummaryResponse>> GetAllAsync(Guid? categoryId = null, Guid? subCategoryId = null, Guid? brandId = null) =>
|
public async Task<List<ItemSummaryResponse>> GetAllAsync(Guid? categoryId = null, Guid? subCategoryId = null, Guid? brandId = null) =>
|
||||||
@@ -51,6 +51,7 @@ public class ItemService(IItemRepository repo, IUnitOfWork uow)
|
|||||||
FK_BrandId = request.BrandId,
|
FK_BrandId = request.BrandId,
|
||||||
FK_BaseUomId = request.BaseUomId,
|
FK_BaseUomId = request.BaseUomId,
|
||||||
SalePrice = request.SalePrice,
|
SalePrice = request.SalePrice,
|
||||||
|
ReorderLevel = request.ReorderLevel,
|
||||||
SyncSource = Models.SyncSource.Manual
|
SyncSource = Models.SyncSource.Manual
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -84,6 +85,7 @@ public class ItemService(IItemRepository repo, IUnitOfWork uow)
|
|||||||
item.FK_BrandId = request.BrandId;
|
item.FK_BrandId = request.BrandId;
|
||||||
item.FK_BaseUomId = request.BaseUomId;
|
item.FK_BaseUomId = request.BaseUomId;
|
||||||
item.SalePrice = request.SalePrice;
|
item.SalePrice = request.SalePrice;
|
||||||
|
item.ReorderLevel = request.ReorderLevel;
|
||||||
item.IsActive = request.IsActive;
|
item.IsActive = request.IsActive;
|
||||||
|
|
||||||
await uow.BeginAsync(ct);
|
await uow.BeginAsync(ct);
|
||||||
|
|||||||
Reference in New Issue
Block a user