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.Open claim
open_claim unit: claims no canonical variant: Ask returns all 2A claim that is still open. Claims Operations and Claims Finance both use the words and mean different things: a file still being worked, or a claim that still owes money.
claimsHead of Claims Operations · claims
v1
Reported and not closed as of now, whatever its money position. A claim waiting for the claimant counts.
latest change: First version.
- pass count_betweenobserved 7258, expected between 3000.0 and 14000.0
- pass uniqueobserved {'duplicates': 0}, expected claim_id unique
SQL, rendered for now
SELECT c.id AS claim_id, c.claim_no, c.line, c.peril, c.reported_at, c.adjuster_id FROM claims c WHERE c.reported_at <= TIMESTAMP 'Mon 17:00:00' AND (c.closed_at IS NULL OR c.closed_at > TIMESTAMP 'Mon 17:00:00') ORDER BY c.id
financeHead of Claims Finance · finance
v1
A claim that still owes money as of now: a payment requested and not yet paid (and not held), or an estimate authorised with no payment requested yet. A closed file with an unpaid payment counts; an open file with nothing agreed to pay does not.
latest change: First version.
- pass count_betweenobserved 5877, expected between 300.0 and 9000.0
- pass uniqueobserved {'duplicates': 0}, expected claim_id unique
SQL, rendered for now
SELECT c.id AS claim_id, c.claim_no, c.line, c.peril, c.reported_at, c.adjuster_id
FROM claims c
WHERE c.reported_at <= TIMESTAMP 'Mon 17:00:00'
AND (EXISTS (SELECT 1 FROM payments p WHERE p.claim_id = c.id AND p.requested_at <= TIMESTAMP 'Mon 17:00:00'
AND (p.paid_at IS NULL OR p.paid_at > TIMESTAMP 'Mon 17:00:00') AND (p.held_at IS NULL OR p.held_at > TIMESTAMP 'Mon 17:00:00'))
OR (EXISTS (SELECT 1 FROM claim_events e WHERE e.claim_id = c.id AND e.type = 'estimate_authorised'
AND e."at" <= TIMESTAMP 'Mon 17:00:00')
AND NOT EXISTS (SELECT 1 FROM payments p WHERE p.claim_id = c.id AND p.requested_at <= TIMESTAMP 'Mon 17:00:00')))
ORDER BY c.id
History
append-only; nothing is edited in place- definitionHead of Claims Operations claims v1 First version.
- definitionHead of Claims Finance finance v1 First version.