# `Zizq.BudgetChange`
[🔗](https://github.com/zizq-labs/zizq-elixir/blob/v0.8.0/lib/zizq/budget_change.ex#L4)

The outcome of changing the budgets of many jobs at once.

    %Zizq.BudgetChange{changed: 12, blocked: ["01K9...", "01KA..."]}

## `:blocked`

Only queued (`:scheduled`, `:ready`) jobs can be rebound: an
in-flight job already debited against its budgets, and terminal jobs
are immutable by design. Rather than skipping those silently, the
server names the ones that *would* have changed but could not.

They are always in-flight jobs, so the list is a retry list — they
drain on their own, and the same call afterwards will pick them up:

    %{blocked: []} = MyApp.retry_until_clear(fn ->
      Zizq.query(MyApp.Zizq)
      |> Zizq.Query.where(queue: "emails")
      |> Zizq.Query.unbind_budget("stripe")
    end)

A job that matched the filter and needed no change is counted in
neither: it is not `:changed`, because nothing changed, and not
`:blocked`, because nothing was in the way.

# `t`

```elixir
@type t() :: %Zizq.BudgetChange{blocked: [String.t()], changed: non_neg_integer()}
```

# `complete?`

```elixir
@spec complete?(t()) :: boolean()
```

Whether every matching job was changed.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
