Description
budgetTracker tracks cumulative spending against a budget but silently exceeds limits. Contributors should add an onOverspend(overspentBy: number, budgetId: string) callback option that fires whenever a new payment pushes the total above the configured budget ceiling, so callers can trigger warnings or block further payments.
Acceptance Criteria
Context
- Target file:
src/lib/budgetTracker.ts
Description
budgetTrackertracks cumulative spending against a budget but silently exceeds limits. Contributors should add anonOverspend(overspentBy: number, budgetId: string)callback option that fires whenever a new payment pushes the total above the configured budget ceiling, so callers can trigger warnings or block further payments.Acceptance Criteria
onOverspendcallback option is accepted by the tracker's configurationoverspentByis the positive difference between the new total and the budget limitContext
src/lib/budgetTracker.ts