/**
 * Supply risk detection thresholds.
 * Loaded from environment variables with healthcare-appropriate defaults.
 */
export function loadThresholds() {
    return {
        criticalDaysSupply: intEnv('CRITICAL_DAYS_SUPPLY', 2),
        warningDaysSupply: intEnv('WARNING_DAYS_SUPPLY', 7),
        surplusDaysSupply: intEnv('SURPLUS_DAYS_SUPPLY', 90),
        imbalanceRatio: intEnv('IMBALANCE_RATIO', 10),
        autoActionEnabled: process.env['AUTO_ACTION_ENABLED'] === 'true',
        autoActionMaxValue: intEnv('AUTO_ACTION_MAX_VALUE', 10000),
        defaultReorderPointDays: intEnv('DEFAULT_REORDER_POINT_DAYS', 7),
        maxDaysOnHand: intEnv('MAX_DAYS_ON_HAND', 90),
    };
}
function intEnv(name, fallback) {
    const raw = process.env[name];
    if (!raw)
        return fallback;
    const parsed = parseInt(raw, 10);
    return Number.isFinite(parsed) ? parsed : fallback;
}
//# sourceMappingURL=thresholds.js.map