# `Wardrik.Spend`

What an org's agents have spent against one ceiling in its current period.
See `Wardrik.Ceiling`.

  * `:ceiling` - the ceiling's name.
  * `:limit` - its limit, as a `Wardrik.Amount`.
  * `:spent` - what the agents have spent.
  * `:granted` - what approvals added.
  * `:per` - the period: `:day`, `:week`, `:month` or `:total`.
  * `:on_exhausted` - what the next call does once it's spent: `:ask`, `:deny` or `:continue`.
  * `:starts_over` - the day the period resets. `nil` for `:total`.

# `t`

```elixir
@type t() :: %Wardrik.Spend{
  ceiling: term(),
  granted: term(),
  limit: term(),
  on_exhausted: term(),
  per: term(),
  spent: term(),
  starts_over: term()
}
```

# `from_json`

```elixir
@spec from_json(map()) :: t()
```

Builds one from the protocol's JSON.

# `to_json`

```elixir
@spec to_json(t()) :: map()
```

Returns it as the protocol's JSON, without fields that are `nil`.

---

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