# `ISO20022.Camt053.Balance`
[🔗](https://github.com/ARTARNA/ex_iso20022/blob/main/lib/iso_20022/camt/053/balance.ex#L1)

A balance entry from `<Bal>`.

## Balance types

| Atom | ISO code | Description |
|------|----------|-------------|
| `:opening_booked` | `OPBD` | Opening booked balance (mandatory) |
| `:closing_booked` | `CLBD` | Closing booked balance (mandatory) |
| `:closing_available` | `CLAV` | Closing available balance |
| `:interim_booked` | `ITBD` | Interim booked balance |
| `:interim_available` | `ITAV` | Interim available balance |
| `:forward_available` | `FWAV` | Forward available balance |
| `{:other, code}` | any | Unrecognised type code |

`amount` is always a positive `Decimal`. The sign of the balance is expressed via
`credit_debit`: `:credit` for a positive/credit balance, `:debit` for an
overdraft/negative balance.

# `balance_type`

```elixir
@type balance_type() ::
  :opening_booked
  | :closing_booked
  | :closing_available
  | :interim_booked
  | :interim_available
  | :forward_available
  | {:other, String.t()}
```

# `credit_debit`

```elixir
@type credit_debit() :: :credit | :debit
```

# `t`

```elixir
@type t() :: %ISO20022.Camt053.Balance{
  amount: Decimal.t(),
  credit_debit: credit_debit(),
  currency: String.t(),
  date: Date.t(),
  type: balance_type()
}
```

# `parse_type`

```elixir
@spec parse_type(String.t()) :: balance_type()
```

Parses an ISO 20022 balance type code string into an atom.

---

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