Class CostBudgetEvaluator

java.lang.Object
com.tnsai.quality.cost.CostBudgetEvaluator

public final class CostBudgetEvaluator extends Object
Resolves a CostBudget's current BudgetState by querying its CostBudgetStore for cumulative spend (issue #82).

Stateless wrapper — the evaluator just routes the budget's scope/period query to the store and packages the result. Designed so the (follow-up) CostBudgetEnforcer hook can read state without coupling itself to the store's API directly.

Since:
0.5.0 (issue #82)
  • Constructor Details

  • Method Details

    • evaluate

      public BudgetState evaluate(CostBudget budget)
      Evaluate the budget against current spend in the store.
    • evaluate

      public BudgetState evaluate(CostBudget budget, Instant evaluatedAt)
      Evaluate as of evaluatedAt — the now the resulting state's BudgetState.evaluatedAt carries. The store's "current spend over period" query still uses wall-clock; passing evaluatedAt only stamps the snapshot.