Definitions
The claims terms the operator, its detectors and Ask all run on. Each has an owner, a version, SQL and tests. Edits make a new version.Total loss
total_loss unit: claims no canonical variant: Ask returns all 2A motor claim where repairing the car makes no sense. Motor Claims draws the line on the repair against the car's value; Claims Finance draws it lower, because a repair also brings hire-car and storage costs.
engineeringHead of Motor Claims · claims
v1
Motor claims reported in the period whose latest estimate as of now is at least engineering_ratio of the vehicle value on the policy. The operator's total-loss check uses this line.
latest change: First version.
- pass count_betweenobserved 66, expected between 5.0 and 400.0
SQL, rendered for now
WITH est AS (SELECT claim_id, arg_max(amount, received_at) AS amount FROM documents
WHERE kind = 'estimate' AND received_at <= TIMESTAMP 'Mon 17:00:00' GROUP BY claim_id)
SELECT c.id AS claim_id, c.claim_no, e.amount AS estimate, p.vehicle_value,
round(e.amount / p.vehicle_value, 3) AS ratio, c.total_loss_at
FROM claims c JOIN est e ON e.claim_id = c.id JOIN policies p ON p.id = c.policy_id
WHERE c.line = 'motor' AND c.reported_at >= TIMESTAMP 'Sat 17:00:00 (30 days ago)' AND c.reported_at < TIMESTAMP 'Mon 17:00:00'
AND e.amount >= 0.7 * p.vehicle_value
ORDER BY c.id
financeHead of Claims Finance · finance
v1
The same claims, with the line at finance_ratio of the vehicle value: repair, hire car and storage together pass the car's value earlier than the repair alone.
latest change: First version.
- pass count_betweenobserved 95, expected between 5.0 and 500.0
SQL, rendered for now
WITH est AS (SELECT claim_id, arg_max(amount, received_at) AS amount FROM documents
WHERE kind = 'estimate' AND received_at <= TIMESTAMP 'Mon 17:00:00' GROUP BY claim_id)
SELECT c.id AS claim_id, c.claim_no, e.amount AS estimate, p.vehicle_value,
round(e.amount / p.vehicle_value, 3) AS ratio, c.total_loss_at
FROM claims c JOIN est e ON e.claim_id = c.id JOIN policies p ON p.id = c.policy_id
WHERE c.line = 'motor' AND c.reported_at >= TIMESTAMP 'Sat 17:00:00 (30 days ago)' AND c.reported_at < TIMESTAMP 'Mon 17:00:00'
AND e.amount >= 0.6 * p.vehicle_value
ORDER BY c.id
Parameters
change one, see what changes today, then save it as a new version with a noteHistory
append-only; nothing is edited in place- definitionHead of Motor Claims engineering v1 First version.
- definitionHead of Claims Finance finance v1 First version.