Functional Weave
Code in Rust

insurance.sum-insured-average@1.0.0

README.md

1,986 bytes · view raw

# insurance.sum-insured-average

Claim settlement under an average clause (the underinsurance, or "pro rata
average", condition in UK property policies). If the sum insured is less than
the value at risk, the policyholder is treated as their own insurer for the
difference and is paid only that share of any loss:

    payout = loss x sumInsured / valueAtRisk

So a building worth 200,000 insured for 150,000 (75%) is paid 30,000 on a
40,000 loss, not 40,000. The payout is never more than the loss (over-
insurance does not pay a profit) or the sum insured (a total loss when
underinsured pays the sum insured).

## The condition

`conditionBasisPoints` says when average applies at all:

- **10000**: pro rata average, whenever the sum insured is below the value.
- **7500** (or 8500 and so on): a *special condition of average*, where
  average applies only if the sum insured is below that share of the value
  at risk; above it, losses are paid in full up to the sum insured. When it
  applies, it applies in the full proportion (sum insured / value), which is
  the usual UK wording. Some wordings instead scale by sum insured over the
  threshold value; that is a different clause and not this one.

The test is strict: insured for exactly 75% under a 75% condition is not
below it, so no average.

## Details

- The payout rounds to the minor unit in the caller's mode. The product of a
  loss and a sum insured in pence can pass 2^53 (a 12,000,000.00 building),
  so it is divided exactly as a big integer (i128 in Rust) before rounding.
- `insuredProportionBasisPoints` is sum insured over value at risk, rounded
  down and capped at 10000, for display ("insured for 83.33% of value").
- `valueAtRisk` is the full reinstatement (or market) value at the time of
  the loss, on whatever basis the policy says; the loss may not exceed it.
- Apply the excess with `insurance.excess-apply`; whether the excess comes
  off before or after average is a matter of the policy wording.