# Collections

> Reminders, threats, suspension proposals and payment plans that follow each sector's own collection terms, with a person deciding every suspension.

One account can hold electricity, broadband and water under three different laws. Each
law says when a customer may be reminded, threatened with a suspension or cut off, and
which claims never count. konto does not know these laws. The engine of each contract
sends its rules as `collection-terms@1`, and konto evaluates them exactly.

## Collection terms

| Term | Says |
|---|---|
| claim nature | civil or public law; a public-law fee gets a reminder and stops |
| minimum arrears | the floor before a threat: an absolute amount, a multiple of the monthly instalment, or a share of the expected annual amount |
| excluded states | claim states that never count as arrears, such as disputed |
| threat lead | from the threat to the earliest suspension, in calendar, working (Mon–Sat) or business days (Mon–Fri) |
| announcement lead | from the decision to the suspension, if the law asks for one |
| suspension | whether the engine suspends at all |
| plan | the instalment ranges the law allows |
| letter blocks | the texts every letter must carry |
| legal basis | the norms the terms implement, as the law cites them |

Public holidays differ per Land and are an input; konto keeps no calendar of law.

## Assess

```rust
use konto_collect::assess;

let a = assess(&case, today)?;
println!("{}", a.contracts[0].summary_de);
// Strom: Rückstand 172,41 € (39,99 € ausgenommen), Schwelle 160,00 €. Nächster Schritt:
// Vorschlag zur Sperrung (Entscheidung durch eine Person), frühestens am 29.03.2027.
```

For every contract the assessment says how much counts as arrears, which claims are
excluded and why, the threshold, the next step (reminder, threat or proposal) and its
earliest date. When a step is not possible yet, it says why, with a code and a German
sentence that names the amount or the date.

## A person decides

A suspension proposal is made only when every term holds. A person then decides against
a fresh assessment, and only an approval with a reason creates a `SuspendOrder`. The type
has no public constructor and no deserialiser, so no other code path can make one. The
order carries the reviewer and the digest of the evidence, never the reason, which may
describe a hardship. The engine then performs the suspension under its own law, and may
refuse.

## Help before dunning

`plan` splits arrears into monthly instalments inside the engine's and the creditor's
ranges, exact to the cent; earlier instalments carry any extra cent:

```text
3 Raten zu je 70,80 €, monatlich ab 15.04.2027, zinsfrei. Zusammen 212,40 €.
```

## In the service

`POST /v1/accounts/{account}/collections/assess` takes the contracts with their terms as
`collection-terms@1` documents, the date and the holidays, reads the account's open
claims from the ledger and answers the assessment. konto counts only claims that are due
and only claims from bills, so the profile's `not_yet_due` and `advance_payment`
exclusions always hold; an exclusion or a currency konto does not evaluate is refused
(`unknown_terms`).
