Skip to main content
A rater checks each request before it calculates. A request that breaks a rule gets a refusal in place of a premium. The refusal lists detected violations within its size limits. What rslc checks and guarantees explains why.

The refusal

rslc.PreparedRater.rate returns one result for each request, the value of this JSON. This refusal comes from the rater of the example program effective://example-ca-ppa, for a vehicle 60 years old in rideshare use:
A vehicle use of "racing" breaks only the enum rule, so the refusal is InvalidInputs:
The shared renters example asks dog_has_bitten only of a household that has a dog:
A request with has_dog as true that leaves out dog_has_bitten breaks the follow-up rule:
Results describes the result that holds a refusal, for rate and for evaluate. Each violation has six fields: The JSON is compact, with sorted keys and numbers in exact decimal form.

Codes

A rule with its own code reports that code. Every other rule reports one of these: A rule’s own code replaces the INPUT code of a range, length or other rule. Type checks, INPUT-KEY and INPUT-REF keep their own codes.

Order of the checks

The rater checks a request in three passes:
  1. Shape. Each record, input and value has the declared kind, enum member, pattern and precision.
  2. Keys. Each keyed by key is unique, and each reference names an element of its list.
  3. Rules. Each where rule holds. The rater checks each record’s inputs in order, then the records inside it, then the record’s own rules.
Record rules that read calculated values run after ordinary input validation and before final rating outcomes. The check for a missing follow-up input is a rule of its record, so it runs in the third pass. One input reports at most one broken rule. A rule runs only when every value it reads passed the earlier passes. So each violation points to its own cause.

Size limits

A text cut short ends with …. When a limit cuts the refusal, truncated is true.

Runtime representations

Relativities reports one violation of a refusal in the columns reason_code and reason. For refused it is the first violation with a rule’s own code, and for invalid_inputs it is the first violation. Results lists each field of these results, and the result for a fault.