(runs: MaintainRun[], nowMs: number)
| 96 | |
| 97 | /** Project the going rate forward: cleanups + minutes saved per month, from the last 28 days. PURE. */ |
| 98 | export function projectMonthly(runs: MaintainRun[], nowMs: number): { cleanupsPerMonth: number; minutesPerMonth: number } { |
| 99 | const since = nowMs - 28 * 86_400_000; |
| 100 | const recent = runs.filter(r => r.status === 'opened' && r.at && Date.parse(r.at) >= since).length; |
| 101 | return { cleanupsPerMonth: recent, minutesPerMonth: recent * 5 }; |
| 102 | } |
| 103 | |
| 104 | export interface MaintainForecast { |
| 105 | weeklyAvg: number; // mean opened/week over the window |
no outgoing calls
no test coverage detected