namespace Extrudex.Domain.Interfaces; /// /// Detects low-stock filament spools based on configurable weight thresholds. /// Determines whether a spool's remaining filament falls below a critical level /// so that alerts and API flags can be surfaced to the user. /// public interface ILowStockDetector { /// /// Determines whether a spool is considered low stock based on its remaining /// weight relative to its total weight and the configured threshold percentage. /// /// The current remaining weight in grams. /// The total spool weight in grams when full. /// /// true if the remaining weight percentage is at or below the configured /// low-stock threshold; false otherwise. Returns false for spools /// with zero total weight to avoid division-by-zero. /// bool IsLowStock(decimal weightRemainingGrams, decimal weightTotalGrams); /// /// Calculates the remaining weight as a percentage of total weight. /// /// The current remaining weight in grams. /// The total spool weight in grams when full. /// /// A value between 0 and 100 representing the percentage of filament remaining. /// Returns 0 if total weight is zero to avoid division-by-zero. /// decimal GetRemainingWeightPercent(decimal weightRemainingGrams, decimal weightTotalGrams); /// /// Gets the currently configured low-stock threshold percentage. /// Useful for API responses so clients know what threshold is in effect. /// decimal LowStockThresholdPercent { get; } }