namespace MMDAL.DTO.InventoryReports { // KPI Summary tile. Composes numbers from three different sources rather than one query: // - TotalStockValue: bespoke direct query on TSTOCKPOSITION (a balance, not a flow -- doesn't // fit the DW engine's SOURCETYPE=2 per-date-row contract, see the FINVENTORY migration's // own comment for why). // - TotalMovementInValue/TotalMovementOutValue: read from the FINVENTORY fact table, posted // by the existing generic DW engine (WarehouseFactPostingDAL, SOURCETYPE=2) via the new // "mm.stock.posted" Dapr event + existing warehouse-drain-cron. Can legitimately read as 0 // before the first drain cycle runs for a given OU/date -- not a bug, just posting latency. // - ReorderBreachCount / ObsoleteStockValue: reused directly from the already-built Stock // Overview and Ageing tiles' own BLL methods, not recomputed. public class InventoryKPISummaryDTO { public decimal TotalStockValue { get; set; } public decimal TotalMovementInValue { get; set; } public decimal TotalMovementOutValue { get; set; } public int ReorderBreachCount { get; set; } public decimal ObsoleteStockValue { get; set; } } // Raw shape of GET_MOVEMENT_VALUE_FROM_FACT's single row -- folded into // InventoryKPISummaryDTO by the BLL, not exposed on its own. public class MovementValueFromFactDTO { public decimal TotalMovementInValue { get; set; } public decimal TotalMovementOutValue { get; set; } } }