Functional Weave
Code in Rust

insurance.excess-apply@1.0.1

README.md

2,522 bytes · view raw

# insurance.excess-apply

What the insurer pays on a claim once the excess (deductible) has been taken
off and the policy limit applied, and what the policyholder is left bearing.

## The excess

The excess is the compulsory excess (set by the insurer) plus the voluntary
excess (chosen by the policyholder for a lower premium); UK motor and home
policies quote them separately but apply them together. A loss smaller than
the excess pays nothing, and `excessApplied` is only the part of the excess
the loss used up.

## Where the limit sits

Policies differ on whether the limit is applied before or after the excess,
so the caller says which:

- `excessWithinLimit = false` (the usual "the most we will pay" wording): the
  excess comes off the loss, then the payout is capped at the limit.
  payout = min(loss - excess, limit).
- `excessWithinLimit = true` (the excess erodes the limit): the loss is capped
  at the limit, then the excess comes off it.
  payout = min(loss, limit) - excess.

They differ whenever the loss is above the limit: a 10,400.00 loss with a
500.00 excess and a 10,000.00 limit pays 9,900.00 the first way and 9,500.00
the second. `limitApplied` is true only when the limit actually reduced what
is paid.

No rounding happens: every figure is a whole number of minor units already.
For underinsurance, see `insurance.sum-insured-average`;
whether average comes before or after the excess is a policy wording question
too.

## Before you rely on this

**Not professional advice.** This capability calculates insurance figures from published rules. It is a software component for developers, not financial advice. Rules change and every rate here has an effective date. Check that the dates cover your case. Verify results against the official sources listed above, and have an actuary review how you use it, before anyone relies on the output. Provided "as is" under its licence, without warranty.

**Unreviewed.** This capability's implementations agree in every language and pass its published test vectors, which were worked out from the official sources cited. But no qualified actuary has yet checked those vectors, or confirmed that the capability covers the cases it claims. Treat it as a draft. Do not use it for real people, money or decisions without your own expert review. Once a qualified reviewer signs off, this notice is replaced with their name, qualification and the date. Each new version needs fresh sign-off.

1.0.1 marks it unreviewed. The code and the tests are unchanged.