namespace MMDAL.DTO.InventoryReports { // Inventory Ageing tile. Fixed 4-bucket version (0-30 / 31-60 / 61-90 / >90 days) of legacy // GB4's StockPositionBLL.StockAgeingDetailReport + StockPositionQueryBuilder // .STOCK_AGEING_DETAIL_REPORT_ITEMCATEGORY (see // /Users/venkatv/Downloads/VVMMBLLDAL/MMBLL/Stock/StockPositionBLL.cs:173 and // StockPositionQueryBuilder.cs:3669). Legacy supported 1-6 admin-configurable buckets across // 9 dimension variants (Account/Category/SubCategory/Group/Brand/Model/Store/Pack/SKU); this // v1 fixes the bucket count to 4 (matching the dashboard mockup's own framing) and the // dimension to ItemCategory, consolidating rather than porting all 9 near-duplicate SQL blocks // verbatim -- a deliberate scope trim, not an oversight. The core FIFO-waterfall allocation // technique (current stock sliced against each age band, oldest-first) is ported faithfully. // // High-value idle stock / obsolete-item sub-panels are derived views of this same result set // (sort/filter by Age4Value/Age4GoodQuantity descending), not separate endpoints. public class StockAgeingReportDTO { public int ItemCategoryId { get; set; } public string ItemCategoryCode { get; set; } = string.Empty; public string ItemCategoryName { get; set; } = string.Empty; public int ItemId { get; set; } public string ItemCode { get; set; } = string.Empty; public string ItemName { get; set; } = string.Empty; public string UOMCode { get; set; } = string.Empty; public decimal CurrentStock { get; set; } public decimal CurrentStockValue { get; set; } // Age1 = most recent (0-30 days), Age4 = oldest (>90 days) -- allocated waterfall-style: // current stock is sliced against each band's inward quantity, recent band first. public decimal Age1GoodQuantity { get; set; } public decimal Age1Value { get; set; } public decimal Age2GoodQuantity { get; set; } public decimal Age2Value { get; set; } public decimal Age3GoodQuantity { get; set; } public decimal Age3Value { get; set; } public decimal Age4GoodQuantity { get; set; } public decimal Age4Value { get; set; } } }