namespace MMDAL.DTO.InventoryReports { // Stock Overview / Stock Position Analysis tile. New aggregation over TSTOCKPOSITION (real, // live-updated on every transaction -- previously exposed only as a single-item internal // lookup via StockPositionQB.GET_STOCK_POSITION, used by ProductionBLL). Composite dashboard // object, same shape convention as StockMovementDashboardDTO. // // WipByStage folds in what was originally scoped as a separate "WIP-by-stage" tile: MSKU // represents the production stage for multi-stage-tracked items in this codebase, and // TSTOCKPOSITION.WIPQUANTITY is a real, dedicated column -- grouping by SKUID directly gives // WIP-by-stage without a separate mechanism (no explicit "multi-stage tracking" flag was found // on MITEM, so this groups every item+SKU combination with WIPQUANTITY > 0, not just ones // flagged multi-stage -- a safe simplification since WIPQUANTITY itself is the authoritative // signal). public class StockOverviewDashboardDTO { public List ByCategory { get; set; } = new(); public List ByWarehouse { get; set; } = new(); public List WipByStage { get; set; } = new(); public StockAlertsDTO Alerts { get; set; } = new(); } public class StockByCategoryDTO { public int ItemCategoryId { get; set; } public string ItemCategoryCode { get; set; } = string.Empty; public string ItemCategoryName { get; set; } = string.Empty; public decimal Quantity { get; set; } public decimal Value { get; set; } } public class StockByWarehouseDTO { public int StoreId { get; set; } public string StoreCode { get; set; } = string.Empty; public string StoreName { get; set; } = string.Empty; public decimal Quantity { get; set; } public decimal Value { get; set; } } public class WipByStageDTO { public int SKUId { get; set; } public string SKUCode { get; set; } = string.Empty; public string SKUName { get; set; } = string.Empty; public decimal WipQuantity { get; set; } public decimal WipValue { get; set; } } public class StockAlertsDTO { public int StockoutCount { get; set; } public int ReorderBreachCount { get; set; } public int OverstockCount { get; set; } } }